[prog] curses forms paging

ed orphan millward at Ms.UManitoba.CA
Tue Mar 2 10:39:50 EST 2004


I'm trying to write a simple form for
user input using curses forms.
 It works OK until I attempt to 
activate more fields than will fit
on one screen. In other words,
the screen is full and there ain't
room for no more. I've got a maximum
of 16 fields on the screen. Any attempt
to overflow the screen results in
program failure.  
I've read in the curses tutorial that
you can  'page' the form using:
int set_new_page(FIELD * field,
                bool new_page_flag );
It looks so simple, it can't be true!
Yup. It don't work! Not yet anyway.
I set my 16th field as the trigger for
a new field:
  set_new_page( field[15], TRUE );
In my input loop, I tried to get the
PageDown key to activate it.
 input = getch()
 {
   case KEY_NPAGE:  /* see <curses.h> */
           form_driver( my_form, REQ_NEXT_PAGE);
           form_driver( my_form, REQ_END_LINE);
           break;
I've tried variations of the above, for example, using
the F5 key to trigger a new page, and placing the
set_new_page command in different locations, and
setting different fields as the breakpoint for a new
page, but nothing works. 
Could someone tell me how to get a new page on
the screen using curses forms? I'm just going around
in circles here. Any suggestions would be welcome.

            




More information about the Programming mailing list