The function wn_nbdef() creates a window that has no buffer. There are several reasons why you might need to use this function. The most common use is to create a basic window with margins in code, as described above. The easiest way to create such a window is to use the Designer and specify your margins in the Designer. If you need to create the window in code, however, the most efficient way to do this is to use wn_nbdef(), set the margins, and then allocate the memory screen. You may also need to create a window without a buffer to take advantage of some of the advanced features in Vermont Views, such as allowing two windows to share the same memory screen. These advanced features are discussed in Chapter 28, "Advanced Window Management."
In order to use a window created with wn_nbdef(), you must first assign a memory screen or memory file buffer to the window.
To create a window with no buffer, use the window definition with no buffer function, wn_nbdef()
|
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The call to wn_nbdef() is identical to that of wn_def(). The only difference is that no memory screen is assigned to the window. For more information on the argument list for wn_nbdef(), refer to the description of the wn_def() function in Chapter 23, "About Windows."
The following code fragment shows how to allocate a basic window with margins without allocating and freeing an memory screen.
|
Caution: Be very careful when using wn_nbdef(), since it makes a window that temporarily does not have a buffer. All windows must have a buffer before they can be used. It is the responsibility of the programmer to assign a memory screen to the window, with the function wn_msmod() or with one of the functions described in Chapter 28, "Advanced Window Management."