defines attributes that give hints to the window manager to provide such features as title bar
information, resize corners, and so on. If a non-OPEN LOOK window manager is used, there
is no guarantee that these attributes will have any effect.
Pop-up frames are typically used to perform one or more transient functions. They are not
intended to stay up after the set of functions has been completed, although they might remain
up if the user or the application so chooses. This functionality can be handled by a pushpin at
the upper-left corner of the frame. There are different kinds of pop-up frames:
Command Frames give operands and set parameters needed for a command. This is
implemented as a subframe that contains a default panel.
Help Frames display help text for the object under the pointer. This is implemented
as a text subwindow within a subframe.
Notices are special pop-up windows that are used to confirm requests, to dis-
play messages and conditions that must be brought to the user’s atten-
tion and handled immediately. These require immediate attention and
can suspend the application by disallowing the focus from leaving the
Notice.
Figure 2-4 shows a sample unpinned command frame from the OPEN LOOK GUI Specifica-
tion Guide.
Figure 2-4. Sample unpinned command frame
The user may select the option, and the frame will be dismissed (be undisplayed). The push-
pin at the upper-left corner is out of its hole. If the pushpin were in, the command frame
would remain visible even after the user selects an action to take. Figure 2-5 shows a sample
pinned help frame from the OPEN LOOK GUI Specification Guide.
XView Programmer’s
Model
The XView Programmer’s Model 27
Figure 2-5. Sample help window
Figure 2-6 shows a sample notice from the OPEN LOOK GUI Specification Guide.
Figure 2-6. Sample notice
The user can do nothing but choose either Save or Cancel. Choosing either one will cause
the notice to be dismissed immediately.
28 XView Programming Manual
2.4.4 Subwindows
Subwindows differ from frames in several basic ways. They never exist independently; they
are always owned and maintained by a frame or another window, and they may not them-
selves own frames. While frames can be moved freely around the screen, subwindows are
constrained to fit within the borders of the frame to which they belong. Also, in contrast to
frames, subwindows are tiledthey may not overlap each other within their frame. Within
these constraints (which are enforced by a run-time boundary manager), subwindows may be
moved and resized by either a program or a user.
Canvas subwindows and text subwindows are subclassed from the OPENWIN package, a hid-
den class which implements the notion of splittable views described by OPEN LOOK. Figure
2-7 shows an example of one canvas object providing separate views into one graphic image.
Each view into the object has scrollbars attached. The scrollbars provide the ability to scroll
independently from all the other views attached to the subwindow and to split the views
again.
Figure 2-7. A window with multiple views
All the views, however, are still a part of the same OPENWIN object. Using the scrollbars, the
user can split or join different views.
XView Programmer’s
Model
The XView Programmer’s Model 29
2.4.4.1 Canvas subwindows
The canvas is the most basic type of subwindow. It provides a drawing surfacea place in
which the result of Xlib graphics calls can be displayed. A canvas object can be configured
to permit the application to draw on an area larger than the size of the visible window. The
entire region representing the drawing surface is a window called the paint window. The vis-
ible portion of the paint window is the view window. It is the view window that appears in
the canvas subwindow. In the previous figure, the paint window contains a picture of an
astronaut. Multiple view windows each show a particular region of the paint canvas. The
view windows are independent of each other. See Chapter 5, Canvases and Openwin, for a
full discussion and illustration of the Canvas model.
2.4.4.2 Text subwindows
Another basic window type is a text subwindow. It provides basic text editing capabilities
using the OPEN LOOK text editing model.
2.4.4.3 Panels
A panel (or control area) is an unbordered region of a window where controls such as but-
tons and settings are displayed. The panel also controls the arrangement of its controls in a
horizontal or vertical fashion. The panel shown in Figure 2-8 presents the typical positioning
of the control areathe top of a base frame with a canvas subwindow under it.
Figure 2-8. A control area above a subwindow
The panel shown in Figure 2-9 presents a control area that is to the right of a canvas subwin-
dow.
30 XView Programming Manual
Figure 2-9. A control area to the right of a pane
Control areas within panes usually contain varied combinations of the following controls:
Buttons
Check boxes
Drop Target Items
Exclusive and nonexclusive choice lists
Gauges
Sliders
Text and numeric fields
A command frame (subframe) contains only a panel and no other subwindows. Figure 2-10
shows a control area in a command frame. It contains text fields, choice lists, and buttons.
See Chapter 7, Panels, for a discussion of panel items and the PANEL package.
2.4.4.4 Menus
Menus are subclassed from the Generic Object. A menu by itself is a windowless object.
Only when the menu is activated by the user is it bound to a window. This implementation
avoids creating multiple X11 windows (one for each menu) since not all the menus will be
displayed at once. XView has three types of menus:
1. Pop-up menus that are displayed when the user presses the menu button in a window.
2. Pullright menus that are displayed as a menu to the right of a menu.
3. Pulldown menus that are displayed below a menu button on a panel.
XView Programmer’s
Model
The XView Programmer’s Model 31

Get Volume 7A: XView Programming Manual now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.