bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reading out a form


From: TW
Subject: Re: Reading out a form
Date: Tue, 24 Feb 2009 01:08:22 -0700

> I just read this page:
> http://tldp.org/HOWTO/NCURSES-Programming-HOWTO/forms.html
> And can produce forms know.
> 
> But I do not know how to read the form contents.
> Can someone give me a hint?

        The prototype function for what you need is:

                char *field_buffer(FIELD *field, int buf);

        So, put in the field of the data you want to retrieve, 
then put in 0 for the buffer.  Buffers other than 0 are application 
specific and are not used by the forms library routines.

        After calling that function, you need to, basically, move 
out of the field, or move in the field, or whatever.  I just request 
the end of the line because I usually don't want to move to the next 
field yet.  So, call:

                form_driver(my_form, REQ_END_LINE);

        my_form is your instantiated form object.  You should be OK with 
that info.  Don't forget to look at the function:

                int set_field_buffer(FIELD *field, int buf, char *value);

        It could come in handy when you want an intial value in the field 
when the form comes up.

-- 
VR~
        TW
        Email: address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]