1.11.1 Menu Types
There are three different types of menus: pop-up, pulldown, and pullright menus. The gen-
eral term pop-up menu may describe all three types in certain contexts since menus are
popped up. However, pulldown and pullright menus have distinct characteristics that make
them unique.
Pop-up Menus Pop-up menus are displayed when the user selects the MENU mouse
button over XView objects such as scrollbars or text subwindows. An
OPENLOOK window manager also utilizes pop-up menus in the root
window and from base frame title bars. XView objects handle the dis-
play of menus automatically.
Pulldown Menus Pulldown menus are attached to menu buttons. Menu buttons have a set
of choices associated with them that the user can access only via the
pulldown menu. When the user presses the MENU mouse button over a
menu button, the choices are displayed in the form of a pulldown menu.
If the menu button is selected using the SELECT button, the default
menu item is selected.
Pullright Menus OPEN LOOK provides for items in the menu to have pullright menus
associated with them. Also called cascading menus, these menus are
activated from the user dragging the MENU mouse button to the right of
a menu item that has an arrow pointing to the right. The cascading
menu that results is a pop-up menu that can also have menu items with
pullrights attached.
1.11.2 Menu Items
In addition to the menu types, there are different types of menu items: choice, exclusive, and
nonexclusive. The different menu item types may be associated with each type of menu.
Each menu has a default selection associated with it. This item is displayed uniquely from
other menu items and designates a default action to take if the user wants to select the menu
without displaying it (see pulldown menus above). Typically, the 0th item in the menu is the
default, but that may be changed either by the application or by the user.
Choice Items The choice item is the default menu item type used when a menu is
created. The default selection in a menu has a ring around it. When a
pop-up menu is displayed, it is positioned so that the mouse is pointing
at the default item. Choice menu items may have pullright menus asso-
ciated with them, in which case there is a pullright arrow at the right
side of the item. If the selection of a menu item brings up a dialog box
(command frame), then the label for the menu item typically ends in
ellipses ( . . . ).
Exclusive Items When a choice item is selected, an action is taken and the menu forgets
about it. Exclusive menu items retain the fact that they are selected
even after the menu has popped down. If the user selects a new item,
XView Package
Summary
XView Package Summary 13
the new item is remembered. Because this is an exclusive menu, only
one choice may be selected at a time. The default item is indicated by a
double-lined box around the item.
When exclusive settings are used on menus, the current choice has a
bold border when the pointer is not on a menu choice. When the user
drags the pointer onto other settings, the bold border follows the
pointer. Exclusive choice menus may not have items with pullright
menus.
Nonexclusive Items Also called toggle items, menus that have toggle items support multiple
choices from the menu to be selected at the same time. That is, the user
may toggle whether a particular choice is selected. This action has no
affect on the other menu items.
The MENUITEM package allows you to create separate menu items using separate calls to
xv_create(). The attributes used are menu item-specific attributes—the same as those that
are used for a menu’s MENU_ITEM attribute.
1.12 The NOTICE Package
A notice is a pop-up window that notifies the user of a problem or asks a question that
requires a response. Generally, notices report serious warnings or errors. OPEN LOOK
notices do not have headers or footers and cannot be moved.
XView defines two types of notices, standard notices and screen-locking notices:
Standard notices do not lock the screen and are placed centered in the “owner” frame.
This type of notice may either block the application’s thread of execution, or not block.
Screen-locking notices lock the screen and block the thread of execution for all applica-
tions (the screen is locked with X grabs). These notices appear with a shadow that ema-
nates from the location where an action in an application initiates the notice. This may
be a panel button, such as “Quit”, or some other XView object.
To use the
NOTICE package, include the header file <xview/notice.h>. It provides the neces-
sary types and definitions for using the package. A notice object’s type is Xv_Notice.
14 XView Reference Manual
1.13 The PANEL Package
The PANEL package implements the OPEN LOOK control area. Panels are used in many dif-
ferent contexts—property sheets, notices, and menus all use panels in their implementation.
The main function of a panel is to manage a variety of panel items. Because some panel
items may not contain windows that handle their own events, the PANEL package is responsi-
ble for propagating events to the appropriate panel item.
Panels set up and manage their own event handling masks and routines for themselves and
their panel items. The application does not set event masks or install an event callback rou-
tine unless it needs to track events above and beyond what the PANEL package does by
default (typical applications will not need to do this). The PANEL package handles all the
repainting and resizing events automatically. Panels are not used to display graphics, so
there is no need to capture repaint events. Rather than deal with other events specifically,
callback routines are not installed on panels, but set for each panel item. Because of the
varying types of panel items, each item’s callback function may be invoked by a different
action from the user. While clicking on a panel button is all that is necessary to activate the
button’s callback routine, a text panel item might be configured to call its notification call-
back routine upon the user pressing the RETURN key.
Since panel items express interest in different events, it is the responsibility of the PANEL
package to track all events within the panel’s window and dispatch events to the proper panel
item depending on its type. In some cases, if an event happens over a certain panel item and
that item is not interested in that event, the event may be sent to another panel item. For
example, what happens if a key is pressed over a panel button? Because the panel button has
no interest in the event, the panel will send the event to a text panel item, if one exists else-
where in the panel.
A panel’s owner is a frame. All programs that use panels or panel items must include
<xview/panel.h>.
1.13.1 Panel Items
The user interacts with items through various methods ranging from mouse button selection
to keyboard input. This interaction typically results in a callback function being called for
the panel item. The callback functions also vary on a per-item basis. Each item type is
described in the following sections.
1.13.1.1 Button Items
A button item allows the user to invoke a command or bring up a menu. The button’s label
identifies the name of the command or menu. A button label that ends in three dots ( . . . )
indicates that a pop-up menu will be displayed when the button is selected.
XView Package
Summary
XView Package Summary 15
There are several types of panel button items:
Panel Buttons (shown in Figure 1-2)
Menu Buttons (shown in Figure 1-3)
Abbreviated Menu Buttons (shown in Figure 1-4)
Figure 1-2. Panel item created with PANEL_BUTTON package
Figure 1-3. Panel button with an attached menu
16 XView Reference Manual
Figure 1-4. Panel item created with the PANEL_ABBREV_MENU_BUTTON package
1.13.1.2 Choice Items
Choice items provide a list of different choices to the user in which one or more choices may
be selected. There are variations of choice items which implement different OPEN LOOK
objects such as:
Exclusive and Nonexclusive Choices (or Settings)
Abbreviated Choice Items
Checkboxes
The figures below show several, but not all of the different types of choice items.
Figure 1-5. Panel item from the PANEL_CHOICE package
Figure 1-6. Panel item from the PANEL_CHECK_BOX package
XView Package
Summary
XView Package Summary 17

Get Volume 7B: XView Reference Manual now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.