DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
ETI forms

Positioning the form cursor

As with menu processing, some processing of user form requests may move the cursor from the location required for continued processing by the form driver. This function moves the cursor back to where it belongs.

SYNOPSIS

   int pos_form_cursor (form)
   FORM * form;
You need call this function only if your application program changes the cursor position of the form window.

``Repositioning the cursor after printing page number'' illustrates one use of this function. Function printpage repositions the cursor after it prints the page number in the form window.

   void printpage (form)
   FORM * form;
   {
   	int		p = form_page (form) + 1;
   	WINDOW *	w = form_win (form);
   	int		rows, cols;
   	char		buf[80];
   

box (w, 0, 0); /* put border around form window */ getmaxyx (w, rows, cols); /* fetch window size */ sprintf (buf, " %d ", p); /* store next page number */

wmove (w, (rows-1), ((cols-1)-strlen(buf))/2); /* position cursor */ waddstr (w, buf); /* print page number */

/* position the form cursor for continued form processing */

pos_form_cursor (form); }

main () { FORM * form;

set_form_init (form, printpage); }

Repositioning the cursor after printing page number

If pos_form_cursor encounters an error, it returns one of the following:


E_SYSTEM_ERROR -
system error

E_BAD_ARGUMENT -
NULL form pointer

E_NOT_POSTED -
form is not posted

Next topic: Setting and fetching the form user pointer
Previous topic: Example changing and checking the form page number

© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004