1XtPopup(3) XT FUNCTIONS XtPopup(3)
2
3
4
6 XtPopup, XtPopupSpringLoaded, XtCallbackNone, XtCallbackNonexclusive,
7 XtCallbackExclusive - map a pop-up
8
10 #include <X11/Intrinsic.h>
11
12 void XtPopup(Widget popup_shell, XtGrabKind grab_kind);
13
14 void XtPopupSpringLoaded(Widget popup_shell);
15
16 void XtCallbackNone(Widget w, XtPointer client_data, XtPointer
17 call_data);
18
19 void XtCallbackNonexclusive(Widget w, XtPointer client_data, XtPointer
20 call_data);
21
22 void XtCallbackExclusive(Widget w, XtPointer client_data, XtPointer
23 call_data);
24
26 void XtMenuPopup(String shell_name);
27
29 call_data Specifies the callback data, which is not used by this proce‐
30 dure.
31
32 client_data
33 Specifies the pop-up shell.
34
35 grab_kind Specifies the way in which user events should be constrained.
36
37 popup_shell
38 Specifies the widget shell.
39
40 w Specifies the widget.
41
43 The XtPopup function performs the following:
44
45 • Calls XtCheckSubclass to ensure popup_shell is a subclass of
46 Shell.
47
48 • Generates an error if the shell's popped_up field is already True.
49
50 • Calls the callback procedures on the shell's popup_callback list.
51
52 • Sets the shell popped_up field to True, the shell spring_loaded
53 field to False, and the shell grab_kind field from grab_kind.
54
55 • If the shell's create_popup_child field is non-NULL, XtPopup calls
56 it with popup_shell as the parameter.
57
58 • If grab_kind is either XtGrabNonexclusive or XtGrabExclusive, it
59 calls:
60
61 XtAddGrab(popup_shell, (grab_kind == XtGrabExclusive), False)
62
63 • Calls XtRealizeWidget with popup_shell specified.
64
65 • Calls XMapWindow with popup_shell specified.
66
67 The XtPopupSpringLoaded function performs exactly as XtPopup except
68 that it sets the shell spring_loaded field to True and always calls
69 XtAddGrab with exclusive True and spring_loaded True.
70
71 The XtCallbackNone, XtCallbackNonexclusive, and XtCallbackExclusive
72 functions call XtPopup with the shell specified by the client data ar‐
73 gument and grab_kind set as the name specifies. XtCallbackNone,
74 XtCallbackNonexclusive, and XtCallbackExclusive specify XtGrabNone,
75 XtGrabNonexclusive, and XtGrabExclusive, respectively. Each function
76 then sets the widget that executed the callback list to be insensitive
77 by using XtSetSensitive. Using these functions in callbacks is not re‐
78 quired. In particular, an application must provide customized code for
79 callbacks that create pop-up shells dynamically or that must do more
80 than desensitizing the button.
81
82 XtMenuPopup is known to the translation manager, which must perform
83 special actions for spring-loaded pop-ups. Calls to XtMenuPopup in a
84 translation specification are mapped into calls to a nonexported action
85 procedure, and the translation manager fills in parameters based on the
86 event specified on the left-hand side of a translation.
87
88 If XtMenuPopup is invoked on ButtonPress (possibly with modifiers), the
89 translation manager pops up the shell with grab_kind set to XtGrabEx‐
90 clusive and spring_loaded set to True. If XtMenuPopup is invoked on
91 EnterWindow (possibly with modifiers), the translation manager pops up
92 the shell with grab_kind set to XtGrabNonexclusive and spring_loaded
93 set to False. Otherwise, the translation manager generates an error.
94 When the widget is popped up, the following actions occur:
95
96 • Calls XtCheckSubclass to ensure popup_shell is a subclass of
97 Shell.
98
99 • Generates an error if the shell's popped_up field is already True.
100
101 • Calls the callback procedures on the shell's popup_callback list.
102
103 • Sets the shell popped_up field to True and the shell grab_kind and
104 spring_loaded fields appropriately.
105
106 • If the shell's create_popup_child field is non-NULL, it is called
107 with popup_shell as the parameter.
108
109 • Calls:
110
111 XtAddGrab(popup_shell, (grab_kind == XtGrabExclusive), spring_loaded)
112
113 • Calls XtRealizeWidget with popup_shell specified.
114
115 • Calls XMapWindow with popup_shell specified.
116
117 (Note that these actions are the same as those for XtPopup.)
118 XtMenuPopup tries to find the shell by searching the widget tree start‐
119 ing at the parent of the widget in which it is invoked. If it finds a
120 shell with the specified name in the pop-up children of that parent, it
121 pops up the shell with the appropriate parameters. Otherwise, it moves
122 up the parent chain as needed. If XtMenuPopup gets to the application
123 widget and cannot find a matching shell, it generates an error.
124
126 XtCreatePopupShell(3), XtPopdown(3)
127 X Toolkit Intrinsics - C Language Interface
128 Xlib - C Language X Interface
129
130
131
132X Version 11 libXt 1.2.1 XtPopup(3)