Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

xtpopup(3) [hpux man page]

XtPopup()																 XtPopup()

Name
  XtPopup - map a popup shell.

Synopsis
  void XtPopup(popup_shell, grab_kind)
	 Widget popup_shell;
	 XtGrabKind grab_kind;

Inputs
  popup_shell
	    Specifies a shell widget returned by XtCreatePopupShell().

  grab_kind Specifies how user events should be constrained.  (Can be one of XtGrabNone, XtGrabNonexclusive, XtGrabExclusive.)

Description
  XtPopup()  calls  the  functions registered on the shell's XtNpopupCallback list and pops up the shell widget (and its managed child).  The
  "Algorithm" section below explains this process in more detail.

  If grab_kind is XtGrabNone, the resulting popup is "modeless", and does not lock out input events to the rest of the application.  If it is
  XtGrabNonexclusive,  then  the resulting popup is "modal" and locks out input to the main application window, but not to other modal popups
  that are currently popped up.  If it is XtGrabExclusive, then the resulting popup is modal and locks out input to the main application win-
  dow and all previous popup windows.  For more details on XtGrabNonexclusive and XtGrabExclusive, see XtAddGrab().

Usage
  By  default,	XtPopup()  maps its window to the upper-left corner of the display.  You will generally want to position the shell by setting
  its XtNx and XtNy resources before calling XtPopup().

  The Intrinsics also provide convenience routines to popup a shell.  To perform a pop up from a callback list, register one of the functions
  XtCallbackNone(), XtCallbackNonexclusive(), or XtCallbackExclusive().  To do so from a translation table, use the XtMenuPopup action.

  Widgets can be popped down with XtPopdown(), the XtCallbackPopdown() callback function, or the XtMenuPopdown action.

  If  you  are	using the Motif widget set, you will generally never need to call XtPopup()   or XtPopdown().  The Motif XmDialogShell widget
  automatically pops up when its child is managed, and pops down when its child is unmanaged.

Algorithm
  The XtPopup() function performs the following:

  o  Calls XtCheckSubclass() to ensure popup_shell's class is a subclass of shellWidgetClass.

  o  Raises the window and returns if the shell's popped_up field is already True.

  o  Calls the callback procedures on the shell's XtNpopupCallback list, specifying a pointer to the value  of	grab_kind  as  the  call_data
     argument.

  o  Sets the shell popped_up field to True, the shell spring_loaded field to False, and the shell grab_kind field from grab_kind.

  o  If the shell's XtNcreatePopupChildProc resource is non-NULL, XtPopup() calls the specified procedure with popup_shell as the parameter.

  o  If grab_kind is either XtGrabNonexclusive or XtGrabExclusive, it calls:

	XtAddGrab(popup_shell, (grab_kind == XtGrabExclusive), False)

  o  Calls XtRealizeWidget() with popup_shell specified.

  o  Calls XMapRaised() with the window of popup_shell.

Structures
  The XtGrabKind type is defined as follows:

     typedef enum {XtGrabNone, XtGrabNonexclusive, XtGrabExclusive} XtGrabKind;

See Also
  XtAddGrab(1), XtCallbackExclusive(1), XtCallbackNone(1), XtCallbackNonexclusive(1), XtCallbackPopdown(1), XtCreatePopupShell(1), XtMenuPop-
  down(1), XtMenuPopup(1), XtPopdown(1), XtPopupSpringLoaded(1).

Xt - Pop Ups																 XtPopup()

Check Out this Related Man Page

XtPopup(3)							   XT FUNCTIONS 							XtPopup(3)

NAME
XtPopup, XtPopupSpringLoaded, XtCallbackNone, XtCallbackNonexclusive, XtCallbackExclusive - map a pop-up SYNTAX
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); void MenuPopup(String shell_name); 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. w Specifies the widget. DESCRIPTION
The XtPopup function performs the following: o Calls XtCheckSubclass to ensure popup_shell is a subclass of Shell. o Generates an error if the shell's popped_up field is already True. o Calls the callback procedures on the shell's popup_callback list. o Sets the shell popped_up field to True, the shell spring_loaded field to False, and the shell grab_kind field from grab_kind. o If the shell's create_popup_child field is non-NULL, XtPopup calls it with popup_shell as the parameter. o If grab_kind is either XtGrabNonexclusive or XtGrabExclusive, it calls: XtAddGrab(popup_shell, (grab_kind == XtGrabExclusive), False) o Calls XtRealizeWidget with popup_shell specified. o 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 insensi- tive 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. MenuPopup is known to the translation manager, which must perform special actions for spring-loaded pop-ups. Calls to MenuPopup 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 is invoked on ButtonPress (possibly with modifiers), the translation manager pops up the shell with grab_kind set to XtGrabEx- clusive 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. Otherwise, the translation manager generates an error. When the widget is popped up, the following actions occur: o Calls XtCheckSubclass to ensure popup_shell is a subclass of Shell. o Generates an error if the shell's popped_up field is already True. o Calls the callback procedures on the shell's popup_callback list. o Sets the shell popped_up field to True and the shell grab_kind and spring_loaded fields appropriately. o If the shell's create_popup_child field is non-NULL, it is called with popup_shell as the parameter. o Calls: XtAddGrab(popup_shell, (grab_kind == XtGrabExclusive), spring_loaded) o Calls XtRealizeWidget with popup_shell specified. o 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 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 gets to the applica- tion widget and cannot find a matching shell, it generates an error. SEE ALSO
XtCreatePopupShell(3), XtPopdown(3) X Toolkit Intrinsics - C Language Interface Xlib - C Language X Interface X Version 11 libXt 1.1.3 XtPopup(3)
Man Page