1994689c1Smrg<sect1 id="Toggle_Widget"> 2994689c1Smrg<title>Toggle Widget</title> 3994689c1Smrg<literallayout class="monospaced"> 4994689c1SmrgApplication Header file <Xaw/Toggle.h> 5994689c1SmrgClass Header file <Xaw/ToggleP.h> 6994689c1SmrgClass toggleWidgetClass 7994689c1SmrgClass Name Toggle 8994689c1SmrgSuperclass Command 9994689c1Smrg</literallayout> 10994689c1Smrg 11994689c1Smrg<para> 12994689c1SmrgThe Toggle widget is an area, often rectangular, 13994689c1Smrgthat displays a graphic. The graphic may be a text 14994689c1Smrgstring containing multiple lines of characters in an 8 15994689c1Smrgbit or 16 bit character set (to be displayed with a 16994689c1Smrg<emphasis remap='I'>font</emphasis>), or in a multi-byte encoding (for use with 17994689c1Smrga <emphasis remap='I'>fontset</emphasis>). The graphic may also be a bitmap or 18994689c1Smrgpixmap. 19994689c1Smrg</para> 20994689c1Smrg 21994689c1Smrg<para> 22994689c1SmrgThis widget maintains a Boolean state (e.g. 23994689c1SmrgTrue/False or On/Off) and changes state whenever it is selected. When 24994689c1Smrgthe pointer is on the Toggle widget, the Toggle widget may become highlighted by 25994689c1Smrgdrawing a rectangle around its perimeter. This highlighting indicates 26994689c1Smrgthat the Toggle widget is ready for selection. When pointer button 1 is 27994689c1Smrgpressed and released, the Toggle widget indicates that it has changed 28994689c1Smrgstate by reversing its foreground and background colors, and its 29994689c1Smrg<function>notify</function> action is invoked, calling all functions on its callback 30994689c1Smrglist. If the pointer is moved off of the widget before the pointer button is 31994689c1Smrgreleased, the Toggle widget reverts to its previous foreground and background 32994689c1Smrgcolors, and releasing the pointer button has no effect. This behavior allows 33994689c1Smrgthe user to cancel the operation. 34994689c1Smrg</para> 35994689c1Smrg 36994689c1Smrg<para> 375ec34c4cSmrgToggle widgets may also be part of a <quote>radio group.</quote> A radio group is a 38994689c1Smrglist of at least two Toggle widgets in which no more than one Toggle may 39994689c1Smrgbe set at 40994689c1Smrgany time. A radio group is identified by the widget ID of any one of 41421c997bSmrgits members. The convenience routine <xref linkend='XawToggleGetCurrent' xrefstyle='select: title'/> will 42994689c1Smrgreturn information about the Toggle widget in the radio group. 43994689c1Smrg</para> 44994689c1Smrg 45994689c1Smrg<para> 46994689c1SmrgToggle widget state is preserved across changes in sensitivity. 47994689c1Smrg</para> 48994689c1Smrg 49421c997bSmrg<sect2 id='Toggle::Resources'> 50994689c1Smrg<title>Resources</title> 51994689c1Smrg<para> 52994689c1SmrgWhen creating a Toggle widget instance, the following resources are 53994689c1Smrgretrieved from the argument list or from the resource database: 54994689c1Smrg</para> 55994689c1Smrg 56994689c1Smrg<informaltable> 57994689c1Smrg <tgroup cols='5' align='center'> 58994689c1Smrg <colspec colname='c1'/> 59994689c1Smrg <colspec colname='c2'/> 60994689c1Smrg <colspec colname='c3'/> 61994689c1Smrg <colspec colname='c4'/> 62994689c1Smrg <colspec colname='c5'/> 63994689c1Smrg <thead> 64994689c1Smrg <row> 65994689c1Smrg <entry>Name</entry> 66994689c1Smrg <entry>Class</entry> 67994689c1Smrg <entry>Type</entry> 68994689c1Smrg <entry>Notes</entry> 69994689c1Smrg <entry>Default Value</entry> 70994689c1Smrg </row> 71994689c1Smrg </thead> 72994689c1Smrg <tbody> 73994689c1Smrg <row> 74994689c1Smrg <entry>accelerators</entry> 75994689c1Smrg <entry>Accelerators</entry> 76994689c1Smrg <entry>AcceleratorTable</entry> 77994689c1Smrg <entry></entry> 78994689c1Smrg <entry>NULL</entry> 79994689c1Smrg </row> 80994689c1Smrg <row> 81994689c1Smrg <entry>ancestorSensitive</entry> 82994689c1Smrg <entry>AncestorSensitive</entry> 83994689c1Smrg <entry>Boolean</entry> 84994689c1Smrg <entry>D</entry> 85994689c1Smrg <entry>True</entry> 86994689c1Smrg </row> 87994689c1Smrg <row> 88994689c1Smrg <entry>background</entry> 89994689c1Smrg <entry>Background</entry> 90994689c1Smrg <entry>Pixel</entry> 91994689c1Smrg <entry></entry> 92994689c1Smrg <entry>XtDefaultBackground</entry> 93994689c1Smrg </row> 94994689c1Smrg <row> 95994689c1Smrg <entry>backgroundPixmap</entry> 96994689c1Smrg <entry>Pixmap</entry> 97994689c1Smrg <entry>Pixmap</entry> 98994689c1Smrg <entry></entry> 99994689c1Smrg <entry>XtUnspecifiedPixmap</entry> 100994689c1Smrg </row> 101994689c1Smrg <row> 102994689c1Smrg <entry>bitmap</entry> 103994689c1Smrg <entry>Bitmap</entry> 104994689c1Smrg <entry>Pixmap</entry> 105994689c1Smrg <entry></entry> 106994689c1Smrg <entry>None</entry> 107994689c1Smrg </row> 108994689c1Smrg <row> 109994689c1Smrg <entry>borderColor</entry> 110994689c1Smrg <entry>BorderColor</entry> 111994689c1Smrg <entry>Pixel</entry> 112994689c1Smrg <entry></entry> 113994689c1Smrg <entry>XtDefaultForeground</entry> 114994689c1Smrg </row> 115994689c1Smrg <row> 116994689c1Smrg <entry>borderPixmap</entry> 117994689c1Smrg <entry>Pixmap</entry> 118994689c1Smrg <entry>Pixmap</entry> 119994689c1Smrg <entry></entry> 120994689c1Smrg <entry>XtUnspecifiedPixmap</entry> 121994689c1Smrg </row> 122994689c1Smrg <row> 123994689c1Smrg <entry>borderWidth</entry> 124994689c1Smrg <entry>BorderWidth</entry> 125994689c1Smrg <entry>Dimension</entry> 126994689c1Smrg <entry></entry> 127994689c1Smrg <entry>1</entry> 128994689c1Smrg </row> 129994689c1Smrg <row> 130994689c1Smrg <entry>callback</entry> 131994689c1Smrg <entry>Callback</entry> 132994689c1Smrg <entry>XtCallbackList</entry> 133994689c1Smrg <entry></entry> 134994689c1Smrg <entry>NULL</entry> 135994689c1Smrg </row> 136994689c1Smrg <row> 137994689c1Smrg <entry>colormap</entry> 138994689c1Smrg <entry>Colormap</entry> 139994689c1Smrg <entry>Colormap</entry> 140994689c1Smrg <entry></entry> 141994689c1Smrg <entry>Parent's Colormap</entry> 142994689c1Smrg </row> 143994689c1Smrg <row> 144994689c1Smrg <entry>cornerRoundPercent</entry> 145994689c1Smrg <entry>CornerRoundPercent</entry> 146994689c1Smrg <entry>Dimension</entry> 147994689c1Smrg <entry></entry> 148994689c1Smrg <entry>25</entry> 149994689c1Smrg </row> 150994689c1Smrg <row> 151994689c1Smrg <entry>cursor</entry> 152994689c1Smrg <entry>Cursor</entry> 153994689c1Smrg <entry>Cursor</entry> 154994689c1Smrg <entry></entry> 155994689c1Smrg <entry>None</entry> 156994689c1Smrg </row> 157994689c1Smrg <row> 158994689c1Smrg <entry>cursorName</entry> 159994689c1Smrg <entry>Cursor</entry> 160994689c1Smrg <entry>String</entry> 161994689c1Smrg <entry></entry> 162994689c1Smrg <entry>NULL</entry> 163994689c1Smrg </row> 164994689c1Smrg <row> 165994689c1Smrg <entry>depth</entry> 166994689c1Smrg <entry>Depth</entry> 167994689c1Smrg <entry>int</entry> 168994689c1Smrg <entry>C</entry> 169994689c1Smrg <entry>Parent's Depth</entry> 170994689c1Smrg </row> 171994689c1Smrg <row> 172994689c1Smrg <entry>destroyCallback</entry> 173994689c1Smrg <entry>Callback</entry> 174994689c1Smrg <entry>XtCallbackList</entry> 175994689c1Smrg <entry></entry> 176994689c1Smrg <entry>NULL</entry> 177994689c1Smrg </row> 178994689c1Smrg <row> 179994689c1Smrg <entry>encoding</entry> 180994689c1Smrg <entry>Encoding</entry> 181994689c1Smrg <entry>UnsignedChar</entry> 182994689c1Smrg <entry></entry> 183994689c1Smrg <entry>XawTextEncoding8bit</entry> 184994689c1Smrg </row> 185994689c1Smrg <row> 186994689c1Smrg <entry>font</entry> 187994689c1Smrg <entry>Font</entry> 188994689c1Smrg <entry>XFontStruct</entry> 189994689c1Smrg <entry></entry> 190994689c1Smrg <entry>XtDefaultFont</entry> 191994689c1Smrg </row> 192994689c1Smrg <row> 193994689c1Smrg <entry>fontSet</entry> 194994689c1Smrg <entry>FontSet</entry> 195994689c1Smrg <entry>XFontSet</entry> 196994689c1Smrg <entry></entry> 197994689c1Smrg <entry>XtDefaultFontSet</entry> 198994689c1Smrg </row> 199994689c1Smrg <row> 200994689c1Smrg <entry>foreground</entry> 201994689c1Smrg <entry>Foreground</entry> 202994689c1Smrg <entry>Pixel</entry> 203994689c1Smrg <entry></entry> 204994689c1Smrg <entry>XtDefaultForeground</entry> 205994689c1Smrg </row> 206994689c1Smrg <row> 207994689c1Smrg <entry>height</entry> 208994689c1Smrg <entry>Height</entry> 209994689c1Smrg <entry>Dimension</entry> 210994689c1Smrg <entry>A</entry> 211994689c1Smrg <entry>graphic height + 2 * <function>internalHeight</function></entry> 212994689c1Smrg </row> 213994689c1Smrg <row> 214994689c1Smrg <entry>highlightThickness</entry> 215994689c1Smrg <entry>Thickness</entry> 216994689c1Smrg <entry>Dimension</entry> 217994689c1Smrg <entry>A</entry> 218994689c1Smrg <entry>2 (0 if Shaped)</entry> 219994689c1Smrg </row> 220994689c1Smrg <row> 221994689c1Smrg <entry>insensitiveBorder</entry> 222994689c1Smrg <entry>Insensitive</entry> 223994689c1Smrg <entry>Pixmap</entry> 224994689c1Smrg <entry></entry> 225994689c1Smrg <entry>GreyPixmap</entry> 226994689c1Smrg </row> 227994689c1Smrg <row> 228994689c1Smrg <entry>internalHeight</entry> 229994689c1Smrg <entry>Height</entry> 230994689c1Smrg <entry>Dimension</entry> 231994689c1Smrg <entry></entry> 232994689c1Smrg <entry>2</entry> 233994689c1Smrg </row> 234994689c1Smrg <row> 235994689c1Smrg <entry>internalWidth</entry> 236994689c1Smrg <entry>Width</entry> 237994689c1Smrg <entry>Dimension</entry> 238994689c1Smrg <entry></entry> 239994689c1Smrg <entry>4</entry> 240994689c1Smrg </row> 241994689c1Smrg <row> 242994689c1Smrg <entry>international</entry> 243994689c1Smrg <entry>International</entry> 244994689c1Smrg <entry>Boolean</entry> 245994689c1Smrg <entry>C</entry> 246994689c1Smrg <entry>False</entry> 247994689c1Smrg </row> 248994689c1Smrg <row> 249994689c1Smrg <entry>justify</entry> 250994689c1Smrg <entry>Justify</entry> 251994689c1Smrg <entry>Justify</entry> 252994689c1Smrg <entry></entry> 253994689c1Smrg <entry>XtJustifyCenter (center)</entry> 254994689c1Smrg </row> 255994689c1Smrg <row> 256994689c1Smrg <entry>label</entry> 257994689c1Smrg <entry>Label</entry> 258994689c1Smrg <entry>String</entry> 259994689c1Smrg <entry></entry> 260994689c1Smrg <entry>name of widget</entry> 261994689c1Smrg </row> 262994689c1Smrg <row> 263994689c1Smrg <entry>leftBitmap</entry> 264994689c1Smrg <entry>LeftBitmap</entry> 265994689c1Smrg <entry>Bitmap</entry> 266994689c1Smrg <entry></entry> 267994689c1Smrg <entry>None</entry> 268994689c1Smrg </row> 269994689c1Smrg <row> 270994689c1Smrg <entry>mappedWhenManaged</entry> 271994689c1Smrg <entry>MappedWhenManaged</entry> 272994689c1Smrg <entry>Boolean</entry> 273994689c1Smrg <entry></entry> 274994689c1Smrg <entry>True</entry> 275994689c1Smrg </row> 276994689c1Smrg <row> 277994689c1Smrg <entry>pointerColor</entry> 278994689c1Smrg <entry>Foreground</entry> 279994689c1Smrg <entry>Pixel</entry> 280994689c1Smrg <entry></entry> 281994689c1Smrg <entry>XtDefaultForeground</entry> 282994689c1Smrg </row> 283994689c1Smrg <row> 284994689c1Smrg <entry>pointerColorBackground</entry> 285994689c1Smrg <entry>Background</entry> 286994689c1Smrg <entry>Pixel</entry> 287994689c1Smrg <entry></entry> 288994689c1Smrg <entry>XtDefaultBackground</entry> 289994689c1Smrg </row> 290994689c1Smrg <row> 291994689c1Smrg <entry>radioData</entry> 292994689c1Smrg <entry>RadioData</entry> 293994689c1Smrg <entry>Pointer</entry> 294994689c1Smrg <entry></entry> 295994689c1Smrg <entry>Name of widget</entry> 296994689c1Smrg </row> 297994689c1Smrg <row> 298994689c1Smrg <entry>radioGroup</entry> 299994689c1Smrg <entry>Widget</entry> 300994689c1Smrg <entry>Widget</entry> 301994689c1Smrg <entry></entry> 302994689c1Smrg <entry>No radio group</entry> 303994689c1Smrg </row> 304994689c1Smrg <row> 305994689c1Smrg <entry>resize</entry> 306994689c1Smrg <entry>Resize</entry> 307994689c1Smrg <entry>Boolean</entry> 308994689c1Smrg <entry></entry> 309994689c1Smrg <entry>True</entry> 310994689c1Smrg </row> 311994689c1Smrg <row> 312994689c1Smrg <entry>screen</entry> 313994689c1Smrg <entry>Screen</entry> 314994689c1Smrg <entry>Screen</entry> 315994689c1Smrg <entry>R</entry> 316994689c1Smrg <entry>Parent's Screen</entry> 317994689c1Smrg </row> 318994689c1Smrg <row> 319994689c1Smrg <entry>sensitive</entry> 320994689c1Smrg <entry>Sensitive</entry> 321994689c1Smrg <entry>Boolean</entry> 322994689c1Smrg <entry></entry> 323994689c1Smrg <entry>True</entry> 324994689c1Smrg </row> 325994689c1Smrg <row> 326994689c1Smrg <entry>shapeStype</entry> 327994689c1Smrg <entry>ShapeStyle</entry> 328994689c1Smrg <entry>ShapeStyle</entry> 329994689c1Smrg <entry></entry> 330994689c1Smrg <entry>Rectangle</entry> 331994689c1Smrg </row> 332994689c1Smrg <row> 333994689c1Smrg <entry>state</entry> 334994689c1Smrg <entry>State</entry> 335994689c1Smrg <entry>Boolean</entry> 336994689c1Smrg <entry></entry> 337994689c1Smrg <entry>Off</entry> 338994689c1Smrg </row> 339994689c1Smrg <row> 340994689c1Smrg <entry>translations</entry> 341994689c1Smrg <entry>Translations</entry> 342994689c1Smrg <entry>TranslationTable</entry> 343994689c1Smrg <entry></entry> 344994689c1Smrg <entry>See below</entry> 345994689c1Smrg </row> 346994689c1Smrg <row> 347994689c1Smrg <entry>width</entry> 348994689c1Smrg <entry>Width</entry> 349994689c1Smrg <entry>Dimension</entry> 350994689c1Smrg <entry>A</entry> 351994689c1Smrg <entry>graphic width + 2 * <function>internalWidth</function></entry> 352994689c1Smrg </row> 353994689c1Smrg <row> 354994689c1Smrg <entry>x</entry> 355994689c1Smrg <entry>Position</entry> 356994689c1Smrg <entry>Position</entry> 357994689c1Smrg <entry></entry> 358994689c1Smrg <entry>0</entry> 359994689c1Smrg </row> 360994689c1Smrg <row> 361994689c1Smrg <entry>y</entry> 362994689c1Smrg <entry>Position</entry> 363994689c1Smrg <entry>Position</entry> 364994689c1Smrg <entry></entry> 365994689c1Smrg <entry>0</entry> 366994689c1Smrg </row> 367994689c1Smrg </tbody> 368994689c1Smrg </tgroup> 369994689c1Smrg</informaltable> 370994689c1Smrg 371994689c1Smrg<variablelist> 372994689c1Smrg <varlistentry> 373994689c1Smrg <term> 374994689c1Smrg <function>radioData</function> 375994689c1Smrg </term> 376994689c1Smrg <listitem> 377994689c1Smrg <para> 378421c997bSmrgSpecifies the data that will be returned by <xref linkend='XawToggleGetCurrent' xrefstyle='select: title'/> 379994689c1Smrgwhen this is the currently <emphasis remap='I'>set</emphasis> widget in the radio group. This 380994689c1Smrgvalue is also used to identify the Toggle that will be set by a call to 381421c997bSmrg<xref linkend='XawToggleSetCurrent' xrefstyle='select: title'/>. The value NULL will be returned by 382421c997bSmrg<xref linkend='XawToggleGetCurrent' xrefstyle='select: title'/> if no widget in a radio group is currently 383994689c1Smrgset. Programmers must not specify NULL (or Zero) as <function>radioData</function>. 384994689c1Smrg </para> 385994689c1Smrg </listitem> 386994689c1Smrg </varlistentry> 387994689c1Smrg <varlistentry> 388994689c1Smrg <term> 389994689c1Smrg <function>radioGroup</function> 390994689c1Smrg </term> 391994689c1Smrg <listitem> 392994689c1Smrg <para> 393994689c1SmrgSpecifies another Toggle widget that is in the radio group to which this 394994689c1SmrgToggle widget should be added. A radio group is a group of at least two Toggle 395994689c1Smrgwidgets, only one of which may be <emphasis remap='I'>set</emphasis> at a time. If this value is 396994689c1SmrgNULL (the default) then the Toggle will not be part of any radio group 397994689c1Smrgand can change state without affecting any other Toggle widgets. If the 398994689c1Smrgwidget specified in this resource is not already in a radio group then a 399994689c1Smrgnew radio group will be created containing these two Toggle widgets. No 400994689c1SmrgToggle widget can be in multiple radio groups. The behavior of a radio 401994689c1Smrggroup of one toggle is undefined. A converter is registered which will 402994689c1Smrgconvert widget names to widgets without caching. 403994689c1Smrg </para> 404994689c1Smrg </listitem> 405994689c1Smrg </varlistentry> 406994689c1Smrg <varlistentry> 407994689c1Smrg <term> 408994689c1Smrg <function>state</function> 409994689c1Smrg </term> 410994689c1Smrg <listitem> 411994689c1Smrg <para> 412994689c1SmrgSpecifies whether the Toggle widget is set (<function>True</function>) or unset 413994689c1Smrg(<function>False</function>). 414994689c1Smrg </para> 415994689c1Smrg </listitem> 416994689c1Smrg </varlistentry> 417994689c1Smrg</variablelist> 418994689c1Smrg</sect2> 419994689c1Smrg 420994689c1Smrg<sect2 id="Toggle_Actions"> 421994689c1Smrg<title>Toggle Actions</title> 422994689c1Smrg<para> 423994689c1SmrgThe Toggle widget supports the following actions: 424994689c1Smrg</para> 425994689c1Smrg 426994689c1Smrg<itemizedlist> 427994689c1Smrg <listitem> 428994689c1Smrg <para> 429994689c1SmrgSwitching the Toggle widget between the foreground and background 430994689c1Smrgcolors with <function>set</function> and <function>unset</function> and <function>toggle</function> 431994689c1Smrg </para> 432994689c1Smrg </listitem> 433994689c1Smrg <listitem> 434994689c1Smrg <para> 435994689c1SmrgProcessing application callbacks with <function>notify</function> 436994689c1Smrg </para> 437994689c1Smrg </listitem> 438994689c1Smrg <listitem> 439994689c1Smrg <para> 440994689c1SmrgSwitching the internal border between highlighted 441994689c1Smrgand unhighlighted states with <function>highlight</function> and <function>unhighlight</function> 442994689c1Smrg </para> 443994689c1Smrg </listitem> 444994689c1Smrg</itemizedlist> 445994689c1Smrg 446994689c1Smrg<para> 447994689c1SmrgThe following are the default translation bindings used by the 448994689c1SmrgToggle widget: 449994689c1Smrg</para> 450994689c1Smrg 451994689c1Smrg<literallayout class="monospaced"> 452994689c1Smrg <EnterWindow>: highlight(Always) 453994689c1Smrg <LeaveWindow>: unhighlight() 454994689c1Smrg <Btn1Down>,<Btn1Up>: toggle() notify() 455994689c1Smrg</literallayout> 456994689c1Smrg</sect2> 457994689c1Smrg 458421c997bSmrg<sect2 id='Toggle_Actions_b'> 459421c997bSmrg<title>Toggle Actions</title> 460994689c1Smrg<para> 461994689c1SmrgThe full list of actions supported by Toggle is: 462994689c1Smrg</para> 463994689c1Smrg<variablelist> 464994689c1Smrg <varlistentry> 465994689c1Smrg <term> 466994689c1Smrg <function>highlight</function>(<emphasis remap='I'>condition</emphasis>) 467994689c1Smrg </term> 468994689c1Smrg <listitem> 469994689c1Smrg <para> 470994689c1SmrgDisplays the internal highlight border in the color (<function>foreground</function> 471994689c1Smrgor <function>background</function> ) that contrasts with the interior color of the 472994689c1SmrgToggle widget. The conditions <function>WhenUnset</function> and <function>Always</function> are 473994689c1Smrgunderstood by this action procedure. If no argument is passed then 474994689c1Smrg<function>WhenUnset</function> is assumed. 475994689c1Smrg </para> 476994689c1Smrg </listitem> 477994689c1Smrg </varlistentry> 478994689c1Smrg <varlistentry> 479994689c1Smrg <term> 480994689c1Smrg <function>unhighlight</function>() 481994689c1Smrg </term> 482994689c1Smrg <listitem> 483994689c1Smrg <para> 484994689c1SmrgDisplays the internal highlight border in the color (<function>foreground</function> 485994689c1Smrgor <function>background</function> ) that matches the interior color of the 486994689c1SmrgToggle widget. 487994689c1Smrg </para> 488994689c1Smrg </listitem> 489994689c1Smrg </varlistentry> 490994689c1Smrg <varlistentry> 491994689c1Smrg <term> 492994689c1Smrg <function>set</function>() 493994689c1Smrg </term> 494994689c1Smrg <listitem> 495994689c1Smrg <para> 496994689c1SmrgEnters the <emphasis remap='I'>set</emphasis> state, in which <function>notify</function> is possible. This 497994689c1Smrgaction causes the Toggle widget to display its interior in the 498994689c1Smrg<function>foreground</function> color. The label or bitmap is displayed in the 499994689c1Smrg<function>background</function> color. 500994689c1Smrg </para> 501994689c1Smrg </listitem> 502994689c1Smrg </varlistentry> 503994689c1Smrg <varlistentry> 504994689c1Smrg <term> 505994689c1Smrg <function>unset</function>() 506994689c1Smrg </term> 507994689c1Smrg <listitem> 508994689c1Smrg <para> 509994689c1SmrgCancels the <emphasis remap='I'>set</emphasis> state and displays the interior of the Toggle widget in the 510994689c1Smrg<function>background</function> color. The label or bitmap is displayed in the 511994689c1Smrg<function>foreground</function> color. 512994689c1Smrg </para> 513994689c1Smrg </listitem> 514994689c1Smrg </varlistentry> 515994689c1Smrg <varlistentry> 516994689c1Smrg <term> 517994689c1Smrg <function>toggle</function>() 518994689c1Smrg </term> 519994689c1Smrg <listitem> 520994689c1Smrg <para> 521994689c1SmrgChanges the current state of the Toggle widget, causing to be set 522994689c1Smrgif it was previously unset, and unset if it was previously set. 523994689c1SmrgIf the widget is to be set, and is in a radio group then this procedure may 524994689c1Smrgunset another Toggle widget causing all routines on its callback list 525994689c1Smrgto be invoked. The callback routines for the Toggle that 526994689c1Smrgis to be unset will be called before the one that is to be set. 527994689c1Smrg </para> 528994689c1Smrg </listitem> 529994689c1Smrg </varlistentry> 530994689c1Smrg <varlistentry> 531994689c1Smrg <term> 532994689c1Smrg <function>reset</function>() 533994689c1Smrg </term> 534994689c1Smrg <listitem> 535994689c1Smrg <para> 536994689c1SmrgCancels any <function>set</function> or <function>highlight</function> and displays the interior of the 537994689c1SmrgToggle widget in the <function>background</function> color, with the label displayed in the 538994689c1Smrg<function>foreground</function> color. 539994689c1Smrg </para> 540994689c1Smrg </listitem> 541994689c1Smrg </varlistentry> 542994689c1Smrg <varlistentry> 543994689c1Smrg <term> 544994689c1Smrg <function>notify</function>() 545994689c1Smrg </term> 546994689c1Smrg <listitem> 547994689c1Smrg <para> 548994689c1SmrgWhen the Toggle widget is in the <function>set</function> state this action calls all functions in 549994689c1Smrgthe callback list named by the <function>callback</function> resource. The value of 550994689c1Smrgthe call_data argument in these callback functions is undefined. 551994689c1Smrg </para> 552994689c1Smrg </listitem> 553994689c1Smrg </varlistentry> 554994689c1Smrg</variablelist> 555994689c1Smrg 556994689c1Smrg<para> 557994689c1SmrgWhen a bitmap of depth greater that one (1) is specified the 558994689c1Smrg<emphasis remap='I'>set</emphasis>(), <emphasis remap='I'>unset</emphasis>(), and <emphasis remap='I'>reset</emphasis>() actions have no effect, 559994689c1Smrgsince there are no foreground and background colors used in a 560994689c1Smrgmulti-plane pixmap. 561994689c1Smrg</para> 562994689c1Smrg</sect2> 563994689c1Smrg 564994689c1Smrg<sect2 id="Radio_Groups"> 565994689c1Smrg<title>Radio Groups</title> 566994689c1Smrg<para> 567994689c1SmrgThere are typically two types of radio groups desired by applications. 568994689c1SmrgThe default translations for the Toggle widget implement a "zero or one 5695ec34c4cSmrg<indexterm><primary>Radio groups</primary><secondary>zero or one of many</secondary></indexterm> 570994689c1Smrgof many" radio group. This means that there may be no more than one 571994689c1SmrgToggle widget active, but there need not be any Toggle widgets active. 572994689c1Smrg</para> 573994689c1Smrg 574994689c1Smrg<para> 575994689c1SmrgThe other type of radio group is "one of many" and has the more strict 576994689c1Smrgpolicy that there will always be exactly one radio button active. 577994689c1SmrgToggle widgets can be used to provide this interface with a slight 578994689c1Smrgmodification to the translation table of each Toggle in the group. 579994689c1Smrg</para> 580994689c1Smrg 581994689c1Smrg<literallayout class="monospaced"> 582994689c1Smrg <EnterWindow>: highlight(Always) 583994689c1Smrg <LeaveWindow>: unhighlight() 584994689c1Smrg <Btn1Down>,<Btn1Up>: set() notify() 585994689c1Smrg</literallayout> 586994689c1Smrg 587994689c1Smrg<para> 588994689c1SmrgThis translation table will not allow any Toggle to be <emphasis remap='I'>unset</emphasis> 589994689c1Smrgexcept as a result of another Toggle becoming <emphasis remap='I'>set</emphasis>. It is 590994689c1Smrgthe application programmer's responsibility to choose an initial 591994689c1Smrgstate for the radio group by setting the <function>state</function> resource of one of 592994689c1Smrgits member widgets to <function>True</function>. 593994689c1Smrg</para> 594994689c1Smrg</sect2> 595994689c1Smrg 596421c997bSmrg<sect2 id='Toggle::Convenience_Routines'> 597994689c1Smrg<title>Convenience Routines</title> 598994689c1Smrg<para> 599994689c1SmrgThe following functions allow easy access to the Toggle widget's radio 600994689c1Smrggroup functionality. 601994689c1Smrg</para> 602994689c1Smrg 603421c997bSmrg<sect3 id='Changing_the_Toggles_Radio_Group'> 604994689c1Smrg<title>Changing the Toggle's Radio Group.</title> 605994689c1Smrg<para> 606994689c1SmrgTo enable an application to change the Toggle's radio group, add 607994689c1Smrgthe Toggle to a radio group, or remove the Toggle from a radio group, use 608421c997bSmrg<xref linkend='XawToggleChangeRadioGroup' xrefstyle='select: title'/>. 609994689c1Smrg</para> 610994689c1Smrg 611421c997bSmrg<funcsynopsis id='XawToggleChangeRadioGroup'> 612994689c1Smrg<funcprototype> 613994689c1Smrg <funcdef>void<function> XawToggleChangeRadioGroup</function></funcdef> 614994689c1Smrg <paramdef>Widgetw,<parameter> radio_group</parameter></paramdef> 615994689c1Smrg</funcprototype> 616994689c1Smrg</funcsynopsis> 617994689c1Smrg 618994689c1Smrg<para> 619994689c1Smrg<variablelist> 620994689c1Smrg <varlistentry> 621994689c1Smrg <term> 622994689c1Smrg <emphasis remap='I'>w</emphasis> 623994689c1Smrg </term> 624994689c1Smrg <listitem> 625994689c1Smrg <para> 626994689c1SmrgSpecifies the Toggle widget. 627994689c1Smrg </para> 628994689c1Smrg </listitem> 629994689c1Smrg </varlistentry> 630994689c1Smrg <varlistentry> 631994689c1Smrg <term> 632994689c1Smrg <emphasis remap='I'>radio_group</emphasis> 633994689c1Smrg </term> 634994689c1Smrg <listitem> 635994689c1Smrg <para> 636994689c1SmrgSpecifies any Toggle in the new radio group. If NULL then the Toggle 637994689c1Smrgwill be removed from any radio group of which it is a member. 638994689c1Smrg </para> 639994689c1Smrg </listitem> 640994689c1Smrg </varlistentry> 641994689c1Smrg</variablelist> 642994689c1Smrg</para> 643994689c1Smrg 644994689c1Smrg<para> 645994689c1SmrgIf a Toggle is already <emphasis remap='I'>set</emphasis> in the new radio group, 646994689c1Smrgand the Toggle to be added is also <emphasis remap='I'>set</emphasis> then the previously 647994689c1Smrg<emphasis remap='I'>set</emphasis> Toggle in the radio group is <emphasis remap='I'>unset</emphasis> and its callback 648994689c1Smrgprocedures are invoked. 649994689c1SmrgFinding the Currently selected Toggle in a radio group of Toggles 650994689c1Smrg</para> 651994689c1Smrg 652994689c1Smrg<para> 653994689c1SmrgTo find the currently selected Toggle in a radio group of Toggle widgets 654421c997bSmrguse <xref linkend='XawToggleGetCurrent' xrefstyle='select: title'/>. 655994689c1Smrg</para> 656994689c1Smrg 657421c997bSmrg<funcsynopsis id='XawToggleGetCurrent'> 658994689c1Smrg<funcprototype> 659994689c1Smrg <funcdef>XtPointer<function> XawToggleGetCurrent</function></funcdef> 660994689c1Smrg <paramdef>XtPointer<parameter> XawToggleGetCurrent(radio_group)</parameter></paramdef> 661994689c1Smrg <paramdef>Widget<parameter> radio_group</parameter></paramdef> 662994689c1Smrg</funcprototype> 663994689c1Smrg</funcsynopsis> 664994689c1Smrg 665994689c1Smrg<variablelist> 666994689c1Smrg <varlistentry> 667994689c1Smrg <term> 668994689c1Smrg <emphasis remap='I'>radio_group</emphasis> 669994689c1Smrg </term> 670994689c1Smrg <listitem> 671994689c1Smrg <para> 672994689c1SmrgSpecifies any Toggle widget in the radio group. 673994689c1Smrg </para> 674994689c1Smrg </listitem> 675994689c1Smrg </varlistentry> 676994689c1Smrg</variablelist> 677994689c1Smrg 678994689c1Smrg<para> 679994689c1SmrgThe value returned by this function is the 680994689c1Smrg<function>radioData</function> 681994689c1Smrgof the Toggle in this radio group that is currently set. The default 682994689c1Smrgvalue for <function>radioData</function> 683994689c1Smrgis the name of that Toggle widget. If no Toggle is set in the radio 684994689c1Smrggroup specified then NULL is returned. 685994689c1SmrgChanging the Toggle that is set in a radio group. 686994689c1Smrg</para> 687994689c1Smrg 688994689c1Smrg<para> 689994689c1SmrgTo change the Toggle that is currently set in a radio group use 690421c997bSmrg<xref linkend='XawToggleSetCurrent' xrefstyle='select: title'/>. 691994689c1Smrg</para> 692994689c1Smrg 693421c997bSmrg<funcsynopsis id='XawToggleSetCurrent'> 694994689c1Smrg<funcprototype> 695994689c1Smrg <funcdef>void<function> XawToggleSetCurrent</function></funcdef> 696994689c1Smrg <paramdef>voidXawToggleSetCurrent(radio_group,<parameter> radio_data)</parameter></paramdef> 697994689c1Smrg <paramdef>Widget<parameter> radio_group</parameter></paramdef> 698994689c1Smrg <paramdef>XtPointer<parameter> radio_data</parameter></paramdef> 699994689c1Smrg</funcprototype> 700994689c1Smrg</funcsynopsis> 701994689c1Smrg 702994689c1Smrg<variablelist> 703994689c1Smrg <varlistentry> 704994689c1Smrg <term> 705994689c1Smrg <emphasis remap='I'>radio_group</emphasis> 706994689c1Smrg </term> 707994689c1Smrg <listitem> 708994689c1Smrg <para> 709994689c1SmrgSpecifies any Toggle widget in the radio group. 710994689c1Smrg </para> 711994689c1Smrg </listitem> 712994689c1Smrg </varlistentry> 713994689c1Smrg <varlistentry> 714994689c1Smrg <term> 715994689c1Smrg <emphasis remap='I'>radio_data</emphasis> 716994689c1Smrg </term> 717994689c1Smrg <listitem> 718994689c1Smrg <para> 719994689c1SmrgSpecifies the 720994689c1Smrg<function>radioData</function> 721994689c1Smrgidentifying the Toggle that should be set in the radio group specified 722994689c1Smrgby the <emphasis remap='I'>radio_group</emphasis> argument. 723994689c1Smrg </para> 724994689c1Smrg </listitem> 725994689c1Smrg </varlistentry> 726994689c1Smrg</variablelist> 727994689c1Smrg 728994689c1Smrg 729994689c1Smrg<para> 730421c997bSmrg<xref linkend='XawToggleSetCurrent' xrefstyle='select: title'/> locates the Toggle widget to be set by 731994689c1Smrgmatching <emphasis remap='I'>radio_data</emphasis> against the <function>radioData</function> for each Toggle in 732421c997bSmrgthe radio group. If none match, <xref linkend='XawToggleSetCurrent' xrefstyle='select: title'/> returns 733994689c1Smrgwithout making any changes. If more than one Toggle matches, 734421c997bSmrg<xref linkend='XawToggleSetCurrent' xrefstyle='select: title'/> will choose a Toggle to set arbitrarily. If 735994689c1Smrgthis causes any Toggle widgets to change state, all routines in their 736994689c1Smrgcallback lists will be invoked. The callback routines for a Toggle that 737994689c1Smrgis to be unset will be called before the one that is to be set. 738994689c1SmrgUnsetting all Toggles in a radio group. 739994689c1Smrg</para> 740994689c1Smrg 741994689c1Smrg<para> 742994689c1SmrgTo unset all Toggle widgets in a radio group use 743421c997bSmrg<xref linkend='XawToggleUnsetCurrent' xrefstyle='select: title'/>. 744994689c1Smrg</para> 745994689c1Smrg 746421c997bSmrg<funcsynopsis id='XawToggleUnsetCurrent'> 747994689c1Smrg<funcprototype> 748994689c1Smrg <funcdef>void<function> XawToggleUnsetCurrent</function></funcdef> 749994689c1Smrg <paramdef>void<parameter> XawToggleUnsetCurrent(radio_group)</parameter></paramdef> 750994689c1Smrg <paramdef>Widget<parameter> radio_group</parameter></paramdef> 751994689c1Smrg</funcprototype> 752994689c1Smrg</funcsynopsis> 753994689c1Smrg 754994689c1Smrg<variablelist> 755994689c1Smrg <varlistentry> 756994689c1Smrg <term> 757994689c1Smrg <emphasis remap='I'>radio_group</emphasis> 758994689c1Smrg </term> 759994689c1Smrg <listitem> 760994689c1Smrg <para> 761994689c1SmrgSpecifies any Toggle widget in the radio group. 762994689c1Smrg </para> 763994689c1Smrg </listitem> 764994689c1Smrg </varlistentry> 765994689c1Smrg</variablelist> 766994689c1Smrg 767994689c1Smrg<para> 768994689c1SmrgIf this causes a Toggle widget to change state, all routines on its 769994689c1Smrgcallback list will be invoked. 770994689c1Smrg</para> 771994689c1Smrg</sect3> 772994689c1Smrg</sect2> 773994689c1Smrg</sect1> 774