1XmScale(library call) XmScale(library call)
2
3
4
6 XmScale — The Scale widget class
7
9 #include <Xm/Scale.h>
10
12 Scale is used by an application to indicate a value from within a range
13 of values, and it allows the user to input or modify a value from the
14 same range.
15
16 A Scale has an elongated rectangular region similar to a ScrollBar. A
17 slider inside this region indicates the current value along the Scale.
18 The user can also modify the Scale's value by moving the slider within
19 the rectangular region of the Scale. A Scale can also include a label
20 set located outside the Scale region. These can indicate the relative
21 value at various positions along the scale. The placement of this
22 label depends on the XmNlayoutDirection resource of the widget.
23
24 A Scale can be either input/output or output only. An input/output
25 Scale's value can be set by the application and also modified by the
26 user with the slider. An output-only Scale is used strictly as an indi‐
27 cator of the current value of something and cannot be modified interac‐
28 tively by the user. The XmScale resource XmNeditable specifies whether
29 the user can interactively modify the Scale's value.
30
31 The user can specify resources in a resource file for the automatically
32 created gadget that contains the title of the Scale widget. The name of
33 the gadget is Title. The placement of the title depends on the XmNlay‐
34 outDirection resource of the widget. The direction of the title is
35 based on the widget's layout direction.
36
37 Scale uses the XmQTspecifyRenderTable trait, and holds the XmQTtransfer
38 trait.
39
40 Data Transfer Behavior
41 Scale supports dragging of the representation of the Scale value from
42 the Scale when the value is displayed and when the value of the XmNen‐
43 ableUnselectableDrag resource of XmDisplay is set to True.
44
45 As a source of data, Scale supports the following targets and associ‐
46 ated conversions of data to these targets:
47
48 COMPOUND_TEXT
49 The widget transfers a string representation of XmNvalue as
50 type COMPOUND_TEXT.
51
52 UTF8_STRING
53 The widget transfers a string representation of XmNvalue as
54 type UTF8_STRING.
55
56 STRING The widget transfers a string representation of XmNvalue as
57 type STRING.
58
59 _MOTIF_CLIPBOARD_TARGETS
60 The widget transfers, as type ATOM, a list of the targets it
61 supports for the CLIPBOARD selection. These include STRING,
62 COMPOUND_TEXT and UTF8_STRING.
63
64 _MOTIF_EXPORT_TARGETS
65 The widget transfers, as type ATOM, a list of the targets to
66 be used as the value of the DragContext's XmNexportTargets in
67 a drag-and-drop transfer. These include STRING, COM‐
68 POUND_TEXT and UTF8_STRING.
69
70 As a source of data, Scale also supports the following standard Motif
71 targets:
72
73 BACKGROUND
74 The widget transfers XmNbackground as type PIXEL.
75
76 CLASS The widget finds the first shell in the widget hierarchy that
77 has a WM_CLASS property and transfers the contents as text in
78 the current locale.
79
80 CLIENT_WINDOW
81 The widget finds the first shell in the widget hierarchy and
82 transfers its window as type WINDOW.
83
84 COLORMAP The widget transfers XmNcolormap as type COLORMAP.
85
86 FOREGROUND
87 The widget transfers XmNforeground as type PIXEL.
88
89 NAME The widget finds the first shell in the widget hierarchy that
90 has a WM_NAME property and transfers the contents as text in
91 the current locale.
92
93 TARGETS The widget transfers, as type ATOM, a list of the targets it
94 supports. These include the standard targets in this list.
95 These also include STRING, COMPOUND_TEXT and UTF8_STRING.
96
97 TIMESTAMP The widget transfers the timestamp used to acquire the selec‐
98 tion as type INTEGER.
99
100 _MOTIF_RENDER_TABLE
101 The widget transfers XmNrenderTable if it exists, or else the
102 default text render table, as type STRING.
103
104 _MOTIF_ENCODING_REGISTRY
105 The widget transfers its encoding registry as type STRING.
106 The value is a list of NULL separated items in the form of
107 tag encoding pairs. This target symbolizes the transfer tar‐
108 get for the Motif Segment Encoding Registry. Widgets and
109 applications can use this Registry to register text encoding
110 formats for specified render table tags. Applications access
111 this Registry by calling XmRegisterSegmentEncoding and
112 XmMapSegmentEncoding.
113
114 Descendants
115 Scale automatically creates the descendants shown in the following ta‐
116 ble. An application can use XtNameToWidget to gain access to the named
117 descendant. In addition, a user or an application can use the named
118 descendant when specifying resource values.
119
120 ┌─────────────────┬───────────────┬────────────────┐
121 │Named Descendant │ Class │ Identity │
122 ├─────────────────┼───────────────┼────────────────┤
123 ├─────────────────┼───────────────┼────────────────┤
124 ├─────────────────┼───────────────┼────────────────┤
125 │Scrollbar │ XmScrollBar │ scroll bar │
126 ├─────────────────┼───────────────┼────────────────┤
127 │Title │ XmLabelGadget │ title of scale │
128 ├─────────────────┼───────────────┼────────────────┤
129 └─────────────────┴───────────────┴────────────────┘
130 Classes
131 Scale inherits behavior, resources, and traits from Core, Composite,
132 Constraint, and XmManager classes.
133
134 The class pointer is xmScaleWidgetClass.
135
136 The class name is XmScale.
137
138 New Resources
139 The following table defines a set of widget resources used by the pro‐
140 grammer to specify data. The programmer can also set the resource val‐
141 ues for the inherited classes to set attributes for this widget. To
142 reference a resource by name or by class in a .Xdefaults file, remove
143 the XmN or XmC prefix and use the remaining letters. To specify one of
144 the defined values for a resource in a .Xdefaults file, remove the Xm
145 prefix and use the remaining letters (in either lowercase or uppercase,
146 but include any underscores between words). The codes in the access
147 column indicate if the given resource can be set at creation time (C),
148 set by using XtSetValues (S), retrieved by using XtGetValues (G), or is
149 not applicable (N/A).
150
151 ┌────────────────────────────────────────────────────────────────────────────────────────┐
152 │ │ XmScale Resource│Set │ │ │
153 │Name │ Class │ Type │ Default │ Access │
154 ├────────────────────────┼────────────────────────┼────────────────┼────────────┼────────┤
155 │XmNconvertCallback │ XmCCallback │ XtCallbackList │ NULL │ C │
156 ├────────────────────────┼────────────────────────┼────────────────┼────────────┼────────┤
157 │XmNdecimalPoints │ XmCDecimalPoints │ short │ 0 │ CSG │
158 ├────────────────────────┼────────────────────────┼────────────────┼────────────┼────────┤
159 │XmNdragCallback │ XmCCallback │ XtCallbackList │ NULL │ C │
160 ├────────────────────────┼────────────────────────┼────────────────┼────────────┼────────┤
161 │XmNeditable │ XmCEditable │ Boolean │ True │ CSG │
162 ├────────────────────────┼────────────────────────┼────────────────┼────────────┼────────┤
163 │XmNfontList │ XmCFontList │ XmFontList │ dynamic │ CSG │
164 ├────────────────────────┼────────────────────────┼────────────────┼────────────┼────────┤
165 │XmNhighlightOnEnter │ XmCHighlightOnEnter │ Boolean │ False │ CSG │
166 ├────────────────────────┼────────────────────────┼────────────────┼────────────┼────────┤
167 │XmNhighlightThickness │ XmCHighlightThickness │ Dimension │ 2 │ CSG │
168 ├────────────────────────┼────────────────────────┼────────────────┼────────────┼────────┤
169 │XmNmaximum │ XmCMaximum │ int │ 100 │ CSG │
170 ├────────────────────────┼────────────────────────┼────────────────┼────────────┼────────┤
171 │XmNminimum │ XmCMinimum │ int │ 0 │ CSG │
172 ├────────────────────────┼────────────────────────┼────────────────┼────────────┼────────┤
173 │XmNorientation │ XmCOrientation │ unsigned char │ XmVERTICAL │ CSG │
174 ├────────────────────────┼────────────────────────┼────────────────┼────────────┼────────┤
175 │XmNprocessingDirection │ XmCProcessingDirection │ unsigned char │ dynamic │ CSG │
176 ├────────────────────────┼────────────────────────┼────────────────┼────────────┼────────┤
177 │XmNscaleHeight │ XmCScaleHeight │ Dimension │ 0 │ CSG │
178 ├────────────────────────┼────────────────────────┼────────────────┼────────────┼────────┤
179 │XmNscaleMultiple │ XmCScaleMultiple │ int │ dynamic │ CSG │
180 ├────────────────────────┼────────────────────────┼────────────────┼────────────┼────────┤
181 │XmNscaleWidth │ XmCScaleWidth │ Dimension │ 0 │ CSG │
182 ├────────────────────────┼────────────────────────┼────────────────┼────────────┼────────┤
183 │XmNrenderTable │ XmCRenderTable │ XmRenderTable │ dynamic │ CSG │
184 ├────────────────────────┼────────────────────────┼────────────────┼────────────┼────────┤
185 │XmNshowArrows │ XmCShowArrows │ XtEnum │ XmNONE │ CSG │
186 ├────────────────────────┼────────────────────────┼────────────────┼────────────┼────────┤
187 │XmNshowValue │ XmCShowValue │ XtEnum │ XmNONE │ CSG │
188 ├────────────────────────┼────────────────────────┼────────────────┼────────────┼────────┤
189 │XmNsliderMark │ XmCSliderMark │ XtEnum │ dynamic │ CSG │
190 ├────────────────────────┼────────────────────────┼────────────────┼────────────┼────────┤
191 │XmNsliderVisual │ XmCSliderVisual │ XtEnum │ dynamic │ CSG │
192 ├────────────────────────┼────────────────────────┼────────────────┼────────────┼────────┤
193 │XmNslidingMode │ XmCSlidingMode │ XtEnum │ XmSLIDER │ CSG │
194 ├────────────────────────┼────────────────────────┼────────────────┼────────────┼────────┤
195 │XmNtitleString │ XmCTitleString │ XmString │ NULL │ CSG │
196 ├────────────────────────┼────────────────────────┼────────────────┼────────────┼────────┤
197 │XmNvalue │ XmCValue │ int │ dynamic │ CSG │
198 ├────────────────────────┼────────────────────────┼────────────────┼────────────┼────────┤
199 │XmNvalueChangedCallback │ XmCCallback │ XtCallbackList │ NULL │ C │
200 ├────────────────────────┼────────────────────────┼────────────────┼────────────┼────────┤
201 └────────────────────────┴────────────────────────┴────────────────┴────────────┴────────┘
202 XmNconvertCallback
203 Specifies a list of callbacks called when the Scale is asked
204 to convert a selection. The type of the structure whose
205 address is passed to these callbacks is XmConvertCallback‐
206 Struct. The reason is XmCR_OK.
207
208 XmNdecimalPoints
209 Specifies the number of decimal points to shift the slider
210 value when displaying it. For example, a slider value of
211 2,350 and an XmdecimalPoints value of 2 results in a display
212 value of 23.50. The value must not be negative.
213
214 XmNdragCallback
215 Specifies the list of callbacks that is called when the
216 slider position changes as the slider is being dragged. The
217 reason sent by the callback is XmCR_DRAG.
218
219 XmNeditable
220 Specifies how the Scale scrollbar will react to user input.
221 This resource can be True or False values, as follows:
222
223 True Allows the scrollbar to be sensitive to user input.
224 This is the default value.
225
226 False Makes the Scale scrollbar insensitive to user
227 input. The visual is not greyed out. This value
228 would mostly be used in XmTHERMOMETER mode.
229
230 When XmNeditable is used on a widget it sets the dropsite to
231 XmDROP_SITE_ACTIVE.
232
233 XmNfontList
234 Specifies the font list to use for the title text string
235 specified by XmNtitleString, and the label displayed when
236 XmNshowValue is True. The font list is an obsolete structure,
237 and is retained only for compatibility with earlier releases
238 of Motif. See the XmNrenderTable resource.
239
240 XmNhighlightOnEnter
241 Specifies whether the highlighting rectangle is drawn when
242 the cursor moves into the widget. If the shell's focus pol‐
243 icy is XmEXPLICIT, this resource is ignored, and the widget
244 is highlighted when it has the focus. If the shell's focus
245 policy is XmPOINTER and if this resource is True, the high‐
246 lighting rectangle is drawn when the the cursor moves into
247 the widget. If the shell's focus policy is XmPOINTER and if
248 this resource is False, the highlighting rectangle is not
249 drawn when the the cursor moves into the widget. The default
250 is False.
251
252 XmNhighlightThickness
253 Specifies the size of the slider's border drawing rectangle
254 used for enter window and traversal highlight drawing.
255
256 XmNmaximum
257 Specifies the slider's maximum value. XmNmaximum must be
258 greater than XmNminimum.
259
260 XmNminimum
261 Specifies the slider's minimum value. XmNmaximum must be
262 greater than XmNminimum.
263
264 XmNorientation
265 Displays Scale vertically or horizontally. This resource can
266 have values of XmVERTICAL and XmHORIZONTAL.
267
268 XmNprocessingDirection
269 Specifies whether the value for XmNmaximum is on the right or
270 left side of XmNminimum for horizontal Scales or above or
271 below XmNminimum for vertical Scales. This resource can have
272 values of XmMAX_ON_TOP, XmMAX_ON_BOTTOM, XmMAX_ON_LEFT, and
273 XmMAX_ON_RIGHT. If the Scale is oriented vertically, the
274 default value is XmMAX_ON_TOP. If the XmScale is oriented
275 horizontally, the default value depends on the XmNlayoutDi‐
276 rection resource of the widget.
277
278 XmNrenderTable
279 Specifies the render table to use for the title text string
280 specified by XmNtitleString, and the label displayed when
281 XmNshowValue is True. If this value is NULL at initializa‐
282 tion, the parent hierarchy is searched for an ancestor that
283 holds the XmQTspecifyRenderTable trait. If such an ancestor
284 is found, the render table is initialized to the XmLABEL_REN‐
285 DER_TABLE value of the ancestor widget. If no such ancestor
286 is found, the default is implementation dependent. If a font
287 list (XmNfontList) and a render table are both specified, the
288 render table will take precedence. Refer to XmRenderTable(3)
289 for more information on the creation and structure of a ren‐
290 der table.
291
292 XmNscaleHeight
293 Specifies the height of the slider area. The value should be
294 in the specified unit type (the default is pixels). If no
295 value is specified a default height is computed.
296
297 XmNscaleMultiple
298 Specifies the amount to move the slider when the user takes
299 an action that moves the slider by a multiple increment. The
300 default is (XmNmaximum - XmNminimum) divided by 10, with a
301 minimum of 1.
302
303 XmNscaleWidth
304 Specifies the width of the slider area. The value should be
305 in the specified unit type (the default is pixels). If no
306 value is specified a default width is computed.
307
308 XmNshowArrows
309 Specifies whether the arrows are displayed and how they are
310 to be displayed. This resource can take the following values:
311
312 XmEACH_SIDE
313 Indicates that one arrow is displayed on each end
314 of the ScrollBar slider.
315
316 XmMAX_SIDE
317 Indicates that one arrow is displayed on the XmN‐
318 maximum side of the ScrollBar slider.
319
320 XmMIN_SIDE
321 Indicates that one arrow is displayed on the XmN‐
322 minimum side of the ScrollBar slider.
323
324 XmNONE Indicates that no arrows are displayed.
325
326 XmNONE is the default value.
327
328 XmNshowValue
329 Specifies whether a label for the current slider value should
330 be displayed next to the slider. If the value is XmN‐
331 EAR_SLIDER, the current slider value is displayed. If the
332 value is XmNONE, no slider value is displayed. If the value
333 is XmNEAR_BORDER, the current slider value is displayed near
334 the border.
335
336 XmNsliderMark
337 Specifies the shape the slider is to be displayed in. This
338 resource can take the following values:
339
340 XmETCHED_LINE
341 Specifies the slider as an etched line. This is the
342 default when XmNslidingMode is XmSLIDER.
343
344 XmNONE Specifies the slider as a foregrounded rectangle.
345 This is the default when XmNslidingMode is XmTHER‐
346 MOMETER and the Scale scrollbar is insensitive to
347 user input (XmNeditable is False.
348
349 XmROUND_MARK
350 Specifies the slider as a shadowed circle. This is
351 the default when XmNslidingMode is XmTHERMOMETER
352 and the Scale scrollbar is sensitive to user input
353 (XmNeditable is True.
354
355 XmTHUMB_MARK
356 Specifies the slider as a series of three etched
357 lines centered in the middle of the slider.
358
359 XmNslidingMode
360 Specifies the mode the slider works in. There are two possi‐
361 ble modes:
362
363 XmSLIDER Allows the slider to move freely between the mini‐
364 mum and maximum ends of the scale. This is the
365 default value.
366
367 XmTHERMOMETER
368 Forces the slider to be anchored to one side of the
369 trough area.
370
371 XmNsliderVisual
372 Specifies the color of the slider visual. This resource can
373 take the following values:
374
375 XmBACKGROUND_COLOR
376 Specifies that the slider visual is in the back‐
377 ground color.
378
379 XmFOREGROUND_COLOR
380 Specifies that the slider visual is in the fore‐
381 ground color.
382
383 XmSHADOWED_BACKGROUND
384 Specifies that the slider visual is in the back‐
385 ground color, with a shadow. This is the default
386 when the XmNslidingModel resource is XmSLIDER.
387
388 XmTROUGH_COLOR
389 Specifies that the slider visual is in the trough
390 color. This is the default when the XmNslidingModel
391 resource is XmTHERMOMETER.
392
393 XmNtitleString
394 Specifies the title text string to appear in the Scale widget
395 window.
396
397 XmNvalue Specifies the slider's current position along the scale,
398 between XmNminimum and XmNmaximum. The value is constrained
399 to be within these inclusive bounds. The initial value of
400 this resource is the larger of 0 (zero) and XmNminimum.
401
402 XmNvalueChangedCallback
403 Specifies the list of callbacks that is called when the value
404 of the slider has changed. The reason sent by the callback is
405 XmCR_VALUE_CHANGED.
406
407 Inherited Resources
408 Scale inherits behavior and resources from the superclasses described
409 in the following tables. For a complete description of each resource,
410 refer to the reference page for that superclass.
411
412 ┌────────────────────────────────────────────────────────────────────────────────────────────────────┐
413 │ │ XmManager │Resource Set │ │ │
414 │Name │ Class │ Type │ Default │ Access │
415 ├────────────────────────┼───────────────────────┼───────────────────┼──────────────────────┼────────┤
416 │XmNbottomShadowColor │ XmCBottomShadowColor │ Pixel │ dynamic │ CSG │
417 ├────────────────────────┼───────────────────────┼───────────────────┼──────────────────────┼────────┤
418 │XmNbottomShadowPixmap │ XmCBottomShadowPixmap │ Pixmap │ XmUNSPECIFIED_PIXMAP │ CSG │
419 ├────────────────────────┼───────────────────────┼───────────────────┼──────────────────────┼────────┤
420 │XmNforeground │ XmCForeground │ Pixel │ dynamic │ CSG │
421 ├────────────────────────┼───────────────────────┼───────────────────┼──────────────────────┼────────┤
422 │XmNhelpCallback │ XmCCallback │ XtCallbackList │ NULL │ C │
423 ├────────────────────────┼───────────────────────┼───────────────────┼──────────────────────┼────────┤
424 │XmNhighlightColor │ XmCHighlightColor │ Pixel │ dynamic │ CSG │
425 ├────────────────────────┼───────────────────────┼───────────────────┼──────────────────────┼────────┤
426 │XmNhighlightPixmap │ XmCHighlightPixmap │ Pixmap │ dynamic │ CSG │
427 ├────────────────────────┼───────────────────────┼───────────────────┼──────────────────────┼────────┤
428 │XmNinitialFocus │ XmCInitialFocus │ Widget │ NULL │ CSG │
429 ├────────────────────────┼───────────────────────┼───────────────────┼──────────────────────┼────────┤
430 │XmNlayoutDirection │ XmCLayoutDirection │ XmDirection │ dynamic │ CG │
431 ├────────────────────────┼───────────────────────┼───────────────────┼──────────────────────┼────────┤
432 │XmNnavigationType │ XmCNavigationType │ XmNavigationType │ XmTAB_GROUP │ CSG │
433 ├────────────────────────┼───────────────────────┼───────────────────┼──────────────────────┼────────┤
434 │XmNpopupHandlerCallback │ XmCCallback │ XtCallbackList │ NULL │ C │
435 ├────────────────────────┼───────────────────────┼───────────────────┼──────────────────────┼────────┤
436 │XmNshadowThickness │ XmCShadowThickness │ Dimension │ 2 │ CSG │
437 ├────────────────────────┼───────────────────────┼───────────────────┼──────────────────────┼────────┤
438 │XmNstringDirection │ XmCStringDirection │ XmStringDirection │ dynamic │ CG │
439 ├────────────────────────┼───────────────────────┼───────────────────┼──────────────────────┼────────┤
440 │XmNtopShadowColor │ XmCTopShadowColor │ Pixel │ dynamic │ CSG │
441 ├────────────────────────┼───────────────────────┼───────────────────┼──────────────────────┼────────┤
442 │XmNtopShadowPixmap │ XmCTopShadowPixmap │ Pixmap │ dynamic │ CSG │
443 ├────────────────────────┼───────────────────────┼───────────────────┼──────────────────────┼────────┤
444 │XmNtraversalOn │ XmCTraversalOn │ Boolean │ True │ CSG │
445 ├────────────────────────┼───────────────────────┼───────────────────┼──────────────────────┼────────┤
446 │XmNunitType │ XmCUnitType │ unsigned char │ dynamic │ CSG │
447 ├────────────────────────┼───────────────────────┼───────────────────┼──────────────────────┼────────┤
448 │XmNuserData │ XmCUserData │ XtPointer │ NULL │ CSG │
449 ├────────────────────────┼───────────────────────┼───────────────────┼──────────────────────┼────────┤
450 └────────────────────────┴───────────────────────┴───────────────────┴──────────────────────┴────────┘
451 ┌───────────────────────────────────────────────────────────────────────┐
452 │ │ Composite Reso│urce Set │ │ │
453 │Name │ Class │ Type │ Default │ Access │
454 ├──────────────────┼───────────────────┼─────────────┼─────────┼────────┤
455 │XmNchildren │ XmCReadOnly │ WidgetList │ NULL │ G │
456 ├──────────────────┼───────────────────┼─────────────┼─────────┼────────┤
457 │XmNinsertPosition │ XmCInsertPosition │ XtOrderProc │ NULL │ CSG │
458 ├──────────────────┼───────────────────┼─────────────┼─────────┼────────┤
459 │XmNnumChildren │ XmCReadOnly │ Cardinal │ 0 │ G │
460 ├──────────────────┼───────────────────┼─────────────┼─────────┼────────┤
461 └──────────────────┴───────────────────┴─────────────┴─────────┴────────┘
462 ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
463 │ │ Core Resource Se│t │ │ │
464 │Name │ Class │ Type │ Default │ Access │
465 ├──────────────────────────────┼───────────────────────────────┼────────────────┼──────────────────────┼────────┤
466 │XmNaccelerators │ XmCAccelerators │ XtAccelerators │ dynamic │ CSG │
467 ├──────────────────────────────┼───────────────────────────────┼────────────────┼──────────────────────┼────────┤
468 │XmNancestorSensitive │ XmCSensitive │ Boolean │ dynamic │ G │
469 ├──────────────────────────────┼───────────────────────────────┼────────────────┼──────────────────────┼────────┤
470 │XmNbackground │ XmCBackground │ Pixel │ dynamic │ CSG │
471 ├──────────────────────────────┼───────────────────────────────┼────────────────┼──────────────────────┼────────┤
472 │XmNbackgroundPixmap │ XmCPixmap │ Pixmap │ XmUNSPECIFIED_PIXMAP │ CSG │
473 ├──────────────────────────────┼───────────────────────────────┼────────────────┼──────────────────────┼────────┤
474 │XmNborderColor │ XmCBorderColor │ Pixel │ XtDefaultForeground │ CSG │
475 ├──────────────────────────────┼───────────────────────────────┼────────────────┼──────────────────────┼────────┤
476 │XmNborderPixmap │ XmCPixmap │ Pixmap │ XmUNSPECIFIED_PIXMAP │ CSG │
477 ├──────────────────────────────┼───────────────────────────────┼────────────────┼──────────────────────┼────────┤
478 │XmNborderWidth │ XmCBorderWidth │ Dimension │ 0 │ CSG │
479 ├──────────────────────────────┼───────────────────────────────┼────────────────┼──────────────────────┼────────┤
480 │XmNcolormap │ XmCColormap │ Colormap │ dynamic │ CG │
481 ├──────────────────────────────┼───────────────────────────────┼────────────────┼──────────────────────┼────────┤
482 │XmNdepth │ XmCDepth │ int │ dynamic │ CG │
483 ├──────────────────────────────┼───────────────────────────────┼────────────────┼──────────────────────┼────────┤
484 │XmNdestroyCallback │ XmCCallback │ XtCallbackList │ NULL │ C │
485 ├──────────────────────────────┼───────────────────────────────┼────────────────┼──────────────────────┼────────┤
486 │XmNheight │ XmCHeight │ Dimension │ dynamic │ CSG │
487 ├──────────────────────────────┼───────────────────────────────┼────────────────┼──────────────────────┼────────┤
488 │XmNinitialResourcesPersistent │ XmCInitialResourcesPersistent │ Boolean │ True │ C │
489 ├──────────────────────────────┼───────────────────────────────┼────────────────┼──────────────────────┼────────┤
490 │XmNmappedWhenManaged │ XmCMappedWhenManaged │ Boolean │ True │ CSG │
491 ├──────────────────────────────┼───────────────────────────────┼────────────────┼──────────────────────┼────────┤
492 │XmNscreen │ XmCScreen │ Screen * │ dynamic │ CG │
493 ├──────────────────────────────┼───────────────────────────────┼────────────────┼──────────────────────┼────────┤
494 │XmNsensitive │ XmCSensitive │ Boolean │ True │ CSG │
495 ├──────────────────────────────┼───────────────────────────────┼────────────────┼──────────────────────┼────────┤
496 │XmNtranslations │ XmCTranslations │ XtTranslations │ dynamic │ CSG │
497 ├──────────────────────────────┼───────────────────────────────┼────────────────┼──────────────────────┼────────┤
498 │XmNwidth │ XmCWidth │ Dimension │ dynamic │ CSG │
499 ├──────────────────────────────┼───────────────────────────────┼────────────────┼──────────────────────┼────────┤
500 │XmNx │ XmCPosition │ Position │ 0 │ CSG │
501 ├──────────────────────────────┼───────────────────────────────┼────────────────┼──────────────────────┼────────┤
502 │XmNy │ XmCPosition │ Position │ 0 │ CSG │
503 ├──────────────────────────────┼───────────────────────────────┼────────────────┼──────────────────────┼────────┤
504 └──────────────────────────────┴───────────────────────────────┴────────────────┴──────────────────────┴────────┘
505 Callback Information
506 A pointer to the following structure is passed to the XmNdragCallback
507 and XmNvalueChangedCallback procedures:
508
509 typedef struct
510 {
511 int reason;
512 XEvent * event;
513 int value;
514 } XmScaleCallbackStruct;
515
516 reason Indicates why the callback was invoked
517
518 event Points to the XEvent that triggered the callback
519
520 value Is the new slider value
521
522 A pointer to the following structure is passed to the XmNconvertCall‐
523 back procedures:
524
525 typedef struct
526 {
527 int reason;
528 XEvent *event;
529 Atom selection;
530 Atom target;
531 XtPointer source_data;
532 XtPointer location_data;
533 int flags;
534 XtPointer parm;
535 int parm_format;
536 unsigned long parm_length;
537 int status;
538 XtPointer value;
539 Atom type;
540 int format;
541 unsigned long length;
542 } XmConvertCallbackStruct;
543
544 reason Indicates why the callback was invoked.
545
546 event Points to the XEvent that triggered the callback. It can be
547 NULL.
548
549 selection Indicates the selection for which conversion is being
550 requested. Possible values are CLIPBOARD, PRIMARY, SEC‐
551 ONDARY, and _MOTIF_DROP.
552
553 target Indicates the conversion target.
554
555 source_data
556 Contains information about the selection source. When the
557 selection is _MOTIF_DROP, source_data is the DragContext.
558 Otherwise, it is NULL.
559
560 location_data
561 Contains information about the location of data to be con‐
562 verted. If the value is NULL, the data to be transferred
563 consists of the widget's current selection.
564
565 flags Indicates the status of the conversion. Following are the
566 possible values:
567
568 XmCONVERTING_NONE
569 This flag is currently unused.
570
571 XmCONVERTING_PARTIAL
572 The target widget was able to be converted, but
573 some data was lost.
574
575 XmCONVERTING_SAME
576 The conversion target is the source of the data to
577 be transferred.
578
579 XmCONVERTING_TRANSACT
580 This flag is currently unused.
581
582 parm Contains parameter data for this target. If no parameter
583 data exists, the value is NULL.
584
585 When selection is CLIPBOARD and target is _MOTIF_CLIP‐
586 BOARD_TARGETS or _MOTIF_DEFERRED_CLIPBOARD_TARGETS, the value
587 is the requested operation (XmCOPY, XmMOVE, or XmLINK).
588
589 parm_format
590 Specifies whether the data in parm should be viewed as a list
591 of char, short, or long quantities. Possible values are 0
592 (when parm is NULL), 8 (when the data in parm should be
593 viewed as a list of chars), 16 (when the data in parm should
594 be viewed as a list of shorts), or 32 (when the data in parm
595 should be viewed as a list of longs). Note that parm_format
596 symbolizes a data type, not the number of bits in each list
597 element. For example, on some machines, a parm_format of 32
598 means that the data in parm should be viewed as a list of
599 64-bit quantities, not 32-bit quantities.
600
601 parm_length
602 Specifies the number of elements of data in parm, where each
603 element has the size specified by parm_format. When parm is
604 NULL, the value is 0.
605
606 status An IN/OUT member that specifies the status of the conversion.
607 The initial value is XmCONVERT_DEFAULT. The callback proce‐
608 dure can set this member to one of the following values:
609
610 XmCONVERT_DEFAULT
611 This value means that the widget class conversion
612 procedure, if any, is called after the callback
613 procedures return. If the widget class conversion
614 procedure produces any data, it overwrites the data
615 provided by the callback procedures in the value
616 member.
617
618 XmCONVERT_MERGE
619 This value means that the widget class conversion
620 procedure, if any, is called after the callback
621 procedures return. If the widget class conversion
622 procedure produces any data, it appends its data to
623 the data provided by the callback procedures in the
624 value member. This value is intended for use with
625 targets that result in lists of data, such as TAR‐
626 GETS.
627
628 XmCONVERT_DONE
629 This value means that the callback procedure has
630 successfully finished the conversion. The widget
631 class conversion procedure, if any, is not called
632 after the callback procedures return.
633
634 XmCONVERT_REFUSE
635 This value means that the callback procedure has
636 terminated the conversion process without complet‐
637 ing the requested conversion. The widget class
638 conversion procedure, if any, is not called after
639 the callback procedures return.
640
641 value An IN/OUT parameter that contains any data that the callback
642 procedure produces as a result of the conversion. The ini‐
643 tial value is NULL. If the callback procedure sets this mem‐
644 ber, it must ensure that the type, format, and length members
645 correspond to the data in value. The callback procedure is
646 responsible for allocating, but not for freeing, memory when
647 it sets this member.
648
649 type An IN/OUT parameter that indicates the type of the data in
650 the value member. The initial value is INTEGER.
651
652 format An IN/OUT parameter that specifies whether the data in value
653 should be viewed as a list of char, short, or long quanti‐
654 ties. The initial value is 8. The callback procedure can
655 set this member to 8 (for a list of char), 16 (for a list of
656 short), or 32 (for a list of long).
657
658 length An IN/OUT member that specifies the number of elements of
659 data in value, where each element has the size symbolized by
660 format. The initial value is 0.
661
662 Behavior
663 XmScale has the following behavior:
664
665 <Btn1Down> or <Btn2Down>:
666 In the region between an end of the Scale and the slider:
667 Moves the slider by one multiple increment in the direction
668 of the end of the Scale and calls the XmNvalueChangedCallback
669 callbacks. If XmNprocessingDirection is XmMAX_ON_RIGHT or
670 XmMAX_ON_BOTTOM, movement toward the right or bottom incre‐
671 ments the Scale value, and movement toward the left or top
672 decrements the Scale value. If XmNprocessingDirection is
673 XmMAX_ON_LEFT or XmMAX_ON_TOP, movement toward the right or
674 bottom decrements the Scale value, and movement toward the
675 left or top increments the Scale value. If the button is
676 held down longer than a delay period, the slider is moved
677 again by the same increment and the same callbacks are
678 called.
679
680 In slider: Activates the interactive dragging of the slider.
681
682 <Btn2Down> in value label:
683 Drags the contents of the label showing the current slider
684 value. This action sets the XmNconvertProc of the DragCon‐
685 text to a function that calls the XmNconvertCallback proce‐
686 dures, possibly multiple times, for the _MOTIF_DROP selec‐
687 tion.
688
689 <Btn1Motion> or <Btn2Motion>:
690 If the button press occurs within the slider, the subsequent
691 motion events move the slider to the position of the pointer
692 and call the callbacks for XmNdragCallback.
693
694 <Btn1Up> or <Btn2Up>:
695 If the button press occurs within the slider and the slider
696 position is changed, the callbacks for XmNvalueChangedCall‐
697 back are called.
698
699 <Ctrl><Btn1Down>:
700 In the region between an end of the Scale and the slider:
701 Moves the slider to that end of the Scale and calls the XmN‐
702 valueChangedCallback callbacks. If XmNprocessingDirection is
703 XmMAX_ON_RIGHT or XmMAX_ON_BOTTOM, movement toward the right
704 or bottom increments the Scale value, and movement toward the
705 left or top decrements the Scale value. If XmNprocessingDi‐
706 rection is XmMAX_ON_LEFT or XmMAX_ON_TOP, movement toward the
707 right or bottom decrements the Scale value, and movement
708 toward the left or top increments the Scale value.
709
710 <Key><osfUp>:
711 For vertical Scales, moves the slider up one increment and
712 calls the XmNvalueChangedCallback callbacks. If XmNprocess‐
713 ingDirection is XmMAX_ON_TOP, movement toward the top incre‐
714 ments the Scale value. If XmNprocessingDirection is
715 XmMAX_ON_BOTTOM, movement toward the top decrements the Scale
716 value.
717
718 <Key><osfDown>:
719 For vertical Scales, moves the slider down one increment and
720 calls the XmNvalueChangedCallback callbacks. If XmNprocess‐
721 ingDirection is XmMAX_ON_BOTTOM, movement toward the bottom
722 increments the Scale value. If XmNprocessingDirection is
723 XmMAX_ON_TOP, movement toward the bottom decrements the Scale
724 value.
725
726 <Key><osfLeft>:
727 For horizontal Scales, moves the slider one increment to the
728 left and calls the XmNvalueChangedCallback callbacks. If
729 XmNprocessingDirection is XmMAX_ON_LEFT, movement toward the
730 left increments the Scale value. If XmNprocessingDirection
731 is XmMAX_ON_RIGHT, movement toward the left decrements the
732 Scale value.
733
734 <Key><osfRight>:
735 For horizontal Scales, moves the slider one increment to the
736 right and calls the XmNvalueChangedCallback callbacks. If
737 XmNprocessingDirection is XmMAX_ON_RIGHT, movement toward the
738 right increments the Scale value. If XmNprocessingDirection
739 is XmMAX_ON_LEFT, movement toward the right decrements the
740 Scale value.
741
742 <Ctrl><Key><osfUp> or <Key><osfPageUp>:
743 For vertical Scales, moves the slider up one multiple incre‐
744 ment and calls the XmNvalueChangedCallback callbacks. If
745 XmNprocessingDirection is XmMAX_ON_TOP, movement toward the
746 top increments the Scale value. If XmNprocessingDirection is
747 XmMAX_ON_BOTTOM, movement toward the top decrements the Scale
748 value.
749
750 <Ctrl><Key><osfDown> or <Key><osfPageDown>:
751 For vertical Scales, moves the slider down one multiple
752 increment and calls the XmNvalueChangedCallback callbacks.
753 If XmNprocessingDirection is XmMAX_ON_BOTTOM, movement toward
754 the bottom increments the Scale value. If XmNprocessingDi‐
755 rection is XmMAX_ON_TOP, movement toward the bottom decre‐
756 ments the Scale value.
757
758 <Ctrl><Key><osfLeft> or <Key><osfPageLeft>:
759 For horizontal Scales, moves the slider one multiple incre‐
760 ment to the left and calls the XmNvalueChangedCallback call‐
761 backs. If XmNprocessingDirection is XmMAX_ON_LEFT, movement
762 toward the left increments the Scale value. If XmNprocess‐
763 ingDirection is XmMAX_ON_RIGHT, movement toward the left
764 decrements the Scale value.
765
766 <Ctrl><Key><osfRight> or <Key><osfPageRight>:
767 For horizontal Scales, moves the slider one multiple incre‐
768 ment to the right and calls the XmNvalueChangedCallback call‐
769 backs. If XmNprocessingDirection is XmMAX_ON_RIGHT, movement
770 toward the right increments the Scale value. If XmNprocess‐
771 ingDirection is XmMAX_ON_LEFT, movement toward the right
772 decrements the Scale value.
773
774 <Key><osfBeginLine> or <Key><osfBeginData>:
775 Moves the slider to the minimum value and calls the XmNval‐
776 ueChangedCallback callbacks.
777
778 <Key><osfEndLine> or <Key><osfEndData>:
779 Moves the slider to the maximum value and calls the XmNval‐
780 ueChangedCallback callbacks.
781
782 <Key><osfNextField>:
783 Traverses to the first item in the next tab group. If the
784 current tab group is the last entry in the tab group list, it
785 wraps to the beginning of the tab group list.
786
787 <Key><osfPrevField>:
788 Traverses to the first item in the previous tab group. If
789 the beginning of the tab group list is reached, it wraps to
790 the end of the tab group list.
791
792 <Key><osfHelp>:
793 Calls the callbacks for XmNhelpCallback if any exist. If
794 there are no help callbacks for this widget, this action
795 calls the help callbacks for the nearest ancestor that has
796 them.
797
798 Virtual Bindings
799 The bindings for virtual keys are vendor specific. For information
800 about bindings for virtual buttons and keys, see VirtualBindings(3).
801
803 Composite(3), Constraint(3), Core(3), XmCreateScale(3), XmManager(3),
804 XmScaleGetValue(3), XmScaleSetValue(3), XmVaCreateScale(3), and
805 XmVaCreateManagedScale(3).
806
807
808
809 XmScale(library call)