When a window is created using the Designer or one of the window definition functions (wn_def(), wn_nbdef(), wn_vdef(), or wn_mfdef()), a default processing function is installed for the window. For a basic window, this function simply displays the window, waits for a the user to press a key, and then removes the window. For a virtual window or a window with a memory file, this function displays the window and allows the user to scroll through the text information.
To simplify the task of processing a window, Vermont Views provides a generic window processing function, wn_proc(), which simply calls the processing function that was installed in the window when it was created. You can call wn_proc() for basic windows, virtual windows, and windows that use memory files as buffers.
To process a window, use the window process function, wn_proc():
|
wn_proc() calls the processing function for the window. The processing function places the window on the screen, if it is not already up. It then passes control to the user. If the window is a basic window, the processing function simply waits for the user to press any key, and then returns. If the window is virtual, or if it has a memory file that can be scrolled, the processing function allows the user to browse the contents of the window's buffer. When the user presses the Quit key or the Exit key, the processing function takes the window down if the window was not up when wn_proc() was called.
If you want the user to be able to scroll a window, you must #include vv_wnkt.h before vv_main.h in your program in order to link in the viewing event table VIEWETP.
As with any event table, you can reassign the functions to different keys and install your own functions in the event table. For more information about event tables see Chapter 37, "How Event Processing Works."