The Four Types of Vermont Views Windows

Vermont Views provides four functions for creating windows. These include: basic windows, virtual windows, non-buffered windows (to which you must later assign a buffer) and windows used to view memory files.

Basic and Virtual Windows

The simplest function is wn_def(), which creates a basic window. A has three defining characteristics:

(1) It is created as a basic window, either by using wn_def() or by creating the window in the Designer.
(2) By By default, it has a memory screen that is the same size as the window's work area.
(3) It It has an associated processing function which displays the window, waits for the user to press a key, and then takes the window down

wn_vdef() creates a virtual window. A virtual window has these defining characteristics:

(1) It is created as a virtual window, either by using wn_vdef() or by modifying the window to make it virtual in the Designer.
(2) It has a memory screen that may be larger than the window's work area.
(3) It has an associated processing function which displays the window, allows the user to browse or scroll through the information in the memoryscreen, and then removes the window when the user presses the Quit key or Exit key.

If you write to either a basic or a virtual window, the output is written to the memory screen. Since the information is in the memory screen, it is not lost when the window is taken off the physical screen. If you use the video output functions to write to a window whose memory screen is larger than the work area, the output will scroll through the work area so that the information you have written will be in view. Information that scrolls out of the work area is not lost, because it is still in the memory screen. However, if you try to write more information than will fit into the memory screen itself, the information in the memory screen may scroll. (This is an option that you can control.) Information that is scrolled off the memory screen itself is lost.

The above paragraph discusses how scrolling will occur when you are writing to a window. There is a separate issue related to scrolling, which is whether the user of the application will be able to scroll the information, by using the arrow keys or the mouse. The processing function, which is assigned to the window when the window is created, controls whether the user can scroll the information interactively.

Non-Buffered Windows

There are times when it is advantageous to allocate a window without a buffer, and to create or assign a buffer afterward. For example, suppose you want to define a basic window that does not scroll, and add margins to this window. If you create a window with wn_def(), a memory screen is created that matches the window's interior work area. When you add margins to the window, the interior work area shrinks, making the memory screen larger than the work area. This makes the window appear to be a virtual window. The functions used for writing to the window will write to the entire buffer, but the user can only see the information displayed in the work area. Since the processing function for the window has not changed, the user is not allowed to scroll through the memory screen.

The third function for creating a window, wn_nbdef(), is very similar to wn_def(), but it does not allocate a memory screen or assign a memory file to the window. This allows you to create a window, set the margins, and then define a memory screen that matches the window's interior work area. If you use wn_nbdef() to create a window, you must later assign a memory screen or memory file to the window before using it.

A window created with wn_nbdef() has the following characteristics:

(1) It is created as a non-buffered window in code. Non-buffered windows cannot be created in the Designer.
(2) It has no memory screen or memory file associated with it. Note that you must associate a memory screen or memory file with this window before using the window.
(3) It has an associated processing function which displays the window, waits for the user to press a key, and then takes the window down.

Windows Associated with Memory Files

The fourth window definition function, wn_mfdef(), defines a window that uses a memory file as a buffer instead of a memory screen. The call for wn_mfdef() is the same as for wn_def() except that one additional parameter, the memory file pointer, is passed. wn_mfdef() does not allocate a memory screen at all, since the memory file will act as the buffer for the work area.

A window created with wn_mfdef() has the following characteristics:

(1) It is created and associated with a memory file in a single step, by calling wn_mfdef(). You cannot explicitly associate a window with a memory file in the Designer, although you can assign a memory file to the window after you read the window from the Designer library.
(2) It has a memory file associated with it. The memory file acts as the buffer for this window.
(3) It has an associated processing function which displays the window, allows the user to scroll through the information in the memory file, and then takes the window down when the user presses the Quit key or Exit key.

wn_def() and wn_vdef() are discussed in more detail in this chapter. For more information about wn_mfdef(), see Chapter 45, "Creating and Viewing Memory Files." For more information about wn_nbdef(), see Chapter 25, "Changing the Appearance of Windows."


Home Contents Previous Next