Virtual Windows

To use a virtual window in the code example above, you must do three things:

wn_vdef() is used to define a virtual window. wn_vdef() is identical to wn_def() except that you specify the number of rows and columns in the memory screen.

In Step 3, then, replace the call to wn_def() with a call to the virtual window define function, wn_vdef():

WINDOWPTR wn_vdef(rb, cb, rowq, colq, att, bdrp, ms_rowq, ms_colq)
 
int rb;
/* Beginning row of window
*/
int cb;
/* Beginning column of window 
*/
int rowq;
/* Number of rows to make window
*/
int colq;
/* Number of columns to make window
*/
UCHAR att;
/* Attribute for window 
*/
BORDERPTR bdrp;
/* Pointer to border to use for window
*/
int ms_rowq;
/* Number of rows to make memory screen
*/
int ms_colq;    
/* Number of columns to make memory screen
 

For the last two arguments, ms_rowq and ms_colq, you specify the number of rows and columns in the memory screen. For a detailed explanation of the other arguments, see the description of wn_def() above or in the Function Reference.

Processing Function Assigned to a Virtual Window

The processing function assigned to a virtual window puts the window on the screen (if it is not already up) and allows the user to browse through the information in the window's memory screen. If the memory screen is larger than the window's work area, the user can scroll the information in the work area so that he can see the entire contents of the memory screen. When the user presses the Quit key or the Exit key, the processing function terminates. It takes the window off the screen if it put the window on the screen, or if the AUTOUPDN option is ON for the window.

How to Process a Virtual Window

To process a window, use the window process function, wn_proc():

int wn_proc(wnp)

WINDOWPTR wnp;        /* Pointer to window        */

wn_proc() calls the processing function for the window. The processing function for a virtual window is described above.


Home Contents Previous Next