1XmToggleButtonGadget(library call)          XmToggleButtonGadget(library call)
2
3
4

NAME

6       XmToggleButtonGadget — The ToggleButtonGadget widget class
7

SYNOPSIS

9       #include <Xm/ToggleBG.h>
10

DESCRIPTION

12       ToggleButtonGadget sets nontransitory state data within an application.
13       Usually this gadget consists  of  an  indicator  (square,  diamond,  or
14       round) with either text or a pixmap on one side of it.  However, it can
15       also consist of just text or a pixmap without the indicator.
16
17       The toggle graphics display a 1-of-many, N-of-many, or  N-of-many-round
18       selection  state.  When a toggle indicator is displayed, a square indi‐
19       cator shows an N-of-many selection state,  a  diamond-shaped  indicator
20       shows  a 1-of-many selection state, and a circle-shaped indicator shows
21       a 1-of-many-round selection state.
22
23       ToggleButtonGadget implies a set or unset state.   In  the  case  of  a
24       label  and an indicator, an empty indicator (square, diamond, or round)
25       indicates that ToggleButtonGadget is  unset,  and  a  filled  indicator
26       shows  that it is set. The indicator may be filled with a check mark or
27       the select color. In the case of a pixmap toggle, different pixmaps are
28       used  to  display  the  set/unset  states.  ToggleButtonGadget can also
29       indicate an indeterminate state. In the case of a label and an  indica‐
30       tor,  an  indeterminate  state is indicated by a stippled flat box.  In
31       the case of a pixmap toggle, a different pixmap is used to display  the
32       indeterminate state.
33
34       The  default  behavior  associated  with a ToggleButtonGadget in a menu
35       depends on the type of menu system in which it  resides.   By  default,
36       <Btn1>  controls  the behavior of the ToggleButtonGadget.  In addition,
37       <Btn3> controls the behavior of the ToggleButtonGadget if it resides in
38       a  PopupMenu system.  The actual mouse button used is determined by its
39       RowColumn parent.
40
41       Label's resource XmNmarginLeft may be increased to accommodate the tog‐
42       gle indicator when it is created.
43
44       ToggleButtonGadget  uses  the XmQTmenuSystem and XmQTspecifyRenderTable
45       traits.
46
47   Classes
48       ToggleButtonGadget  inherits  behavior,  resources,  and  traits   from
49       Object, RectObj, XmGadget and XmLabelGadget.
50
51       The class pointer is xmToggleButtonGadgetClass.
52
53       The class name is XmToggleButtonGadget.
54
55   New Resources
56       The  following table defines a set of widget resources used by the pro‐
57       grammer to specify data. The programmer can also set the resource  val‐
58       ues  for  the  inherited  classes to set attributes for this widget. To
59       reference a resource by name or by class in a .Xdefaults  file,  remove
60       the  XmN or XmC prefix and use the remaining letters. To specify one of
61       the defined values for a resource in a .Xdefaults file, remove  the  Xm
62       prefix and use the remaining letters (in either lowercase or uppercase,
63       but include any underscores between words).  The codes  in  the  access
64       column  indicate if the given resource can be set at creation time (C),
65       set by using XtSetValues (S), retrieved by using XtGetValues (G), or is
66       not applicable (N/A).
67
68       ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────┐
69       │                           │       XmToggleButtonGadget │Resource Set     │                      │        │
70Name                       Class                      Type           Default              Access 
71       ├───────────────────────────┼────────────────────────────┼────────────────┼──────────────────────┼────────┤
72       │XmNarmCallback             │ XmCArmCallback             │ XtCallbackList │ NULL                 │ C      │
73       ├───────────────────────────┼────────────────────────────┼────────────────┼──────────────────────┼────────┤
74       │XmNdetailShadowThickness   │ XmCDetailShadowThickness   │ Dimension      │ 2                    │ CSG    │
75       ├───────────────────────────┼────────────────────────────┼────────────────┼──────────────────────┼────────┤
76       │XmNdisarmCallback          │ XmCDisarmCallback          │ XtCallbackList │ NULL                 │ C      │
77       ├───────────────────────────┼────────────────────────────┼────────────────┼──────────────────────┼────────┤
78       │XmNfillOnSelect            │ XmCFillOnSelect            │ Boolean        │ dynamic              │ CSG    │
79       ├───────────────────────────┼────────────────────────────┼────────────────┼──────────────────────┼────────┤
80       │XmNindeterminatePixmap     │ XmCIndeterminatePixmap     │ Pixmap         │ XmUNSPECIFIED_PIXMAP │ CSG    │
81       ├───────────────────────────┼────────────────────────────┼────────────────┼──────────────────────┼────────┤
82       │XmNindicatorOn             │ XmCIndicatorOn             │ unsigned char  │ XmINDICATOR_FILL     │ CSG    │
83       ├───────────────────────────┼────────────────────────────┼────────────────┼──────────────────────┼────────┤
84       │XmNindicatorSize           │ XmCIndicatorSize           │ Dimension      │ dynamic              │ CSG    │
85       ├───────────────────────────┼────────────────────────────┼────────────────┼──────────────────────┼────────┤
86       │XmNindicatorType           │ XmCIndicatorType           │ unsigned char  │ dynamic              │ CSG    │
87       ├───────────────────────────┼────────────────────────────┼────────────────┼──────────────────────┼────────┤
88       │XmNselectColor             │ XmCSelectColor             │ Pixel          │ dynamic              │ CSG    │
89       ├───────────────────────────┼────────────────────────────┼────────────────┼──────────────────────┼────────┤
90       │XmNselectInsensitivePixmap │ XmCSelectInsensitivePixmap │ Pixmap         │ XmUNSPECIFIED_PIXMAP │ CSG    │
91       ├───────────────────────────┼────────────────────────────┼────────────────┼──────────────────────┼────────┤
92       │XmNselectPixmap            │ XmCSelectPixmap            │ Pixmap         │ XmUNSPECIFIED_PIXMAP │ CSG    │
93       ├───────────────────────────┼────────────────────────────┼────────────────┼──────────────────────┼────────┤
94       │XmNset                     │ XmCSet                     │ unsigned char  │ XmUNSET              │ CSG    │
95       ├───────────────────────────┼────────────────────────────┼────────────────┼──────────────────────┼────────┤
96       │XmNspacing                 │ XmCSpacing                 │ Dimension      │ 4                    │ CSG    │
97       ├───────────────────────────┼────────────────────────────┼────────────────┼──────────────────────┼────────┤
98       │XmNtoggleMode              │ XmCToggleMode              │ unsigned char  │ XmTOGGLE_BOOLEAN     │ CSG    │
99       ├───────────────────────────┼────────────────────────────┼────────────────┼──────────────────────┼────────┤
100       │XmNunselectColor           │ XmCUnselectColor           │ Pixel          │ dynamic              │ CSG    │
101       ├───────────────────────────┼────────────────────────────┼────────────────┼──────────────────────┼────────┤
102       │XmNvalueChangedCallback    │ XmCValueChangedCallback    │ XtCallbackList │ NULL                 │ C      │
103       ├───────────────────────────┼────────────────────────────┼────────────────┼──────────────────────┼────────┤
104       │XmNvisibleWhenOff          │ XmCVisibleWhenOff          │ Boolean        │ dynamic              │ CSG    │
105       ├───────────────────────────┼────────────────────────────┼────────────────┼──────────────────────┼────────┤
106       └───────────────────────────┴────────────────────────────┴────────────────┴──────────────────────┴────────┘
107       XmNarmCallback
108                 Specifies a list of callbacks that is called when the Toggle‐
109                 ButtonGadget is armed.  To arm this gadget, press the  active
110                 mouse button while the pointer is inside the ToggleButtonGad‐
111                 get.  For this callback, the reason is XmCR_ARM.
112
113       XmNdetailShadowThickness
114                 Specifies the thickness of the indicator shadow. The  default
115                 thickness is 2 pixels.
116
117       XmNdisarmCallback
118                 Specifies  a list of callbacks called when ToggleButtonGadget
119                 is disarmed.  To disarm this gadget, press  and  release  the
120                 active  mouse  button while the pointer is inside the Toggle‐
121                 ButtonGadget.  The gadget is  also  disarmed  when  the  user
122                 moves  out  of  the gadget and releases the mouse button when
123                 the pointer is outside the gadget.  For  this  callback,  the
124                 reason is XmCR_DISARM.
125
126       XmNfillOnSelect
127                 Fills  the  indicator  with the color specified in XmNselect‐
128                 Color and switches the top and bottom shadow colors when  set
129                 to  True.  If  unset,  fills  the indicator with the unselect
130                 color. If indeterminate, fills the indicator with half select
131                 color  and  half unselect color.  Otherwise, it switches only
132                 the top and bottom shadow colors. The  default  is  set  True
133                 only  if  a  box  type  of indicator (such as a check box) is
134                 specified, or if the XmNindicatorType is a 1-of  type  and  a
135                 toggle  indicator  is  drawn.   If  XmNfillOnSelect  is True,
136                 XmNset is XmSET, and XmNindicatorOn is  XmINDICATOR_NONE  the
137                 ToggleButtonGadget's background is set to XmNselectColor. For
138                 the other XmNindicatorOn values, only the indicator is filled
139                 with XmNselectColor.
140
141       XmNindeterminateInsensitivePixmap
142                 Specifies  the pixmap to be displayed as the button face when
143                 the   Label   XmNlableType   resource    is    XmPIXMAP    or
144                 XmPIXMAP_AND_STRING,  the  ToggleButtonGadget XmNset resource
145                 is XmINDETERMINATE, and the  Core  XmNsensitive  resource  is
146                 False.
147
148       XmNindeterminatePixmap
149                 Specifies  the pixmap to be displayed as the button face when
150                 the   Label   XmNlableType   resource    is    XmPIXMAP    or
151                 XmPIXMAP_AND_STRING,  the  ToggleButtonGadget XmNset resource
152                 is XmINDETERMINATE, and the  Core  XmNsensitive  resource  is
153                 True.
154
155       XmNindicatorOn
156                 Specifies  that if a toggle indicator is to be drawn, it will
157                 be drawn to one side of the toggle text or pixmap,  depending
158                 on the XmNlayoutDirection resource of the widget. The default
159                 value is XmINDICATOR_FILL.  Toggles accept the following val‐
160                 ues:
161
162                 XmINDICATOR_NONE
163                           No  space is allocated for the indicator, and it is
164                           not displayed. Any shadows around the entire widget
165                           are  switched  when the toggle is selected or unse‐
166                           lected.
167
168                 XmINDICATOR_BOX
169                           The toggle indicator is in the shape of a  shadowed
170                           box.
171
172                 XmINDICATOR_FILL
173                           If the value of the XmDisplay XmNenableToggleVisual
174                           resource is True , the visuals are those of XmINDI‐
175                           CATOR_CHECK_BOX  ; if False , the indicator visuals
176                           are those of XmINDICATOR_BOX.
177
178                 XmINDICATOR_CHECK
179                           The toggle indicator is in the shape of a checkmark
180                           in the foreground color.
181
182                 XmINDICATOR_CHECK_BOX
183                           The toggle indicator is in the shape of a checkmark
184                           enclosed in a box.  This  is  the  default  if  the
185                           XmDisplay XmNenableToggleVisual resource is set.
186
187                 XmINDICATOR_CROSS_BOX
188                           The  toggle  indicator  is  in the shape of a cross
189                           enclosed in a box.
190
191                 XmINDICATOR_CROSS
192                           The toggle indicator is in the shape of a cross.
193
194                 All ToggleButton checks and crosses should be  drawn  in  the
195                 foreground color.
196
197                 If this resource is not XmINDICATOR_NONE, it will control the
198                 appearance of the toggle visual. If XmNset is XmINDETERMINATE
199                 and  XmNindicatorOn  is  not  XmINDICATOR_NONE, this resource
200                 shows a stippled flat box.   If  XmNset  is  XmINDETERMINATE,
201                 XmNindicatorOn  is  XmINDICATOR_NONE,  and  XmNtoggleMode  is
202                 XmTOGGLE_INDETERMINATE, the label and  the  ToggleButton  are
203                 stippled  with  a  combination  of the XmNselectColor and the
204                 XmNunselectColor color, and the border is flat.
205
206       XmNindicatorSize
207                 Sets the size of the indicator.  If no  value  is  specified,
208                 the  size  of the indicator is based on the size of the label
209                 string or pixmap.  If the label string or pixmap changes, the
210                 size  of the indicator is recomputed based on the size of the
211                 label string or pixmap.  Once a value has been specified  for
212                 XmNindicatorSize,  the indicator has that size, regardless of
213                 the size of the label string or pixmap, until a new value  is
214                 specified.   The  size  of indicators inside menus may differ
215                 from those outside of menus.  Note  that  a  change  in  this
216                 resource  may also cause a change in the values of the inher‐
217                 ited resources XmNmarginTop, XmNmarginBottom, and  XmNmargin‐
218                 Left.
219
220       XmNindicatorType
221                 Specifies  if  the indicator is a 1-of or N-of indicator. For
222                 the  1-of  indicator,  the  value   can   be   XmONE_OF_MANY,
223                 XmONE_OF_MANY_ROUND,  or XmONE_OF_MANY_DIAMOND.  For the N-of
224                 indicator, the value is XmN_OF_MANY.   This  value  specifies
225                 only  the visuals and does not enforce the behavior. When the
226                 ToggleButton is in a radio box, the default is XmONE_OF_MANY;
227                 otherwise, the default is XmN_OF_MANY. Legal values are:
228
229                 XmONE_OF_MANY
230                           When  the Display XmNenableToggleVisual resource is
231                           set, indicators are drawn with the same  appearance
232                           as  XmONE_OF_MANY_ROUND; otherwise, they appear the
233                           same as XmONE_OF_MANY_DIAMOND.
234
235                 XmN_OF_MANY
236                           The  indicators  are  drawn  as  specified  by  the
237                           XmNindicatorOn resource.
238
239                 XmONE_OF_MANY_ROUND
240                           A shadowed circle.
241
242                 XmONE_OF_MANY_DIAMOND
243                           A shadowed diamond.
244
245       XmNselectColor
246                 Allows the application to specify what color fills the center
247                 of the square, diamond-shaped, or round indicator when it  is
248                 set.  If this color is the same as either the top or the bot‐
249                 tom shadow color of the indicator, a one-pixel-wide margin is
250                 left  between  the  shadows  and  the  fill; otherwise, it is
251                 filled completely.  The results of this  resource  depend  on
252                 the  value  of  the  Display resource XmNenableToggleColor. A
253                 value of True causes  the  fill  color  to  use  the  XmHIGH‐
254                 LIGHT_COLOR  color  by  default.  A value of False causes the
255                 fill color to use  the  background  color.   This  resource's
256                 default for a color display is a color between the background
257                 and the bottom shadow color. For a  monochrome  display,  the
258                 default is set to the foreground color. To set the background
259                 of  the  button  to  XmNselectColor  when  XmNindicatorOn  is
260                 XmINDICATOR_NONE,   the  value  of  XmNfillOnSelect  must  be
261                 explicitly set to True.
262
263                 This resource can take the following values:
264
265                 XmDEFAULT_SELECT_COLOR
266                           Is the same as the current dynamic  default,  which
267                           is  a  color  between the background and the bottom
268                           shadow color.
269
270                 XmREVERSED_GROUND_COLORS
271                           Forces the select color to the foreground color and
272                           causes  the default color of any text rendered over
273                           the select color to be in the background color.
274
275                 XmHIGHLIGHT_COLOR
276                           Forces the fill color to use the highlight color.
277
278       XmNselectInsensitivePixmap
279                 Specifies a pixmap used as the button face when  the  Toggle‐
280                 ButtonGadget  is selected, the button is insensitive, and the
281                 LabelGadget   resource   XmNlabelType    is    XmPIXMAP    or
282                 XmPIXMAP_AND_STRING.  If the ToggleButtonGadget is unselected
283                 and the button is insensitive, the pixmap in XmNlabelInsensi‐
284                 tivePixmap is used as the button face.  If no value is speci‐
285                 fied for XmNlabelInsensitivePixmap, that resource is  set  to
286                 the value specified for XmNselectInsensitivePixmap.
287
288       XmNselectPixmap
289                 Specifies  the pixmap to be used as the button face if XmNla‐
290                 belType is XmPIXMAP or XmPIXMAP_AND_STRING, and  the  Toggle‐
291                 ButtonGadget  is  selected.   When  the ToggleButtonGadget is
292                 unselected, the  pixmap  specified  in  LabelGadget's  XmNla‐
293                 belPixmap  is  used.   If  no  value  is specified for XmNla‐
294                 belPixmap, that resource is set to the  value  specified  for
295                 XmNselectPixmap.
296
297       XmNset    Represents  the state of the ToggleButton. A value of XmUNSET
298                 indicates that the ToggleButton is not set. A value of  XmSET
299                 indicates that the ToggleButton is set. A value of XmINDETER‐
300                 MINATE indicates that the ToggleButton is in an indeterminate
301                 state (neither set nor unset).  The ToggleButton states cycle
302                 through in the order of XmSET, XmINDETERMINATE (if XmNtoggle‐
303                 Mode is set to XmTOGGLE_INDETERMINATE), and XmUNSET, and then
304                 back around to XmSET.  If  XmNtoggleMode  is  set  to  XmTOG‐
305                 GLE_BOOLEAN,  then  the  ToggleButton states cycle through in
306                 the order of XmSET, then XmUNSET, and  then  back  around  to
307                 XmSET.   Setting  this resource sets the state of the Toggle‐
308                 Button.
309
310       XmNspacing
311                 Specifies the amount of spacing between the toggle  indicator
312                 and the toggle label (text or pixmap).
313
314       XmNtoggleMode
315                 Specifies the mode of the ToggleButtonGadget as either XmTOG‐
316                 GLE_BOOLEAN or XmTOGGLE_INDETERMINATE. The  XmTOGGLE_INDETER‐
317                 MINATE  value allows the XmNset resource to be able to accept
318                 the values XmINDETERMINATE, XmSET, and XmUNSET.  The  XmNtog‐
319                 gleMode  resource is forced to XmTOGGLE_BOOLEAN if the toggle
320                 is  in  an  XmRowColumn  widget  whose  radio   behavior   is
321                 XmONE_OF_MANY.  In XmTOGGLE_BOOLEAN mode, the XmNset resource
322                 can only accept XmSET and XmUNSET.
323
324       XmNunselectColor
325                 Allows the application to specify what color fills the center
326                 of  the square, diamond-shaped, or round indicator when it is
327                 not set.  If this color is the same as either the top or  the
328                 bottom shadow color of the indicator, a one-pixel-wide margin
329                 is left between the shadows and the fill;  otherwise,  it  is
330                 filled  completely.  This resource's default for a color dis‐
331                 play is XmNbackground.  For a monochrome display, the default
332                 is  set to the background color. To set the background of the
333                 button to XmNunselectColor when XmNindicatorOn  is  XmINDICA‐
334                 TOR_NONE, the value of XmNfillOnSelect must be explicitly set
335                 to True. This resource acts like the XmNselectColor resource,
336                 but for the case when XmNset is XmUNSET.
337
338       XmNvalueChangedCallback
339                 Specifies  a  list of callbacks called when the ToggleButton‐
340                 Gadget value is changed.  To  change  the  value,  press  and
341                 release  the  active mouse button while the pointer is inside
342                 the ToggleButtonGadget. This action also causes the gadget to
343                 be    disarmed.    For   this   callback,   the   reason   is
344                 XmCR_VALUE_CHANGED.
345
346       XmNvisibleWhenOff
347                 Indicates that the toggle indicator is visible in  the  unse‐
348                 lected  state  when the Boolean value is True.  When the Tog‐
349                 gleButtonGadget is in a menu, the  default  value  is  False.
350                 When  the  ToggleButtonGadget  is  in a RadioBox, the default
351                 value is True.
352
353   Inherited Resources
354       ToggleButtonGadget inherits behavior  and  resources  from  the  super‐
355       classes  described in the following tables.  For a complete description
356       of each resource, refer to the reference page for that superclass.
357
358       ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────┐
359       │                          │            XmLabelGadget R│esource Set         │                      │        │
360Name                      Class                     Type              Default              Access 
361       ├──────────────────────────┼───────────────────────────┼───────────────────┼──────────────────────┼────────┤
362       │XmNaccelerator            │ XmCAccelerator            │ String            │ NULL                 │ CSG    │
363       ├──────────────────────────┼───────────────────────────┼───────────────────┼──────────────────────┼────────┤
364       │XmNacceleratorText        │ XmCAcceleratorText        │ XmString          │ NULL                 │ CSG    │
365       ├──────────────────────────┼───────────────────────────┼───────────────────┼──────────────────────┼────────┤
366       │XmNalignment              │ XmCAlignment              │ unsigned char     │ dynamic              │ CSG    │
367       ├──────────────────────────┼───────────────────────────┼───────────────────┼──────────────────────┼────────┤
368       │XmNfontList               │ XmCFontList               │ XmFontList        │ dynamic              │ CSG    │
369       ├──────────────────────────┼───────────────────────────┼───────────────────┼──────────────────────┼────────┤
370       │XmNlabelInsensitivePixmap │ XmCLabelInsensitivePixmap │ Pixmap            │ XmUNSPECIFIED_PIXMAP │ CSG    │
371       ├──────────────────────────┼───────────────────────────┼───────────────────┼──────────────────────┼────────┤
372       │XmNlabelPixmap            │ XmCLabelPixmap            │ Pixmap            │ XmUNSPECIFIED_PIXMAP │ CSG    │
373       ├──────────────────────────┼───────────────────────────┼───────────────────┼──────────────────────┼────────┤
374       │XmNlabelString            │ XmCXmString               │ XmString          │ dynamic              │ CSG    │
375       ├──────────────────────────┼───────────────────────────┼───────────────────┼──────────────────────┼────────┤
376       │XmNlabelType              │ XmCLabelType              │ unsigned char     │ XmSTRING             │ CSG    │
377       ├──────────────────────────┼───────────────────────────┼───────────────────┼──────────────────────┼────────┤
378       │XmNmarginBottom           │ XmCMarginBottom           │ Dimension         │ dynamic              │ CSG    │
379       ├──────────────────────────┼───────────────────────────┼───────────────────┼──────────────────────┼────────┤
380       │XmNmarginHeight           │ XmCMarginHeight           │ Dimension         │ 2                    │ CSG    │
381       ├──────────────────────────┼───────────────────────────┼───────────────────┼──────────────────────┼────────┤
382       │XmNmarginLeft             │ XmCMarginLeft             │ Dimension         │ dynamic              │ CSG    │
383       ├──────────────────────────┼───────────────────────────┼───────────────────┼──────────────────────┼────────┤
384       │XmNmarginRight            │ XmCMarginRight            │ Dimension         │ 0                    │ CSG    │
385       ├──────────────────────────┼───────────────────────────┼───────────────────┼──────────────────────┼────────┤
386       │XmNmarginTop              │ XmCMarginTop              │ Dimension         │ dynamic              │ CSG    │
387       ├──────────────────────────┼───────────────────────────┼───────────────────┼──────────────────────┼────────┤
388       │XmNmarginWidth            │ XmCMarginWidth            │ Dimension         │ 2                    │ CSG    │
389       ├──────────────────────────┼───────────────────────────┼───────────────────┼──────────────────────┼────────┤
390       │XmNmnemonic               │ XmCMnemonic               │ KeySym            │ NULL                 │ CSG    │
391       ├──────────────────────────┼───────────────────────────┼───────────────────┼──────────────────────┼────────┤
392       │XmNmnemonicCharSet        │ XmCMnemonicCharSet        │ String            │ dynamic              │ CSG    │
393       ├──────────────────────────┼───────────────────────────┼───────────────────┼──────────────────────┼────────┤
394       │XmNpixmapPlacement        │ XmCPixmapPlacement        │ unsigned int      │ XmPIXMAP_LEFT        │ CSG    │
395       ├──────────────────────────┼───────────────────────────┼───────────────────┼──────────────────────┼────────┤
396       │XmNpixmapTextPadding      │ XmCSpace                  │ Dimension         │ 2                    │ CSG    │
397       ├──────────────────────────┼───────────────────────────┼───────────────────┼──────────────────────┼────────┤
398       │XmNrecomputeSize          │ XmCRecomputeSize          │ Boolean           │ True                 │ CSG    │
399       ├──────────────────────────┼───────────────────────────┼───────────────────┼──────────────────────┼────────┤
400       │XmNrenderTable            │ XmCRenderTable            │ XmRenderTable     │ dynamic              │ CSG    │
401       ├──────────────────────────┼───────────────────────────┼───────────────────┼──────────────────────┼────────┤
402       │XmNstringDirection        │ XmCStringDirection        │ XmStringDirection │ dynamic              │ CSG    │
403       ├──────────────────────────┼───────────────────────────┼───────────────────┼──────────────────────┼────────┤
404       └──────────────────────────┴───────────────────────────┴───────────────────┴──────────────────────┴────────┘
405       ┌─────────────────────────────────────────────────────────────────────────────────────────────────┐
406       │                      │              XmGadget │Resource Set       │                      │        │
407Name                  Class                 Type             Default              Access 
408       ├──────────────────────┼───────────────────────┼──────────────────┼──────────────────────┼────────┤
409       │XmNbackground         │ XmCBackground         │ Pixel            │ dynamic              │ CSG    │
410       ├──────────────────────┼───────────────────────┼──────────────────┼──────────────────────┼────────┤
411       │XmNbackgroundPixmap   │ XmCPixmap             │ Pixmap           │ XmUNSPECIFIED_PIXMAP │ CSG    │
412       ├──────────────────────┼───────────────────────┼──────────────────┼──────────────────────┼────────┤
413       │XmNbottomShadowColor  │ XmCBottomShadowColor  │ Pixel            │ dynamic              │ CSG    │
414       ├──────────────────────┼───────────────────────┼──────────────────┼──────────────────────┼────────┤
415       │XmNbottomShadowPixmap │ XmCBottomShadowPixmap │ Pixmap           │ dynamic              │ CSG    │
416       ├──────────────────────┼───────────────────────┼──────────────────┼──────────────────────┼────────┤
417       │XmNhelpCallback       │ XmCCallback           │ XtCallbackList   │ NULL                 │ C      │
418       ├──────────────────────┼───────────────────────┼──────────────────┼──────────────────────┼────────┤
419       │XmNforeground         │ XmCForeground         │ Pixel            │ dynamic              │ CSG    │
420       ├──────────────────────┼───────────────────────┼──────────────────┼──────────────────────┼────────┤
421       │XmNhighlightColor     │ XmCHighlightColor     │ Pixel            │ dynamic              │ CSG    │
422       ├──────────────────────┼───────────────────────┼──────────────────┼──────────────────────┼────────┤
423       │XmNhighlightOnEnter   │ XmCHighlightOnEnter   │ Boolean          │ False                │ CSG    │
424       ├──────────────────────┼───────────────────────┼──────────────────┼──────────────────────┼────────┤
425       │XmNhighlightPixmap    │ XmCHighlightPixmap    │ Pixmap           │ dynamic              │ CSG    │
426       ├──────────────────────┼───────────────────────┼──────────────────┼──────────────────────┼────────┤
427       │XmNhighlightThickness │ XmCHighlightThickness │ Dimension        │ 2                    │ CSG    │
428       ├──────────────────────┼───────────────────────┼──────────────────┼──────────────────────┼────────┤
429       │XmNlayoutDirection    │ XmNCLayoutDirection   │ XmDirection      │ dynamic              │ CG     │
430       ├──────────────────────┼───────────────────────┼──────────────────┼──────────────────────┼────────┤
431       │XmNnavigationType     │ XmCNavigationType     │ XmNavigationType │ XmNONE               │ CSG    │
432       ├──────────────────────┼───────────────────────┼──────────────────┼──────────────────────┼────────┤
433       │XmNshadowThickness    │ XmCShadowThickness    │ Dimension        │ dynamic              │ CSG    │
434       ├──────────────────────┼───────────────────────┼──────────────────┼──────────────────────┼────────┤
435       │XmNtopShadowColor     │ XmCTopShadowColor     │ Pixel            │ dynamic              │ CSG    │
436       ├──────────────────────┼───────────────────────┼──────────────────┼──────────────────────┼────────┤
437       │XmNtopShadowPixmap    │ XmCTopShadowPixmap    │ Pixmap           │ dynamic              │ CSG    │
438       ├──────────────────────┼───────────────────────┼──────────────────┼──────────────────────┼────────┤
439       │XmNtraversalOn        │ XmCTraversalOn        │ Boolean          │ True                 │ CSG    │
440       ├──────────────────────┼───────────────────────┼──────────────────┼──────────────────────┼────────┤
441       │XmNunitType           │ XmCUnitType           │ unsigned char    │ dynamic              │ CSG    │
442       ├──────────────────────┼───────────────────────┼──────────────────┼──────────────────────┼────────┤
443       │XmNuserData           │ XmCUserData           │ XtPointer        │ NULL                 │ CSG    │
444       ├──────────────────────┼───────────────────────┼──────────────────┼──────────────────────┼────────┤
445       └──────────────────────┴───────────────────────┴──────────────────┴──────────────────────┴────────┘
446       ┌─────────────────────────────────────────────────────────────────────┐
447       │                     │  RectObj Resour│ce Set      │         │        │
448Name                 Class          Type      Default Access 
449       ├─────────────────────┼────────────────┼───────────┼─────────┼────────┤
450       │XmNancestorSensitive │ XmCSensitive   │ Boolean   │ dynamic │ G      │
451       ├─────────────────────┼────────────────┼───────────┼─────────┼────────┤
452       │XmNborderWidth       │ XmCBorderWidth │ Dimension │ 0       │ N/A    │
453       ├─────────────────────┼────────────────┼───────────┼─────────┼────────┤
454       │XmNheight            │ XmCHeight      │ Dimension │ dynamic │ CSG    │
455       ├─────────────────────┼────────────────┼───────────┼─────────┼────────┤
456       │XmNsensitive         │ XmCSensitive   │ Boolean   │ True    │ CSG    │
457       ├─────────────────────┼────────────────┼───────────┼─────────┼────────┤
458       │XmNwidth             │ XmCWidth       │ Dimension │ dynamic │ CSG    │
459       ├─────────────────────┼────────────────┼───────────┼─────────┼────────┤
460       │XmNx                 │ XmCPosition    │ Position  │ 0       │ CSG    │
461       ├─────────────────────┼────────────────┼───────────┼─────────┼────────┤
462       │XmNy                 │ XmCPosition    │ Position  │ 0       │ CSG    │
463       ├─────────────────────┼────────────────┼───────────┼─────────┼────────┤
464       └─────────────────────┴────────────────┴───────────┴─────────┴────────┘
465       ┌─────────────────────────────────────────────────────────────────────┐
466       │                   │    Object Re│source Set       │         │        │
467Name               Class       Type           Default Access 
468       ├───────────────────┼─────────────┼────────────────┼─────────┼────────┤
469       │XmNdestroyCallback │ XmCCallback │ XtCallbackList │ NULL    │ C      │
470       ├───────────────────┼─────────────┼────────────────┼─────────┼────────┤
471       └───────────────────┴─────────────┴────────────────┴─────────┴────────┘
472   Callback Information
473       A pointer to the following structure is passed to each callback:
474
475       typedef struct
476       {
477               int reason;
478               XEvent * event;
479               int set;
480       } XmToggleButtonCallbackStruct;
481
482       reason    Indicates why the callback was invoked
483
484       event     Points to the XEvent that triggered the callback
485
486       set       Reflects  the  ToggleButtonGadget's   state,   either   XmSET
487                 (selected),  XmUNSET  (unselected),  or XmINDETERMINATE (nei‐
488                 ther).  Note that the reported state is the  state  that  the
489                 ToggleButtonGadget  is in after the event has been processed.
490                 For example, suppose that a user clicks on a ToggleButtonGad‐
491                 get  to  change  it from the unselected state to the selected
492                 state. In this case, ToggleButtonGadget changes the value  of
493                 set from XmUNSET to XmSET prior to calling the callback.
494
495   Behavior
496       XmToggleButtonGadget  includes behavior from XmGadget.  XmToggleButton‐
497       Gadget includes menu traversal behavior from XmLabelGadget.  Additional
498       XmToggleButtonGadget behavior is described in the following list:
499
500       <Btn2Down>:
501                 Drags  the contents of a ToggleButtonGadget label, identified
502                 when <Btn2> is pressed.  This action is undefined for Toggle‐
503                 ButtonGadgets used in a menu system.
504
505       <Btn1Down>:
506                 In  a  menu, this action unposts any menus posted by the Tog‐
507                 gleButtonGadget's parent menu,  disables  keyboard  traversal
508                 for  the  menu, and enables mouse traversal for the menu.  It
509                 draws the shadow in the armed state and, unless the button is
510                 already armed, calls the XmNarmCallback callbacks.
511
512                 Outside  a  menu,  if  the  button was previously unset, this
513                 action does the following:  if  XmNindicatorOn  is  True,  it
514                 draws  the  indicator  shadow  so  that  the  indicator looks
515                 pressed; if XmNfillOnSelect is True, it fills  the  indicator
516                 with  the  color  specified by XmNselectColor.  If XmNindica‐
517                 torOn is False, it draws the button shadow so that the button
518                 looks    pressed.     If    XmNlabelType   is   XmPIXMAP   or
519                 XmPIXMAP_AND_STRING, the XmNselectPixmap is used as the  but‐
520                 ton face.  This resource calls the XmNarmCallback callbacks.
521
522                 Outside a menu, if the button was previously set, this action
523                 does the following: if both  XmNindicatorOn  and  XmNvisible‐
524                 WhenOff  are  True, it draws the indicator shadow so that the
525                 indicator looks raised; if XmNfillOnSelect is True, it  fills
526                 the  indicator  with the background color.  If XmNindicatorOn
527                 is False, it draws the button shadow so that the button looks
528                 raised.   If XmNlabelType is XmPIXMAP or XmPIXMAP_AND_STRING,
529                 the XmNlabelPixmap is used as the button face.  This resource
530                 calls the XmNarmCallback callbacks.
531
532       <Btn1Up>: In  a menu, this action unposts all menus in the menu hierar‐
533                 chy.  If the  ToggleButtonGadget  was  previously  set,  this
534                 action  unsets  it;  if the ToggleButtonGadget was previously
535                 unset, this action sets it.  It  calls  the  XmNvalueChanged‐
536                 Callback callbacks and then the XmNdisarmCallback callbacks.
537
538                 If the button is outside a menu and the pointer is within the
539                 button, this action does the following:  if  the  button  was
540                 previously  unset, sets it; if the button was previously set,
541                 unsets it.  This  action  calls  the  XmNvalueChangedCallback
542                 callbacks.
543
544                 If  the  button  is  outside  a  menu,  this action calls the
545                 XmNdisarmCallback callbacks.
546
547       <Key><osfHelp>:
548                 In a Pulldown or Popup MenuPane, unposts  all  menus  in  the
549                 menu hierarchy and, when the shell's keyboard focus policy is
550                 XmEXPLICIT, restores keyboard focus to the  widget  that  had
551                 the  focus  before  the  menu  system was entered.  Calls the
552                 callbacks for XmNhelpCallback if any exist.  If there are  no
553                 help  callbacks  for  this widget, this action calls the help
554                 callbacks for the nearest ancestor that has them.
555
556       <Key><osfActivate>:
557                 In a menu, this action unposts all menus in the menu  hierar‐
558                 chy.   Unless  the button is already armed, this action calls
559                 the XmNarmCallback callbacks; and calls the  XmNvalueChanged‐
560                 Callback  and XmNdisarmCallback callbacks. Outside a menu, if
561                 the parent is a manager, this action passes the event to  the
562                 parent.
563
564       <Key><osfSelect>:
565                 If  the  ToggleButtonGadget  was  previously set, this action
566                 unsets it; if the ToggleButtonGadget  was  previously  unset,
567                 this action sets it.
568
569                 In  a menu, this action unposts all menus in the menu hierar‐
570                 chy.  Unless the button is already armed, this  action  calls
571                 the  XmNarmCallback, the XmNvalueChangedCallback, and XmNdis‐
572                 armCallback callbacks.
573
574                 Outside a menu, if the  button  was  previously  unset,  this
575                 action  does  the  following:  If  XmNindicatorOn is True, it
576                 draws the  indicator  shadow  so  that  the  indicator  looks
577                 pressed;  if  XmNfillOnSelect is True, it fills the indicator
578                 with the color specified by  XmNselectColor.   If  XmNindica‐
579                 torOn is False, it draws the button shadow so that the button
580                 looks   pressed.    If   XmNlabelType    is    XmPIXMAP    or
581                 XmPIXMAP_AND_STRING,  the XmNselectPixmap is used as the but‐
582                 ton face.  This  action  calls  the  XmNarmCallback,  XmNval‐
583                 ueChangedCallback, XmNdisarmCallback callbacks.
584
585                 Outside a menu, if the button was previously set, this action
586                 does the following: If both  XmNindicatorOn  and  XmNvisible‐
587                 WhenOff  are  True, it draws the indicator shadow so that the
588                 indicator looks raised; if XmNfillOnSelect is True, it  fills
589                 the  indicator  with the background color.  If XmNindicatorOn
590                 is False, it draws the button shadow so that the button looks
591                 raised.   If XmNlabelType is XmPIXMAP or XmPIXMAP_AND_STRING,
592                 the XmNlabelPixmap is used as the  button  face.   Calls  the
593                 XmNarmCallback,  XmNvalueChangedCallback,  and XmNdisarmCall‐
594                 back callbacks.
595
596       <Key><osfCancel>:
597                 In a toplevel Pulldown MenuPane from a MenuBar,  unposts  the
598                 menu, disarms the MenuBar CascadeButton and the MenuBar, and,
599                 when  the  shell's  keyboard  focus  policy  is   XmEXPLICIT,
600                 restores  keyboard  focus  to  the  widget that had the focus
601                 before the MenuBar was entered.  In other Pulldown MenuPanes,
602                 this  action unposts the menu.  Outside a menu, if the parent
603                 is a manager, this action passes the event to the parent.
604
605                 In a  Popup  MenuPane,  this  action  unposts  the  menu  and
606                 restores keyboard focus to the widget from which the menu was
607                 posted.
608
609       <Enter>:  In a menu, if keyboard traversal is enabled, this action does
610                 nothing.   Otherwise,  it draws the shadow in the armed state
611                 and calls the XmNarmCallback callbacks.
612
613                 If the ToggleButtonGadget is not in a  menu  and  the  cursor
614                 leaves  and  then  reenters  the ToggleButtonGadget while the
615                 button is pressed, this action restores  the  button's  armed
616                 appearance.
617
618       <Leave>:  In a menu, if keyboard traversal is enabled, this action does
619                 nothing.  Otherwise, it draws the shadow in the unarmed state
620                 and calls the XmNdisarmCallback callbacks.
621
622                 If  the  ToggleButtonGadget  is  not in a menu and the cursor
623                 leaves the ToggleButtonGadget while the  button  is  pressed,
624                 this action restores the button's unarmed appearance.
625
626   Virtual Bindings
627       The  bindings  for  virtual  keys are vendor specific.  For information
628       about bindings for virtual buttons and keys, see VirtualBindings(3).
629
631       Object(3),  RectObj(3),  XmCreateRadioBox(3),  XmCreateToggleButtonGad‐
632       get(3),  XmGadget(3), XmLabelGadget(3), XmRowColumn(3), XmToggleButton‐
633       GadgetGetState(3),  XmToggleButtonGadgetSetState(3),  XmVaCreateToggle‐
634       ButtonGadget(3), and XmVaCreateManagedToggleButtonGadget(3).
635
636
637
638                                            XmToggleButtonGadget(library call)
Impressum