Copyright 1993 X Consortium

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

Except as contained in this notice, the name of the X Consortium shall
not be used in advertising or otherwise to promote the sale, use or
other dealings in this Software without prior written authorization
from the X Consortium.

XtPopup __libmansuffix__ __xorgversion__ "XT FUNCTIONS"
NAME
XtPopup, XtPopupSpringLoaded, XtCallbackNone, XtCallbackNonexclusive, XtCallbackExclusive - map a pop-up
SYNTAX
#include <X11/Intrinsic.h>

void XtPopup(Widget popup_shell, XtGrabKind grab_kind);

void XtPopupSpringLoaded(Widget popup_shell);

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);

ACTIONS

void XtMenuPopup(String shell_name);

ARGUMENTS
call_data 1i
Specifies the callback data, which is not used by this procedure.
client_data 1i
Specifies the pop-up shell.
grab_kind 1i
Specifies the way in which user events should be constrained.
popup_shell 1i
Specifies the widget shell.
w 1i
Specifies the widget.
DESCRIPTION
The XtPopup function performs the following:
\(bu 5
Calls XtCheckSubclass .ZN XtCheckSubclass(popup_shell, popupShellWidgetClass)
to ensure popup_shell is a subclass of Shell .
\(bu 5
Generates an error if the shell's popped_up field is already True .
\(bu 5
Calls the callback procedures on the shell's popup_callback list.
\(bu 5
Sets the shell popped_up field to True , the shell spring_loaded field to False , and the shell grab_kind field from grab_kind.
\(bu 5
If the shell's create_popup_child field is non-NULL, XtPopup calls it with popup_shell as the parameter.
\(bu 5
If grab_kind is either XtGrabNonexclusive or XtGrabExclusive , it calls:

XtAddGrab(popup_shell, (grab_kind == XtGrabExclusive), False)
\(bu 5
Calls XtRealizeWidget with popup_shell specified.
\(bu 5
Calls XMapWindow with popup_shell specified.

The XtPopupSpringLoaded function performs exactly as XtPopup except that it sets the shell spring_loaded field to True and always calls XtAddGrab with exclusive True and spring_loaded True .

The XtCallbackNone , XtCallbackNonexclusive , and XtCallbackExclusive functions call XtPopup with the shell specified by the client data argument 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 button.

XtMenuPopup is known to the translation manager, which must perform special actions for spring-loaded pop-ups. Calls to XtMenuPopup 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 XtMenuPopup 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 XtMenuPopup 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:

\(bu 5
Calls XtCheckSubclass .ZN XtCheckSubclass(popup_shell, popupShellWidgetClass)
to ensure popup_shell is a subclass of Shell .
\(bu 5
Generates an error if the shell's popped_up field is already True .
\(bu 5
Calls the callback procedures on the shell's popup_callback list.
\(bu 5
Sets the shell popped_up field to True and the shell grab_kind and spring_loaded fields appropriately.
\(bu 5
If the shell's create_popup_child field is non-NULL, it is called with popup_shell as the parameter.
\(bu 5
Calls:

XtAddGrab(popup_shell, (grab_kind == XtGrabExclusive), spring_loaded)
\(bu 5
Calls XtRealizeWidget with popup_shell specified.
\(bu 5
Calls XMapWindow with popup_shell specified.

(Note that these actions are the same as those for XtPopup .) XtMenuPopup 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 XtMenuPopup gets to the application widget and cannot find a matching shell, it generates an error.

"SEE ALSO"
XtCreatePopupShell(__libmansuffix__), XtPopdown(__libmansuffix__)

\*(xT

\*(xL