contents.gifindex.gifprev1.gifnext1.gif

2.5 Creating, Inquiring, Modifying, and Destroying Windows

You create a floating window with the DISPLAY FLOATING WINDOW statement. This statement constructs the specified window and returns a handle to it. A window created with the above statement is modal by default (the MODAL phrase can be added as commentary). To create a modeless window, you can add the MODELESS phrase. Note that managing multiple modeless windows is greatly simplified by associating a separate thread with each modeless window. See Book 1, Chapter 6, section 6.7.

The program's initial window, or main application window, is created either automatically, via the runtime, or programmatically via the DISPLAY INITIAL WINDOW statement. If the first DISPLAY statement is not a DISPLAY INITIAL WINDOW (or DISPLAY STANDARD WINDOW statement), the runtime automatically creates the initial window. The main application window is always a modeless window.

Because floating windows can be moved and, optionally, resized, their position and size are dynamic. To retrieve the current position and size of a floating window, you use the INQUIRE verb. INQUIRE returns information for the current window or the window identified by the specified handle.

To programmatically reposition or change the size or title of a window, you use the MODIFY verb. The MODIFY statement applies the specified values to the window identified by the handle or, if omitted, the current floating window.

You destroy a floating window with either the CLOSE WINDOW statement or DESTROY verb. You specify the handle of the window you want to destroy. Both verbs behave identically when acting on floating windows. Note that you cannot destroy the main application window. It is closed automatically when the application terminates.

For a complete description of each of the above verbs, see Book 3, Chapter 6, section 6.6. For detailed information regarding creating and managing floating windows via the Screen Section, see Book 3, Chapter 5, section 5.9.