XtPopup(3Xt) XtPopup(3Xt)NAME XtPopup, XtCallbackNone, XtCallbackNonexclusive, XtCallbackExclusive, MenuPopup - map a pop-up shell SYNOPSIS void XtPopup(popup-shell, grab-kind) Widget popup-shell; XtGrabKind grab-kind; void XtCallbackNone(w, client-data, call-data) Widget w; XtPointer client-data; XtPointer call-data; void XtCallbackNonexclusive(w, client-data, call-data) Widget w; XtPointer client-data; XtPointer call-data; void XtCallbackExclusive(w, client-data, call-data) Widget w; XtPointer client-data; XtPointer call-data; void MenuPopup(shell-name) String shell-name; DESCRIPTION The XtPopup function performs these operations: Calls XtCheckSubclass to ensure popup-shell is a sub- class of Shell. Generates an error if the shell's popped_up member is already TRUE. Calls the callback procedures on the shell's popup_callback list. Sets the shell popped_up member to TRUE, the shell spring_loaded member to FALSE, and the shell grab_kind member the value specified by grab-kind. If the shell's create_popup_child member is not NULL, XtPopup calls it with popup-shell as the parameter. If grab-kind is either XtGrabNonexclusive or XtGrabExclusive, it makes this call: XtAddGrab(popup-shell, \ (grab_kind == XtGrabExclusive), FALSE) November, 1990 1
XtPopup(3Xt) XtPopup(3Xt)Calls XtRealizeWidget with popup_shell as an argument. Calls XMapWindow with popup_shell as an argument. The XtCallbackNone, XtCallbackNonexclusive, and XtCallbackExclusive functions call XtPopup with the shell specified by client-data and grab-kind set as the name specifies. XtCallbackNone, XtCallbackNonexclusive, and XtCallbackExclusive specify XtGrabNone, XtGrabNonexclusive, and XtGrabExclusive, respectively. Each function then sets the widget that executed the callback list to be insensitive by using XtSetSensitive. 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 but- ton. MenuPopup is known to the translation manager, which must perform special actions for spring-loaded pop-up shells. Calls to MenuPopup in a translation specification are mapped into calls to a nonexported action procedure, and the trans- lation manager fills in parameters based on the event speci- fied on the left-hand side of a translation. If MenuPopup is invoked on ButtonPress (possibly with modif- iers), the translation manager pops up the shell with grab_kind set to XtGrabExclusive and spring_loaded set to TRUE. If MenuPopup 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. Other- wise, the translation manager generates an error. When the widget is popped up, these actions occur: Calls XtCheckSubclass to ensure popup-shell is a sub- class of Shell. Generates an error if the shell's popped_up member is already TRUE. Calls the callback procedures on the shell's popup_callback list. Sets the shell's popped_up member to TRUE and the shell's grab_kind and spring_loaded members appropri- ately. If the shell's create_popup_child member is not NULL, it is called with popup-shell as the parameter. Makes this call: 2 November, 1990
XtPopup(3Xt) XtPopup(3Xt)XtAddGrab(popup-shell, \ (grab-kind == XtGrabExclusive), spring-loaded) Calls XtRealizeWidget with popup-shell specified. Calls XMapWindow with popup-shell specified. (Note that these actions are the same as those for XtPopup.) MenuPopup tries to find the shell by searching the widget tree starting at the parent of the widget in which it is in- voked. 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 gets to the applica- tion widget and cannot find a matching shell, it generates an error. Arguments These functions accept the following arguments: call-data Specifies the callback data, which is not used by this procedure. client-data Specifies the pop-up shell. grab-kind Specifies the way in which user events should be constrained. popup-shell Specifies the widget shell returned by XtCreatePopupShell. w Specifies the widget. SEE ALSO XtCreatePopupShell(3Xt), XtPopdown(3Xt)X Toolkit Intrinsics - C Language InterfaceXlib - C Language Interface November, 1990 3