1XmGadget(library call) XmGadget(library call)
2
3
4
6 XmGadget — The Gadget widget class
7
9 #include <Xm/Xm.h>
10
12 Gadget is a widget class used as a supporting superclass for other gad‐
13 get classes. It handles shadow-border drawing and highlighting, traver‐
14 sal activation and deactivation, and various callback lists needed by
15 gadgets.
16
17 The color and pixmap resources defined by XmManager are directly used
18 by gadgets. If XtSetValues is used to change one of the resources for a
19 manager widget, all of the gadget children within the manager also
20 change.
21
22 Classes
23 Gadget inherits behavior and resources from Object and RectObj.
24
25 The class pointer is xmGadgetClass.
26
27 The class name is XmGadget.
28
29 New Resources
30 The following table defines a set of widget resources used by the pro‐
31 grammer to specify data. The programmer can also set the resource val‐
32 ues for the inherited classes to set attributes for this widget. To
33 reference a resource by name or by class in a .Xdefaults file, remove
34 the XmN or XmC prefix and use the remaining letters. To specify one of
35 the defined values for a resource in a .Xdefaults file, remove the Xm
36 prefix and use the remaining letters (in either lowercase or uppercase,
37 but include any underscores between words). The codes in the access
38 column indicate if the given resource can be set at creation time (C),
39 set by using XtSetValues (S), retrieved by using XtGetValues (G), or is
40 not applicable (N/A).
41
42 ┌─────────────────────────────────────────────────────────────────────────────────────────────────┐
43 │ │ XmGadget │Resource Set │ │ │
44 │Name │ Class │ Type │ Default │ Access │
45 ├──────────────────────┼───────────────────────┼──────────────────┼──────────────────────┼────────┤
46 │XmNbackground │ XmCBackground │ Pixel │ dynamic │ CSG │
47 ├──────────────────────┼───────────────────────┼──────────────────┼──────────────────────┼────────┤
48 │XmNbackgroundPixmap │ XmCPixmap │ Pixmap │ XmUNSPECIFIED_PIXMAP │ CSG │
49 ├──────────────────────┼───────────────────────┼──────────────────┼──────────────────────┼────────┤
50 │XmNbottomShadowColor │ XmCBottomShadowColor │ Pixel │ dynamic │ CSG │
51 ├──────────────────────┼───────────────────────┼──────────────────┼──────────────────────┼────────┤
52 │XmNbottomShadowPixmap │ XmCBottomShadowPixmap │ Pixmap │ dynamic │ CSG │
53 ├──────────────────────┼───────────────────────┼──────────────────┼──────────────────────┼────────┤
54 │XmNhelpCallback │ XmCCallback │ XtCallbackList │ NULL │ C │
55 ├──────────────────────┼───────────────────────┼──────────────────┼──────────────────────┼────────┤
56 │XmNforeground │ XmCForeground │ Pixel │ dynamic │ CSG │
57 ├──────────────────────┼───────────────────────┼──────────────────┼──────────────────────┼────────┤
58 │XmNhighlightColor │ XmCHighlightColor │ Pixel │ dynamic │ CSG │
59 ├──────────────────────┼───────────────────────┼──────────────────┼──────────────────────┼────────┤
60 │XmNhighlightOnEnter │ XmCHighlightOnEnter │ Boolean │ False │ CSG │
61 ├──────────────────────┼───────────────────────┼──────────────────┼──────────────────────┼────────┤
62 │XmNhighlightPixmap │ XmCHighlightPixmap │ Pixmap │ dynamic │ CSG │
63 ├──────────────────────┼───────────────────────┼──────────────────┼──────────────────────┼────────┤
64 │XmNhighlightThickness │ XmCHighlightThickness │ Dimension │ 2 │ CSG │
65 ├──────────────────────┼───────────────────────┼──────────────────┼──────────────────────┼────────┤
66 │XmNlayoutDirection │ XmNCLayoutDirection │ XmDirection │ dynamic │ CG │
67 ├──────────────────────┼───────────────────────┼──────────────────┼──────────────────────┼────────┤
68 │XmNnavigationType │ XmCNavigationType │ XmNavigationType │ XmNONE │ CSG │
69 ├──────────────────────┼───────────────────────┼──────────────────┼──────────────────────┼────────┤
70 │XmNshadowThickness │ XmCShadowThickness │ Dimension │ 2 │ CSG │
71 ├──────────────────────┼───────────────────────┼──────────────────┼──────────────────────┼────────┤
72 │XmNtopShadowColor │ XmCTopShadowColor │ Pixel │ dynamic │ CSG │
73 ├──────────────────────┼───────────────────────┼──────────────────┼──────────────────────┼────────┤
74 │XmNtopShadowPixmap │ XmCTopShadowPixmap │ Pixmap │ dynamic │ CSG │
75 ├──────────────────────┼───────────────────────┼──────────────────┼──────────────────────┼────────┤
76 │XmNtraversalOn │ XmCTraversalOn │ Boolean │ True │ CSG │
77 ├──────────────────────┼───────────────────────┼──────────────────┼──────────────────────┼────────┤
78 │XmNunitType │ XmCUnitType │ unsigned char │ dynamic │ CSG │
79 ├──────────────────────┼───────────────────────┼──────────────────┼──────────────────────┼────────┤
80 │XmNuserData │ XmCUserData │ XtPointer │ NULL │ CSG │
81 ├──────────────────────┼───────────────────────┼──────────────────┼──────────────────────┼────────┤
82 │XmNtoolTipString │ XmCToolTipString │ XmString │ NULL │ CSG │
83 ├──────────────────────┼───────────────────────┼──────────────────┼──────────────────────┼────────┤
84 └──────────────────────┴───────────────────────┴──────────────────┴──────────────────────┴────────┘
85 XmNbackground
86 Specifies the background color for the gadget.
87
88 XmNbackgroundPixmap
89 Specifies a pixmap for tiling the background. The first tile
90 is placed at the upper left corner of the widget's window.
91
92 XmNbottomShadowColor
93 Contains the color to use to draw the bottom and right sides
94 of the border shadow.
95
96 XmNbottomShadowPixmap
97 Specifies the pixmap to use to draw the bottom and right
98 sides of the border shadow.
99
100 XmNforeground
101 Specifies the foreground drawing color used by Primitive wid‐
102 gets.
103
104 XmNhelpCallback
105 Specifies the list of callbacks that is called when the help
106 key sequence is pressed. The reason sent by the callback is
107 XmCR_HELP.
108
109 XmNhighlightColor
110 Contains the color of the highlighting rectangle.
111
112 XmNhighlightOnEnter
113 Specifies if the highlighting rectangle is drawn when the
114 cursor moves into the widget. If the shell's focus policy is
115 XmEXPLICIT, this resource is ignored, and the widget is high‐
116 lighted when it has the focus. If the shell's focus policy
117 is XmPOINTER and if this resource is True, the highlighting
118 rectangle is drawn when the the cursor moves into the widget.
119 If the shell's focus policy is XmPOINTER and if this resource
120 is False, the highlighting rectangle is not drawn when the
121 the cursor moves into the widget. The default is False.
122
123 XmNhighlightPixmap
124 Specifies the pixmap used to draw the highlighting rectangle.
125
126 XmNhighlightThickness
127 Specifies the thickness of the highlighting rectangle.
128
129 XmNlayoutDirection
130 Specifies the direction in which components of the manager
131 (including strings) are laid out. The values are of type
132 XmDirection. If the widget's parent is a manager or shell,
133 the value is inherited from the widget's parent. Otherwise,
134 it is inherited from the closest ancestor vendor or menu
135 shell.
136
137 XmNnavigationType
138 Determines whether the widget is a tab group.
139
140 XmNONE Indicates that the widget is not a tab group.
141
142 XmTAB_GROUP
143 Indicates that the widget is a tab group, unless
144 the XmNnavigationType of another widget in the
145 hierarchy is XmEXCLUSIVE_TAB_GROUP.
146
147 XmSTICKY_TAB_GROUP
148 Indicates that the widget is a tab group, even if
149 the XmNnavigationType of another widget in the
150 hierarchy is XmEXCLUSIVE_TAB_GROUP.
151
152 XmEXCLUSIVE_TAB_GROUP
153 Indicates that the widget is a tab group and that
154 widgets in the hierarchy whose XmNnavigationType is
155 XmTAB_GROUP are not tab groups.
156
157 When a parent widget has an XmNnavigationType of
158 XmEXCLUSIVE_TAB_GROUP, traversal of non-tab-group
159 widgets within the group is based on the order of
160 those widgets in their parent's XmNchildren list.
161
162 When the XmNnavigationType of any widget in a hier‐
163 archy is XmEXCLUSIVE_TAB_GROUP, traversal of tab
164 groups in the hierarchy proceeds to widgets in the
165 order in which their XmNnavigationType resources
166 were specified as XmEXCLUSIVE_TAB_GROUP or
167 XmSTICKY_TAB_GROUP, whether by creating the widgets
168 with that value, by calling XtSetValues, or by
169 calling XmAddTabGroup.
170
171 XmNshadowThickness
172 Specifies the size of the drawn border shadow.
173
174 XmNtopShadowColor
175 Contains the color to use to draw the top and left sides of
176 the border shadow.
177
178 XmNtopShadowPixmap
179 Specifies the pixmap to use to draw the top and left sides of
180 the border shadow.
181
182 XmNtraversalOn
183 Specifies traversal activation for this gadget.
184
185 XmNunitType
186 Provides the basic support for resolution independence. It
187 defines the type of units a widget uses with sizing and posi‐
188 tioning resources. If the widget's parent is a subclass of
189 XmManager and if the XmNunitType resource is not explicitly
190 set, it defaults to the unit type of the parent widget. If
191 the widget's parent is not a subclass of XmManager, the
192 resource has a default unit type of XmPIXELS.
193
194 The unit type can also be specified in resource files, with
195 the following format:
196
197 <floating value><unit>
198
199 where:
200
201 unit is <" ", pixels, inches, centimeters, millimeters,
202 points, font units>
203
204 pixels is <pix, pixel, pixels>
205
206 inches is <in, inch, inches>
207
208 centimeter
209 is <cm, centimeter, centimeters>
210
211 millimeters
212 is <mm, millimeter, millimeters>
213
214 points is <pt, point, points>
215
216 font units
217 is <fu, font_unit, font_units>
218
219 float is {"+"|"-"}{{<"0"-"9">*}.}<"0"-"9">*
220
221 Note that the type Dimension must always be posi‐
222 tive.
223
224 For example,
225
226 xmfonts*XmMainWindow.height: 10.4cm
227 *PostIn.width: 3inches
228
229 XmNunitType can have the following values:
230
231 XmPIXELS All values provided to the widget are treated as
232 normal pixel values.
233
234 XmMILLIMETERS
235 All values provided to the widget are treated as
236 normal millimeter values.
237
238 Xm100TH_MILLIMETERS
239 All values provided to the widget are treated as
240 1/100 of a millimeter.
241
242 XmCENTIMETERS
243 All values provided to the widget are treated as
244 normal centimeter values.
245
246 XmINCHES All values provided to the widget are treated as
247 normal inch values.
248
249 Xm1000TH_INCHES
250 All values provided to the widget are treated as
251 1/1000 of an inch.
252
253 XmPOINTS All values provided to the widget are treated as
254 normal point values. A point is a unit used in text
255 processing applications and is defined as 1/72 of
256 an inch.
257
258 Xm100TH_POINTS
259 All values provided to the widget are treated as
260 1/100 of a point. A point is a unit used in text
261 processing applications and is defined as 1/72
262 inch.
263
264 XmFONT_UNITS
265 All values provided to the widget are treated as
266 normal font units. A font unit has horizontal and
267 vertical components. These are the values of the
268 XmScreen resources XmNhorizontalFontUnit and XmN‐
269 verticalFontUnit.
270
271 Xm100TH_FONT_UNITS
272 All values provided to the widget are treated as
273 1/100 of a font unit. A font unit has horizontal
274 and vertical components. These are the values of
275 the XmScreen resources XmNhorizontalFontUnit and
276 XmNverticalFontUnit.
277
278 XmNuserData
279 Allows the application to attach any necessary specific data
280 to the gadget. This is an internally unused resource.
281
282
283 XmNtoolTipString
284 The XmString to display as the toolTip. If this resource is
285 NULL, no tip will be displayed. ToolTips are described in
286 VendorShell(3)
287
288
289 Inherited Resources
290 Gadget inherits resources from the superclass described in the follow‐
291 ing table. For a complete description of each resource, refer to the
292 reference page for that superclass.
293
294 ┌─────────────────────────────────────────────────────────────────────┐
295 │ │ RectObj Resour│ce Set │ │ │
296 │Name │ Class │ Type │ Default │ Access │
297 ├─────────────────────┼────────────────┼───────────┼─────────┼────────┤
298 │XmNancestorSensitive │ XmCSensitive │ Boolean │ dynamic │ G │
299 ├─────────────────────┼────────────────┼───────────┼─────────┼────────┤
300 │XmNborderWidth │ XmCBorderWidth │ Dimension │ 0 │ N/A │
301 ├─────────────────────┼────────────────┼───────────┼─────────┼────────┤
302 │XmNheight │ XmCHeight │ Dimension │ dynamic │ CSG │
303 ├─────────────────────┼────────────────┼───────────┼─────────┼────────┤
304 │XmNsensitive │ XmCSensitive │ Boolean │ True │ CSG │
305 ├─────────────────────┼────────────────┼───────────┼─────────┼────────┤
306 │XmNwidth │ XmCWidth │ Dimension │ dynamic │ CSG │
307 ├─────────────────────┼────────────────┼───────────┼─────────┼────────┤
308 │XmNx │ XmCPosition │ Position │ 0 │ CSG │
309 ├─────────────────────┼────────────────┼───────────┼─────────┼────────┤
310 │XmNy │ XmCPosition │ Position │ 0 │ CSG │
311 ├─────────────────────┼────────────────┼───────────┼─────────┼────────┤
312 └─────────────────────┴────────────────┴───────────┴─────────┴────────┘
313 ┌─────────────────────────────────────────────────────────────────────┐
314 │ │ Object Re│source Set │ │ │
315 │Name │ Class │ Type │ Default │ Access │
316 ├───────────────────┼─────────────┼────────────────┼─────────┼────────┤
317 │XmNdestroyCallback │ XmCCallback │ XtCallbackList │ NULL │ C │
318 ├───────────────────┼─────────────┼────────────────┼─────────┼────────┤
319 └───────────────────┴─────────────┴────────────────┴─────────┴────────┘
320 Callback Information
321 A pointer to the following structure is passed to each callback:
322
323 typedef struct
324 {
325 int reason;
326 XEvent * event;
327 } XmAnyCallbackStruct;
328
329 reason Indicates why the callback was invoked. For this callback,
330 reason is set to XmCR_HELP.
331
332 event Points to the XEvent that triggered the callback.
333
334 Behavior
335 Gadgets cannot have translations associated with them. Because of
336 this, a Gadget's behavior is determined by the Manager widget into
337 which the Gadget is placed. If focus is on a Gadget, events are passed
338 to the Gadget by its Manager.
339
341 Object(3), RectObj(3), XmManager(3), and XmScreen(3).
342
343
344
345 XmGadget(library call)