bug-ncurses
[Top][All Lists]
Advanced

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

field_opts_off() returns E_CURRENT


From: TW
Subject: field_opts_off() returns E_CURRENT
Date: Fri, 27 Mar 2009 17:50:55 -0600

        Here's the code that I have:

                /* Initialize the fields */
                /* num rows, num cols, start row, start col, off-screen rows, 
num buffers */
                for(i=0, j=0; i<NFIELDS-1; i=i+2, j++) {
                field[i] = new_field(1, CAPTION_WIDTH, FORM_STARTY+j, 
FORM_STARTX, 0, 0);
                field[i+1] = new_field(1, FORM_WIDTH, FORM_STARTY+j, 
CAPTION_WIDTH+3, 0, 0);
                }
                field[NFIELDS-1] = NULL;
                
                <...create and post form and refresh...>
                <...snip...>

                /* Set field options */
                for(i=0, j=0; i<NFIELDS-1; i=i+2, j++) {
                /* Set row label buffer */
                set_field_buffer(field[i], 0, form_data[j].label);
                
                /* Set field options for label */
                        ==> RETURNS E_CURRENT
                result = field_opts_off(field[i], O_ACTIVE | O_EDIT);
                
                /* Set row data buffer */
                set_field_buffer(field[i+1], 0, form_data[j].buffer_msg);
                
                /* Set field options for data buffer */
                result = field_opts_on(field[i+1], form_data[j].fld_bits_on);
                result = field_opts_off(field[i+1], form_data[j].fld_bits_off);
                
                /* Show underline for data field */
                set_field_back(field[i+1], A_UNDERLINE);
                
                /* Set field types for data fields */
                if(form_data[j].ftype == TYPE_ALPHA)
                        set_field_type(field[i+1], form_data[j].ftype, 
form_data[j].width);
                else if(form_data[j].ftype == TYPE_ALNUM)
                        set_field_type(field[i+1], form_data[j].ftype, 
form_data[j].width);
                else if(form_data[j].ftype == TYPE_ENUM)
                        set_field_type(field[i+1], form_data[j].ftype, 
form_data[j].value_list, 
                        form_data[j].check_case, form_data[j].check_unique);
                else if(form_data[j].ftype == TYPE_INTEGER)
                        set_field_type(field[i+1], form_data[j].ftype, 
form_data[j].padding, 
                        form_data[j].min, form_data[j].max);
                else if(form_data[j].ftype == TYPE_NUMERIC)
                        set_field_type(field[i+1], form_data[j].ftype, 
form_data[j].padding, 
                        form_data[j].min, form_data[j].max);
                else if(form_data[j].ftype == TYPE_REGEXP)
                        set_field_type(field[i+1], form_data[j].ftype, 
form_data[j].regexp);
                }
                
                refresh();
                curs_set(1);

                <...snip...>
}

        The set_field_buffer function returns E_CURRENT for field[0], though 
the field is 
in memory.  The other fields return E_OK.  (1) Why is only field[0] not getting 
O_ACTIVE and 
O_EDIT deactivated.  (2) I know that E_CURRENT is explained as "the field is 
the active one 
on the form."  I don't understand it in the context of this problem I'm having. 
 If it's the 
current one, shouldn't the function work as planned?

-- 
VR~
        TW
        Email: address@hidden




reply via email to

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