XtPopup(), XtCallbackNone(), XtCallbackNonexclusive(), XtCallbackExclusive(), MenuPopup() - map a pop-up
void XtPopup (Widget popup_shell, XtGrabKind grab_kind)
void XtCallbackNone (Widget w, XtPointer client_data,
XtPointer call_data)
void XtCallbackNonexclusive (Widget w, XtPointer client_data,
XtPointer call_data)
void XtCallbackExclusive (Widget w, XtPointer client_data,
XtPointer call_data)
void MenuPopup (String shell_name)
The XtPopup(3) function performs the following:
XtAddGrab(popup_shell, (grab_kind == XtGrabExclusive), False)
The XtCallbackNone(3), XtCallbackNonexclusive(3), and XtCallbackExclusive(3) functions call XtPopup(3) with the shell specified by the client data argument and grab_kind set as the name specifies. XtCallbackNone(3), XtCallbackNonexclusive(3), and XtCallbackExclusive(3) specify XtGrabNone, XtGrabNonexclusive, and XtGrabExclusive, respectively. Each function then sets the widget that executed the callback list to be insensitive by using XtSetSensitive(3). Using these functions in callbacks is not required. In particular, an application must provide customized code for callbacks that create pop-up shells dynamically or that must do more than desensitizing the button.
MenuPopup(3) is known to the translation manager, which must perform special actions for spring-loaded pop-ups. Calls to MenuPopup(3) in a translation specification are mapped into calls to a nonexported action procedure, and the translation manager fills in parameters based on the event specified on the left-hand side of a translation.
If MenuPopup(3) is invoked on ButtonPress (possibly with modifiers), the translation manager pops up the shell with grab_kind set to XtGrabExclusive and spring_loaded set to True. If MenuPopup(3) is invoked on EnterWindow (possibly with modifiers), the translation manager pops up the shell with grab_kind set to XtGrabNonexclusive and spring_loaded set to False. Otherwise, the translation manager generates an error. When the widget is popped up, the following actions occur:
XtAddGrab(popup_shell, (grab_kind == XtGrabExclusive), spring_loaded)
(Note that these actions are the same as those for XtPopup(3).) MenuPopup(3) tries to find the shell by searching the widget tree starting at the parent of the widget in which it is invoked. If it finds a shell with the specified name in the pop-up children of that parent, it pops up the shell with the appropriate parameters. Otherwise, it moves up the parent chain as needed. If MenuPopup(3) gets to the application widget and cannot find a matching shell, it generates an error.
X Toolkit Intrinsics - C Language Interface
Xlib - C Language X Interface