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

Posting and unposting forms

When you have created a form and its window and subwindow, you are ready to post it. To post a form is to display it on the form's subwindow; to unpost a form is to erase it from the form's subwindow.

SYNOPSIS

   int post_form (form)
   FORM * form;
   

int unpost_form (form) FORM * form;

Unposting a form does not remove its data structure from memory.


NOTE: To post a form, be sure that you have connected fields to it first.

``Posting and unposting a form'' uses two application routines, display_form and erase_form, to show how you might post and later unpost a form. The code builds on that used previously in ``Creating a border around a form'' to create the form's window and subwindow.

   static void display_form (f)	/* create form windows and post */
   FORM * f;
   {
   	WINDOW *	w;
   	int		rows;
   	int		cols;
   

scale_form (f, &rows, &cols); /* get dimensions of form */

/* create form window */

if (w = newwin (rows+4, cols+4, 0, 0)) { set_form_win (f, w); set_form_sub (f, derwin (w, rows, cols, 2, 2)); box (w, 0, 0); keypad (w, 1); } else /* error routine in previous section "ETI Low-level Interface to High-level Functions" */ error ("error return from newwin", NULL);

if (post_form (f) != E_OK) /* post form */

error ("error return from post_form", NULL); else refresh (w); }

static void erase_form (f) /* unpost and delete form windows */ FORM * f; { WINDOW * w = form_win (f); WINDOW * s = form_sub (f);

unpost_form (f); /* unpost form */ werase (w); /* erase form window */ wrefresh (w); /* refresh screen */ delwin (s); /* delete form windows */ delwin (w); }

Posting and unposting a form

If successful, function post_form returns E_OK. If not, it returns one of the following:


E_SYSTEM_ERROR -
system error

E_BAD_ARGUMENT -
NULL form pointer

E_POSTED -
form is already posted

E_NOT_CONNECTED -
no connected fields

E_NO_ROOM -
form does not fit in subwindow
If successful, the function unpost_form returns E_OK. If not, it returns one of the following:

E_SYSTEM_ERROR -
system error

E_BAD_ARGUMENT -
NULL form pointer

E_NOT_POSTED -
form is not posted

E_BAD_STATE -
called from init/term function
The initialization and termination routines are discussed in the next section.
Next topic: Form driver processing
Previous topic: Creating a border around a form

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