Name
XtPopup — map a pop-up shell.
Synopsis
void XtPopup(popup_shell, grab_kind)
Widget popup_shell;
XtGrabKind grab_kind;
Arguments
popup_shell
Specifies a widget shell returned by XtCreatePopupShell.
grab_kindSpecifies how user events should be constrained. (Can be one of XtGrabNone, XtGrabNonexclusive, XtGrabExclusive.)
Description
After creating a pop-up shell with XtCreatePopupShell and its managed child with XtCreateManagedWidget, the pop up is ready to be mapped to the display. The easiest way to map the pop up from the application code is with XtPopup or XtPopupSpringLoaded.
XtPopup maps its window, by default, to the upper-left corner of the display. This can be circumvented by relocating the pop-up shell with XtMoveWidget before calling XtPopup.
XtPopup performs the following actions:
•Calls XtCheckSubclass to ensure popup_shell is a subclass of Shell.
•Returns if the shell is already popped up.
•Calls the callback procedures on the shell’s pop-up callback list, designated by the resource XtNpopupCallback. (See XtCreatePopupShell.)
•Sets the shell popped_up field to True, the shell spring_loaded field to False, and the shell grab_kind field to grab_kind. grab_kind specifies the grab type inserted in the modal cascade. (See XtAddGrab.)
•If the shell’s create_popup_child field is non-NULL, XtPopup calls the designated function with popup_shell as the parameter. This field is designated by the resource XtNcreatePopupChildProc. (See XtCreatePopupShell).
•If grab_kind is either XtGrabNonexclusive or XtGrabExclusive, it calls:
XtAddGrab(popup_shell, (grab_kind == XtGrabExclusive), False)
•Calls XtRealizeWidget with popup_shell.
•Calls XMapRaised with the Core window field from popup_shell.
Widgets can be popped down with XtPopdown. For more specifics on how to relocate the pop-up shell before popping it up, see XtMoveWidget and XtTranslateCoords. To perform a pop up from a callback list, see XtCallbackNone, XtCallbackNonexclusive, and XtCallbackExclusive. To do so from a translation table, use XtMenuPopup. For details on how events are constrained to the pop up, see XtAddGrab.
For more information, see Chapter 12, Menus, Gadgets, and Cascaded Pop Ups, in Volume Four, X Toolkit Intrinsics Programming Manual.
See Also
XtCheckSubclass(1), XtCreateManagedWidget(1), XtPopupSpringLoaded(1), XtRealizeWidget(1).