1994689c1Smrg<sect1 id="Scrollbar_Widget"> 2994689c1Smrg<title>Scrollbar Widget</title> 3994689c1Smrg 4994689c1Smrg<literallayout class="monospaced"> 5994689c1SmrgApplication header file <X11/Xaw/Scrollbar.h> 6994689c1SmrgClass header file <X11/Xaw/ScrollbarP.h> 7994689c1SmrgClass scrollbarWidgetClass 8994689c1SmrgClass Name Scrollbar 9994689c1SmrgSuperclass Simple 10994689c1Smrg</literallayout> 11994689c1Smrg 12994689c1Smrg<para> 135ec34c4cSmrgA Scrollbar widget is a rectangle, called the <quote>canvas,</quote> on 145ec34c4cSmrgwhich another rectangle, the <quote>thumb,</quote> moves in one 15994689c1Smrgdimension, either vertically or horizontally. A Scrollbar 16994689c1Smrgcan be used alone, as a value generator, or it can be used 17994689c1Smrgwithin a composite widget (for example, a Viewport). When a 185ec34c4cSmrgScrollbar is used to move, or <quote>scroll,</quote> the contents of 19994689c1Smrganother widget, the size and the position of the thumb usually give 20994689c1Smrgfeedback as to what portion of the other widget's contents 21994689c1Smrgare visible. 22994689c1Smrg</para> 23994689c1Smrg 24994689c1Smrg<para> 25994689c1SmrgEach pointer button invokes a specific action. Pointer 26994689c1Smrgbuttons 1 and 3 do not move the thumb automatically. 27994689c1SmrgInstead, they return the pixel position of the cursor on the 28994689c1Smrgscroll region. When pointer button 2 is clicked, the thumb 29994689c1Smrgmoves to the current pointer position. When pointer button 30994689c1Smrg2 is held down and the pointer is moved, the thumb follows 31994689c1Smrgthe pointer. 32994689c1Smrg</para> 33994689c1Smrg 34994689c1Smrg<para> 35994689c1SmrgThe pointer cursor in the scroll region changes depending on the current 36994689c1Smrgaction. When no pointer button is pressed, the cursor appears as a 37994689c1Smrgdouble-headed arrow that points in the direction that scrolling can 38994689c1Smrgoccur. When pointer button 1 or 3 is pressed, the cursor appears as a 39994689c1Smrgsingle-headed arrow that points in the logical direction that the thumb 40994689c1Smrgwill move. When pointer button 2 is pressed, the cursor 41994689c1Smrgappears as an arrow that points to the top or the left of the thumb. 42994689c1Smrg</para> 43994689c1Smrg 44994689c1Smrg<para> 45994689c1SmrgWhen the user scrolls, the application receives notification 46994689c1Smrgthrough callback procedures. For both discrete scrolling actions, the 47994689c1Smrgcallback returns the Scrollbar widget, the client_data, and the pixel 48994689c1Smrgposition of the pointer when the button was released. For continuous 49994689c1Smrgscrolling, the callback routine returns the scroll bar widget, the 50994689c1Smrgclient data, and the current relative position of the thumb. When the 51994689c1Smrgthumb is moved using pointer button 2, the callback procedure is invoked 52994689c1Smrgcontinuously. When either button 1 or 3 is pressed, the callback 53994689c1Smrgprocedure is invoked only when the button is released and the client 54994689c1Smrgcallback procedure is responsible for moving the thumb. 55994689c1Smrg</para> 56994689c1Smrg 57421c997bSmrg<sect2 id='Scrollbar::Resources'> 58994689c1Smrg<title>Resources</title> 59994689c1Smrg 60994689c1Smrg<para> 61994689c1SmrgWhen creating a Scrollbar widget instance, the following resources are 62994689c1Smrgretrieved from the argument list or from the resource database: 63994689c1Smrg</para> 64994689c1Smrg 65994689c1Smrg<informaltable> 66994689c1Smrg <tgroup cols='5' align='center'> 67994689c1Smrg <colspec colname='c1'/> 68994689c1Smrg <colspec colname='c2'/> 69994689c1Smrg <colspec colname='c3'/> 70994689c1Smrg <colspec colname='c4'/> 71994689c1Smrg <colspec colname='c5'/> 72994689c1Smrg <thead> 73994689c1Smrg <row> 74994689c1Smrg <entry>Name</entry> 75994689c1Smrg <entry>Class</entry> 76994689c1Smrg <entry>Type</entry> 77994689c1Smrg <entry>Notes</entry> 78994689c1Smrg <entry>Default Value</entry> 79994689c1Smrg </row> 80994689c1Smrg </thead> 81994689c1Smrg <tbody> 82994689c1Smrg <row> 83994689c1Smrg <entry>accelerators</entry> 84994689c1Smrg <entry>Accelerators</entry> 85994689c1Smrg <entry>AcceleratorTable</entry> 86994689c1Smrg <entry></entry> 87994689c1Smrg <entry>NULL</entry> 88994689c1Smrg </row> 89994689c1Smrg <row> 90994689c1Smrg <entry>ancestorSensitive</entry> 91994689c1Smrg <entry>AncestorSensitive</entry> 92994689c1Smrg <entry>Boolean</entry> 93994689c1Smrg <entry>D</entry> 94994689c1Smrg <entry>True</entry> 95994689c1Smrg </row> 96994689c1Smrg <row> 97994689c1Smrg <entry>background</entry> 98994689c1Smrg <entry>Background</entry> 99994689c1Smrg <entry>Pixel</entry> 100994689c1Smrg <entry></entry> 101994689c1Smrg <entry>XtDefaultBackground</entry> 102994689c1Smrg </row> 103994689c1Smrg <row> 104994689c1Smrg <entry>backgroundPixmap</entry> 105994689c1Smrg <entry>Pixmap</entry> 106994689c1Smrg <entry>Pixmap</entry> 107994689c1Smrg <entry></entry> 108994689c1Smrg <entry>XtUnspecifiedPixmap</entry> 109994689c1Smrg </row> 110994689c1Smrg <row> 111994689c1Smrg <entry>borderColor</entry> 112994689c1Smrg <entry>BorderColor</entry> 113994689c1Smrg <entry>Pixel</entry> 114994689c1Smrg <entry></entry> 115994689c1Smrg <entry>XtDefaultForeground</entry> 116994689c1Smrg </row> 117994689c1Smrg <row> 118994689c1Smrg <entry>borderPixmap</entry> 119994689c1Smrg <entry>Pixmap</entry> 120994689c1Smrg <entry>Pixmap</entry> 121994689c1Smrg <entry></entry> 122994689c1Smrg <entry>XtUnspecifiedPixmap</entry> 123994689c1Smrg </row> 124994689c1Smrg <row> 125994689c1Smrg <entry>borderWidth</entry> 126994689c1Smrg <entry>BorderWidth</entry> 127994689c1Smrg <entry>Dimension</entry> 128994689c1Smrg <entry></entry> 129994689c1Smrg <entry>1</entry> 130994689c1Smrg </row> 131994689c1Smrg <row> 132994689c1Smrg <entry>colormap</entry> 133994689c1Smrg <entry>Colormap</entry> 134994689c1Smrg <entry>Colormap</entry> 135994689c1Smrg <entry></entry> 136994689c1Smrg <entry>parent's Colormap</entry> 137994689c1Smrg </row> 138994689c1Smrg <row> 139994689c1Smrg <entry>cursor</entry> 140994689c1Smrg <entry>Cursor</entry> 141994689c1Smrg <entry>Cursor</entry> 142994689c1Smrg <entry></entry> 143994689c1Smrg <entry>None</entry> 144994689c1Smrg </row> 145994689c1Smrg <row> 146994689c1Smrg <entry>cursorName</entry> 147994689c1Smrg <entry>Cursor</entry> 148994689c1Smrg <entry>String</entry> 149994689c1Smrg <entry></entry> 150994689c1Smrg <entry>NULL</entry> 151994689c1Smrg </row> 152994689c1Smrg <row> 153994689c1Smrg <entry>depth</entry> 154994689c1Smrg <entry>Depth</entry> 155994689c1Smrg <entry>int</entry> 156994689c1Smrg <entry>C</entry> 157994689c1Smrg <entry>parent's Depth</entry> 158994689c1Smrg </row> 159994689c1Smrg <row> 160994689c1Smrg <entry>destroyCallback</entry> 161994689c1Smrg <entry>Callback</entry> 162994689c1Smrg <entry>XtCallbackList</entry> 163994689c1Smrg <entry></entry> 164994689c1Smrg <entry>NULL</entry> 165994689c1Smrg </row> 166994689c1Smrg <row> 167994689c1Smrg <entry>foreground</entry> 168994689c1Smrg <entry>Foreground</entry> 169994689c1Smrg <entry>Pixel</entry> 170994689c1Smrg <entry></entry> 171994689c1Smrg <entry>XtDefaultForeground</entry> 172994689c1Smrg </row> 173994689c1Smrg <row> 174994689c1Smrg <entry>height</entry> 175994689c1Smrg <entry>Height</entry> 176994689c1Smrg <entry>Dimension</entry> 177994689c1Smrg <entry>A</entry> 178994689c1Smrg <entry>depends on orientation</entry> 179994689c1Smrg </row> 180994689c1Smrg <row> 181994689c1Smrg <entry>insensitiveBorder</entry> 182994689c1Smrg <entry>Insensitive</entry> 183994689c1Smrg <entry>Pixmap</entry> 184994689c1Smrg <entry></entry> 185994689c1Smrg <entry>GreyPixmap</entry> 186994689c1Smrg </row> 187994689c1Smrg <row> 188994689c1Smrg <entry>international</entry> 189994689c1Smrg <entry>International</entry> 190994689c1Smrg <entry>Boolean</entry> 191994689c1Smrg <entry>C</entry> 192994689c1Smrg <entry>False</entry> 193994689c1Smrg </row> 194994689c1Smrg <row> 195994689c1Smrg <entry>jumpProc</entry> 196994689c1Smrg <entry>Callback</entry> 197994689c1Smrg <entry>XtCallbackList</entry> 198994689c1Smrg <entry></entry> 199994689c1Smrg <entry>NULL</entry> 200994689c1Smrg </row> 201994689c1Smrg <row> 202994689c1Smrg <entry>length</entry> 203994689c1Smrg <entry>Length</entry> 204994689c1Smrg <entry>Dimension</entry> 205994689c1Smrg <entry></entry> 206994689c1Smrg <entry>1</entry> 207994689c1Smrg </row> 208994689c1Smrg <row> 209994689c1Smrg <entry>mappedWhenManaged</entry> 210994689c1Smrg <entry>MappedWhenManaged</entry> 211994689c1Smrg <entry>Boolean</entry> 212994689c1Smrg <entry></entry> 213994689c1Smrg <entry>True</entry> 214994689c1Smrg </row> 215994689c1Smrg <row> 216994689c1Smrg <entry>minimumThumb</entry> 217994689c1Smrg <entry>MinimumThumb</entry> 218994689c1Smrg <entry>Dimension</entry> 219994689c1Smrg <entry></entry> 220994689c1Smrg <entry>7</entry> 221994689c1Smrg </row> 222994689c1Smrg <row> 223994689c1Smrg <entry>orientation</entry> 224994689c1Smrg <entry>Orientation</entry> 225994689c1Smrg <entry>Orientation</entry> 226994689c1Smrg <entry></entry> 227994689c1Smrg <entry>XtorientVertical (vertical)</entry> 228994689c1Smrg </row> 229994689c1Smrg <row> 230994689c1Smrg <entry>pointerColor</entry> 231994689c1Smrg <entry>Foreground</entry> 232994689c1Smrg <entry>Pixel</entry> 233994689c1Smrg <entry></entry> 234994689c1Smrg <entry>XtDefaultForeground</entry> 235994689c1Smrg </row> 236994689c1Smrg <row> 237994689c1Smrg <entry>pointerColorBackground</entry> 238994689c1Smrg <entry>Background</entry> 239994689c1Smrg <entry>Pixel</entry> 240994689c1Smrg <entry></entry> 241994689c1Smrg <entry>XtDefaultBackground</entry> 242994689c1Smrg </row> 243994689c1Smrg <row> 244994689c1Smrg <entry>screen</entry> 245994689c1Smrg <entry>Screen</entry> 246994689c1Smrg <entry>Screen</entry> 247994689c1Smrg <entry>R</entry> 248994689c1Smrg <entry>parent's Screen</entry> 249994689c1Smrg </row> 250994689c1Smrg <row> 251994689c1Smrg <entry>scrollDCursor</entry> 252994689c1Smrg <entry>Cursor</entry> 253994689c1Smrg <entry>Cursor</entry> 254994689c1Smrg <entry></entry> 255994689c1Smrg <entry>XC_sb_down_arrow</entry> 256994689c1Smrg </row> 257994689c1Smrg <row> 258994689c1Smrg <entry>scrollHCursor</entry> 259994689c1Smrg <entry>Cursor</entry> 260994689c1Smrg <entry>Cursor</entry> 261994689c1Smrg <entry></entry> 262994689c1Smrg <entry>XC_sb_h_double_arrow</entry> 263994689c1Smrg </row> 264994689c1Smrg <row> 265994689c1Smrg <entry>scrollLCursor</entry> 266994689c1Smrg <entry>Cursor</entry> 267994689c1Smrg <entry>Cursor</entry> 268994689c1Smrg <entry></entry> 269994689c1Smrg <entry>XC_sb_left_arrow</entry> 270994689c1Smrg </row> 271994689c1Smrg <row> 272994689c1Smrg <entry>scrollProc</entry> 273994689c1Smrg <entry>Callback</entry> 274994689c1Smrg <entry>XtCallbackList</entry> 275994689c1Smrg <entry></entry> 276994689c1Smrg <entry>NULL</entry> 277994689c1Smrg </row> 278994689c1Smrg <row> 279994689c1Smrg <entry>scrollRCursor</entry> 280994689c1Smrg <entry>Cursor</entry> 281994689c1Smrg <entry>Cursor</entry> 282994689c1Smrg <entry></entry> 283994689c1Smrg <entry>XC_sb_right_arrow</entry> 284994689c1Smrg </row> 285994689c1Smrg <row> 286994689c1Smrg <entry>scrollUCursor</entry> 287994689c1Smrg <entry>Cursor</entry> 288994689c1Smrg <entry>Cursor</entry> 289994689c1Smrg <entry></entry> 290994689c1Smrg <entry>XC_sb_up_arrow</entry> 291994689c1Smrg </row> 292994689c1Smrg <row> 293994689c1Smrg <entry>scrollVCursor</entry> 294994689c1Smrg <entry>Cursor</entry> 295994689c1Smrg <entry>Cursor</entry> 296994689c1Smrg <entry></entry> 297994689c1Smrg <entry>XC_sb_v_arrow</entry> 298994689c1Smrg </row> 299994689c1Smrg <row> 300994689c1Smrg <entry>sensitive</entry> 301994689c1Smrg <entry>Sensitive</entry> 302994689c1Smrg <entry>Boolean</entry> 303994689c1Smrg <entry></entry> 304994689c1Smrg <entry>True</entry> 305994689c1Smrg </row> 306994689c1Smrg <row> 307994689c1Smrg <entry>shown</entry> 308994689c1Smrg <entry>Shown</entry> 309994689c1Smrg <entry>Float</entry> 310994689c1Smrg <entry></entry> 311994689c1Smrg <entry>0.0</entry> 312994689c1Smrg </row> 313994689c1Smrg <row> 314994689c1Smrg <entry>thickness</entry> 315994689c1Smrg <entry>Thickness</entry> 316994689c1Smrg <entry>Dimension</entry> 317994689c1Smrg <entry></entry> 318994689c1Smrg <entry>14</entry> 319994689c1Smrg </row> 320994689c1Smrg <row> 321994689c1Smrg <entry>thumb</entry> 322994689c1Smrg <entry>Thumb</entry> 323994689c1Smrg <entry>Bitmap</entry> 324994689c1Smrg <entry></entry> 325994689c1Smrg <entry>GreyPixmap</entry> 326994689c1Smrg </row> 327994689c1Smrg <row> 328994689c1Smrg <entry>thumbProc</entry> 329994689c1Smrg <entry>Callback</entry> 330994689c1Smrg <entry>XtCallbackList</entry> 331994689c1Smrg <entry></entry> 332994689c1Smrg <entry>NULL</entry> 333994689c1Smrg </row> 334994689c1Smrg <row> 335994689c1Smrg <entry>topOfThumb</entry> 336994689c1Smrg <entry>TopOfThumb</entry> 337994689c1Smrg <entry>Float</entry> 338994689c1Smrg <entry></entry> 339994689c1Smrg <entry>0.0</entry> 340994689c1Smrg </row> 341994689c1Smrg <row> 342994689c1Smrg <entry>translations</entry> 343994689c1Smrg <entry>Translations</entry> 344994689c1Smrg <entry>TranslationTable</entry> 345994689c1Smrg <entry></entry> 346994689c1Smrg <entry>See below</entry> 347994689c1Smrg </row> 348994689c1Smrg <row> 349994689c1Smrg <entry>width</entry> 350994689c1Smrg <entry>Width</entry> 351994689c1Smrg <entry>Dimension</entry> 352994689c1Smrg <entry>A</entry> 353994689c1Smrg <entry>depends on orientation</entry> 354994689c1Smrg </row> 355994689c1Smrg <row> 356994689c1Smrg <entry>x</entry> 357994689c1Smrg <entry>Position</entry> 358994689c1Smrg <entry>Position</entry> 359994689c1Smrg <entry></entry> 360994689c1Smrg <entry>0</entry> 361994689c1Smrg </row> 362994689c1Smrg <row> 363994689c1Smrg <entry>y</entry> 364994689c1Smrg <entry>Position</entry> 365994689c1Smrg <entry>Position</entry> 366994689c1Smrg <entry></entry> 367994689c1Smrg <entry>0</entry> 368994689c1Smrg </row> 369994689c1Smrg </tbody> 370994689c1Smrg </tgroup> 371994689c1Smrg</informaltable> 372994689c1Smrg 373994689c1Smrg<variablelist> 374994689c1Smrg <varlistentry> 375994689c1Smrg <term> 376994689c1Smrg <function>foreground</function> 377994689c1Smrg </term> 378994689c1Smrg <listitem> 379994689c1Smrg <para> 380994689c1SmrgA pixel value which indexes the widget's colormap to derive the color 381994689c1Smrgused to draw the thumb. 382994689c1Smrg </para> 383994689c1Smrg </listitem> 384994689c1Smrg </varlistentry> 385994689c1Smrg <varlistentry> 386994689c1Smrg <term> 387994689c1Smrg <function>jumpProc</function> 388994689c1Smrg </term> 389994689c1Smrg <listitem> 390994689c1Smrg <para> 391994689c1SmrgAll functions on this callback list are called when the 3925ec34c4cSmrg<function>NotifyThumb</function> action is invoked. See 3935ec34c4cSmrg<xref linkend="Scrollbar_Actions" /> for details. 394994689c1Smrg </para> 395994689c1Smrg </listitem> 396994689c1Smrg </varlistentry> 397994689c1Smrg <varlistentry> 398994689c1Smrg <term> 399994689c1Smrg <function>length</function> 400994689c1Smrg </term> 401994689c1Smrg <listitem> 402994689c1Smrg <para> 403994689c1SmrgThe height of a vertical scrollbar or the width of a horizontal scrollbar. 404994689c1Smrg </para> 405994689c1Smrg </listitem> 406994689c1Smrg </varlistentry> 407994689c1Smrg <varlistentry> 408994689c1Smrg <term> 409994689c1Smrg <function>minimumThumb</function> 410994689c1Smrg </term> 411994689c1Smrg <listitem> 412994689c1Smrg <para> 413994689c1SmrgThe smallest size, in pixels, to which the thumb can shrink. 414994689c1Smrg </para> 415994689c1Smrg </listitem> 416994689c1Smrg </varlistentry> 417994689c1Smrg <varlistentry> 418994689c1Smrg <term> 419994689c1Smrg <function>orientation</function> 420994689c1Smrg </term> 421994689c1Smrg <listitem> 422994689c1Smrg <para> 423994689c1SmrgThe orientation is the direction that the thumb will be allowed to move. 424994689c1SmrgThis value can be either <function>XtorientVertical</function> or 425994689c1Smrg<function>XtorientHorizontal</function>. 426994689c1Smrg </para> 427994689c1Smrg </listitem> 428994689c1Smrg </varlistentry> 429994689c1Smrg <varlistentry> 430994689c1Smrg <term> 431994689c1Smrg <function>scrollDCursor</function> 432994689c1Smrg </term> 433994689c1Smrg <listitem> 434994689c1Smrg <para> 435994689c1SmrgThis cursor is used when scrolling backward in a vertical scrollbar. 436994689c1Smrg </para> 437994689c1Smrg </listitem> 438994689c1Smrg </varlistentry> 439994689c1Smrg <varlistentry> 440994689c1Smrg <term> 441994689c1Smrg <function>scrollHCursor</function> 442994689c1Smrg </term> 443994689c1Smrg <listitem> 444994689c1Smrg <para> 445994689c1SmrgThis cursor is used when a horizontal scrollbar is inactive. 446994689c1Smrg </para> 447994689c1Smrg </listitem> 448994689c1Smrg </varlistentry> 449994689c1Smrg <varlistentry> 450994689c1Smrg <term> 451994689c1Smrg <function>scrollLCursor</function> 452994689c1Smrg </term> 453994689c1Smrg <listitem> 454994689c1Smrg <para> 455994689c1SmrgThis cursor is used when scrolling forward in a horizontal scrollbar. 456994689c1Smrg </para> 457994689c1Smrg </listitem> 458994689c1Smrg </varlistentry> 459994689c1Smrg <varlistentry> 460994689c1Smrg <term> 461994689c1Smrg <function>scrollProc</function> 462994689c1Smrg </term> 463994689c1Smrg <listitem> 464994689c1Smrg <para> 465994689c1SmrgAll functions on this callback list may be called when the 4665ec34c4cSmrg<function>NotifyScroll</function> action is invoked. See 4675ec34c4cSmrg<xref linkend="Scrollbar_Actions" /> for details. 468994689c1Smrg </para> 469994689c1Smrg </listitem> 470994689c1Smrg </varlistentry> 471994689c1Smrg <varlistentry> 472994689c1Smrg <term> 473994689c1Smrg <function>scrollRCursor</function> 474994689c1Smrg </term> 475994689c1Smrg <listitem> 476994689c1Smrg <para> 477994689c1SmrgThis cursor is used when scrolling backward in a horizontal scrollbar, 478994689c1Smrgor when thumbing a vertical scrollbar. 479994689c1Smrg </para> 480994689c1Smrg </listitem> 481994689c1Smrg </varlistentry> 482994689c1Smrg <varlistentry> 483994689c1Smrg <term> 484994689c1Smrg <function>scrollUCursor</function> 485994689c1Smrg </term> 486994689c1Smrg <listitem> 487994689c1Smrg <para> 488994689c1SmrgThis cursor is used when scrolling forward in a vertical scrollbar, or when 489994689c1Smrgthumbing a horizontal scrollbar. 490994689c1Smrg </para> 491994689c1Smrg </listitem> 492994689c1Smrg </varlistentry> 493994689c1Smrg <varlistentry> 494994689c1Smrg <term> 495994689c1Smrg <function>scrollVCursor</function> 496994689c1Smrg </term> 497994689c1Smrg <listitem> 498994689c1Smrg <para> 499994689c1SmrgThis cursor is used when a vertical scrollbar is inactive. 500994689c1Smrg<!-- .Se --> 501994689c1Smrg </para> 502994689c1Smrg </listitem> 503994689c1Smrg </varlistentry> 504994689c1Smrg <varlistentry> 505994689c1Smrg <term> 506994689c1Smrg <function>shown</function> 507994689c1Smrg </term> 508994689c1Smrg <listitem> 509994689c1Smrg <para> 510994689c1SmrgThis is the size of the thumb, expressed as a percentage (0.0 - 1.0) 511994689c1Smrgof the length of the scrollbar. 512994689c1Smrg </para> 513994689c1Smrg </listitem> 514994689c1Smrg </varlistentry> 515994689c1Smrg <varlistentry> 516994689c1Smrg <term> 517994689c1Smrg <function>thickness</function> 518994689c1Smrg </term> 519994689c1Smrg <listitem> 520994689c1Smrg <para> 521994689c1SmrgThe width of a vertical scrollbar or the height of a horizontal scrollbar. 522994689c1Smrg </para> 523994689c1Smrg </listitem> 524994689c1Smrg </varlistentry> 525994689c1Smrg <varlistentry> 526994689c1Smrg <term> 527994689c1Smrg <function>thumb</function> 528994689c1Smrg </term> 529994689c1Smrg <listitem> 530994689c1Smrg <para> 531994689c1SmrgThis pixmap is used to tile (or stipple) the thumb of the scrollbar. If 532994689c1Smrgno tiling is desired, then set this resource to <function>None</function>. This 533994689c1Smrgresource will accept either a bitmap or a pixmap that is the same depth 534994689c1Smrgas the window. The resource converter for this resource constructs 535994689c1Smrgbitmaps from the contents of files. (See <function>Converting Bitmaps</function> for 536994689c1Smrgdetails.) 537994689c1Smrg </para> 538994689c1Smrg </listitem> 539994689c1Smrg </varlistentry> 540994689c1Smrg <varlistentry> 541994689c1Smrg <term> 542994689c1Smrg <function>topOfThumb</function> 543994689c1Smrg </term> 544994689c1Smrg <listitem> 545994689c1Smrg <para> 546994689c1SmrgThe location of the top of the thumb, as a percentage (0.0 - 1.0) 547994689c1Smrgof the length of the scrollbar. This resource was called <function>top</function> in 548994689c1Smrgprevious versions of the Athena widget set. The name collided with the 549994689c1Smrga Form widget constraint resource, and had to be changed. 550994689c1Smrg </para> 551994689c1Smrg </listitem> 552994689c1Smrg </varlistentry> 553994689c1Smrg</variablelist> 554994689c1Smrg 555994689c1Smrg</sect2> 556994689c1Smrg 557994689c1Smrg<sect2 id="Scrollbar_Actions"> 558994689c1Smrg<title>Scrollbar Actions</title> 559994689c1Smrg<para> 560994689c1Smrg<!-- .LP --> 561994689c1SmrgThe actions supported by the Scrollbar widget are: 562994689c1Smrg</para> 563994689c1Smrg<variablelist> 564994689c1Smrg <varlistentry> 565994689c1Smrg <term> 566994689c1Smrg <function>StartScroll</function>(<emphasis remap='I'>value</emphasis>) 567994689c1Smrg </term> 568994689c1Smrg <listitem> 569994689c1Smrg <para> 570994689c1SmrgThe possible <emphasis remap='I'>values</emphasis> are Forward, Backward, or Continuous. 571994689c1SmrgThis must be the first action to begin a new movement. 572994689c1Smrg </para> 573994689c1Smrg </listitem> 574994689c1Smrg </varlistentry> 575994689c1Smrg <varlistentry> 576994689c1Smrg <term> 577994689c1Smrg <function>NotifyScroll</function>(<emphasis remap='I'>value</emphasis>) 578994689c1Smrg </term> 579994689c1Smrg <listitem> 580994689c1Smrg <para> 581994689c1SmrgThe possible <emphasis remap='I'>values</emphasis> are Proportional or FullLength. If the 582994689c1Smrgargument to StartScroll was Forward or Backward, NotifyScroll executes 583994689c1Smrgthe <function>scrollProc</function> callbacks and passes either; the position of the 584994689c1Smrgpointer, if <emphasis remap='I'>value</emphasis> is Proportional, or the full length of the 585994689c1Smrgscroll bar, if <emphasis remap='I'>value</emphasis> is FullLength. If the argument to 586994689c1SmrgStartScroll was Continuous, NotifyScroll returns without executing any 587994689c1Smrgcallbacks. 588994689c1Smrg </para> 589994689c1Smrg </listitem> 590994689c1Smrg </varlistentry> 591994689c1Smrg <varlistentry> 592994689c1Smrg <term> 5935ec34c4cSmrg <function>EndScroll</function>( ) 594994689c1Smrg </term> 595994689c1Smrg <listitem> 596994689c1Smrg <para> 597994689c1SmrgThis must be the last action after a movement is complete. 598994689c1Smrg </para> 599994689c1Smrg </listitem> 600994689c1Smrg </varlistentry> 601994689c1Smrg <varlistentry> 602994689c1Smrg <term> 6035ec34c4cSmrg <function>MoveThumb</function>( ) 604994689c1Smrg </term> 605994689c1Smrg <listitem> 606994689c1Smrg <para> 607994689c1SmrgRepositions the Scrollbar's thumb to the current pointer location. 608994689c1Smrg </para> 609994689c1Smrg </listitem> 610994689c1Smrg </varlistentry> 611994689c1Smrg <varlistentry> 612994689c1Smrg <term> 6135ec34c4cSmrg <function>NotifyThumb</function>( )\ 614994689c1Smrg </term> 615994689c1Smrg <listitem> 616994689c1Smrg <para> 617994689c1SmrgCalls the 618994689c1Smrg<!-- .PN jumpProc --> 619994689c1Smrgcallbacks and passes the relative position of the 620994689c1Smrgpointer as a percentage of the scroll bar length. 621994689c1Smrg </para> 622994689c1Smrg </listitem> 623994689c1Smrg </varlistentry> 624994689c1Smrg</variablelist> 625994689c1Smrg<para> 626994689c1SmrgThe default bindings for Scrollbar are: 6275ec34c4cSmrg<indexterm><primary>Scrollbar widget</primary><secondary>default translation table</secondary></indexterm> 628994689c1Smrg</para> 629994689c1Smrg 630994689c1Smrg<literallayout class="monospaced"> 631994689c1Smrg <Btn1Down>: StartScroll(Forward) 6325ec34c4cSmrg <Btn2Down>: StartScroll(Continuous) MoveThumb( ) NotifyThumb( ) 633994689c1Smrg <Btn3Down>: StartScroll(Backward) 6345ec34c4cSmrg <Btn2Motion>: MoveThumb( ) NotifyThumb( ) 6355ec34c4cSmrg <BtnUp>: NotifyScroll(Proportional) EndScroll( ) 636994689c1Smrg</literallayout> 637994689c1Smrg 638994689c1Smrg<para> 639994689c1SmrgExamples of additional bindings a user might wish to specify in a 640994689c1Smrgresource file are: 641994689c1Smrg</para> 642994689c1Smrg 643994689c1Smrg<literallayout class="monospaced"> 644994689c1Smrg*Scrollbar.Translations: \\ 645994689c1Smrg ~Meta<Key>space: StartScroll(Forward) NotifyScroll(FullLength) \\n\\ 646994689c1Smrg Meta<Key>space: StartScroll(Backward) NotifyScroll(FullLength) \\n\\ 6475ec34c4cSmrg EndScroll( ) 648994689c1Smrg</literallayout> 649994689c1Smrg 650994689c1Smrg</sect2> 651994689c1Smrg 652994689c1Smrg<sect2 id="Scrollbar_Callbacks"> 653994689c1Smrg<title>Scrollbar Callbacks</title> 6545ec34c4cSmrg<indexterm><primary>Scrollbar widget</primary><secondary>callbacks</secondary></indexterm> 655994689c1Smrg<para> 656994689c1Smrg<!-- .LP --> 657994689c1SmrgThere are two callback lists provided by the Scrollbar widget. 658994689c1SmrgThe procedural interface for these functions is described here. 659994689c1Smrg</para> 660994689c1Smrg 661994689c1Smrg<para> 662994689c1Smrg<!-- .LP --> 663994689c1SmrgThe calling interface to the <function>scrollProc</function> callback procedure is: 6645ec34c4cSmrg<indexterm significance="preferred"><primary>ScrollProc</primary></indexterm> 665994689c1Smrg</para> 666421c997bSmrg<funcsynopsis id='ScrollProc'> 667994689c1Smrg<funcprototype> 668994689c1Smrg <funcdef>void<function> ScrollProc</function></funcdef> 669994689c1Smrg <paramdef>Widget<parameter> scrollbar</parameter></paramdef> 670994689c1Smrg <paramdef>XtPointer<parameter> client_data</parameter></paramdef> 671994689c1Smrg <paramdef>XtPointer<parameter> position</parameter></paramdef> 672994689c1Smrg</funcprototype> 673994689c1Smrg</funcsynopsis> 674994689c1Smrg 675994689c1Smrg<variablelist> 676994689c1Smrg <varlistentry> 677994689c1Smrg <term> 678994689c1Smrg <emphasis remap='I'>scrollbar</emphasis> 679994689c1Smrg </term> 680994689c1Smrg <listitem> 681994689c1Smrg <para> 682994689c1SmrgSpecifies the Scrollbar widget. 683994689c1Smrg </para> 684994689c1Smrg </listitem> 685994689c1Smrg </varlistentry> 686994689c1Smrg <varlistentry> 687994689c1Smrg <term> 688994689c1Smrg <emphasis remap='I'>client_data</emphasis> 689994689c1Smrg </term> 690994689c1Smrg <listitem> 691994689c1Smrg <para> 692994689c1SmrgSpecifies the client data. 693994689c1Smrg </para> 694994689c1Smrg </listitem> 695994689c1Smrg </varlistentry> 696994689c1Smrg <varlistentry> 697994689c1Smrg <term> 698994689c1Smrg <emphasis remap='I'>position</emphasis> 699994689c1Smrg </term> 700994689c1Smrg <listitem> 701994689c1Smrg <para> 702994689c1SmrgSpecifies a pixel position in integer form. 703994689c1Smrg </para> 704994689c1Smrg </listitem> 705994689c1Smrg </varlistentry> 706994689c1Smrg</variablelist> 707994689c1Smrg 708994689c1Smrg<para> 709994689c1SmrgThe <function>scrollProc</function> callback is used for incremental scrolling 710994689c1Smrgand is called by the <function>NotifyScroll</function> action. 711994689c1SmrgThe position argument is a signed quantity and should be cast to an int 712994689c1Smrgwhen used. Using the default button bindings, button 1 returns a 713994689c1Smrgpositive value, and button 3 returns a negative value. In both cases, 714994689c1Smrgthe magnitude of the value is the distance of the pointer in 715994689c1Smrgpixels from the top (or left) of the Scrollbar. The value will never 716994689c1Smrgbe greater than the length of the Scrollbar. 717994689c1Smrg</para> 718994689c1Smrg 719994689c1Smrg<para> 720994689c1SmrgThe calling interface to the <function>jumpProc</function> callback procedure is: 721994689c1Smrg</para> 7225ec34c4cSmrg<indexterm significance="preferred"><primary>jumpProc</primary></indexterm> 723421c997bSmrg<funcsynopsis id='JumpProc'> 724994689c1Smrg<funcprototype> 725994689c1Smrg <funcdef>void<function> JumpProc</function></funcdef> 726994689c1Smrg <paramdef>Widget<parameter> scrollbar</parameter></paramdef> 727994689c1Smrg <paramdef>XtPointer<parameter> client_data</parameter></paramdef> 728994689c1Smrg <paramdef>XtPointer<parameter> percent_ptr</parameter></paramdef> 729994689c1Smrg</funcprototype> 730994689c1Smrg</funcsynopsis> 731994689c1Smrg 732994689c1Smrg<!-- .FN --> 733994689c1Smrg<variablelist> 734994689c1Smrg <varlistentry> 735994689c1Smrg <term> 736994689c1Smrg <emphasis remap='I'>scrollbar</emphasis> 737994689c1Smrg </term> 738994689c1Smrg <listitem> 739994689c1Smrg <para> 740994689c1SmrgSpecifies the ID of the scroll bar widget. 741994689c1Smrg </para> 742994689c1Smrg </listitem> 743994689c1Smrg </varlistentry> 744994689c1Smrg <varlistentry> 745994689c1Smrg <term> 746994689c1Smrg <emphasis remap='I'>client_data</emphasis> 747994689c1Smrg </term> 748994689c1Smrg <listitem> 749994689c1Smrg <para> 750994689c1SmrgSpecifies the client data. 751994689c1Smrg </para> 752994689c1Smrg </listitem> 753994689c1Smrg </varlistentry> 754994689c1Smrg <varlistentry> 755994689c1Smrg <term> 756994689c1Smrg <emphasis remap='I'>percent_ptr</emphasis> 757994689c1Smrg </term> 758994689c1Smrg <listitem> 759994689c1Smrg <para> 7605ec34c4cSmrgSpecifies the floating point position of the thumb (0.0 – 1.0). 761994689c1Smrg </para> 762994689c1Smrg </listitem> 763994689c1Smrg </varlistentry> 764994689c1Smrg</variablelist> 765994689c1Smrg 766994689c1Smrg<para> 767994689c1SmrgThe <function>jumpProc</function> callback is used to implement smooth scrolling and 768994689c1Smrgis called by the <function>NotifyThumb</function> action. Percent_ptr must be cast 769994689c1Smrgto a pointer to float before use; i.e. 770994689c1Smrg</para> 771994689c1Smrg 772994689c1Smrg<literallayout class="monospaced"> 773994689c1Smrg float percent = *(float*)percent_ptr; 774994689c1Smrg</literallayout> 775994689c1Smrg 776994689c1Smrg<para> 777994689c1SmrgWith the default button bindings, button 2 moves the thumb interactively, 778994689c1Smrgand the <function>jumpProc</function> is called on each new position of the pointer, 779994689c1Smrgwhile the pointer button remains down. The value specified by 780994689c1Smrg<emphasis remap='I'>percent_ptr</emphasis> is the current location of the thumb (from the top or 781994689c1Smrgleft of the Scrollbar) expressed as a percentage of the length of the 782994689c1SmrgScrollbar. 783994689c1Smrg</para> 784994689c1Smrg 785994689c1Smrg</sect2> 786994689c1Smrg 787994689c1Smrg<sect2 id="Convenience_Routines"> 788994689c1Smrg<title>Convenience Routines</title> 789994689c1Smrg<para> 7905ec34c4cSmrg<indexterm><primary>Scrollbar widget</primary><secondary>setting thumb values</secondary></indexterm> 791994689c1SmrgTo set the position and length of a Scrollbar thumb, use 792994689c1Smrg<!-- .PN XawScrollbarSetThumb . --> 7935ec34c4cSmrg<indexterm significance="preferred"><primary>XawScrollbarSetThumb</primary></indexterm> 794994689c1Smrg</para> 795421c997bSmrg<funcsynopsis id='XawScrollbarSetThumb'> 796994689c1Smrg<funcprototype> 797994689c1Smrg <funcdef>void<function> XawScrollbarSetThumb</function></funcdef> 798994689c1Smrg <paramdef>Widget<parameter> w</parameter></paramdef> 799994689c1Smrg <paramdef>float<parameter> top</parameter></paramdef> 800994689c1Smrg <paramdef>float<parameter> shown</parameter></paramdef> 801994689c1Smrg</funcprototype> 802994689c1Smrg</funcsynopsis> 803994689c1Smrg 804994689c1Smrg<variablelist> 805994689c1Smrg <varlistentry> 806994689c1Smrg <term> 807994689c1Smrg <emphasis remap='I'>w</emphasis> 808994689c1Smrg </term> 809994689c1Smrg <listitem> 810994689c1Smrg <para> 811994689c1SmrgSpecifies the Scrollbar widget. 812994689c1Smrg </para> 813994689c1Smrg </listitem> 814994689c1Smrg </varlistentry> 815994689c1Smrg <varlistentry> 816994689c1Smrg <term> 817994689c1Smrg <emphasis remap='I'>top</emphasis> 818994689c1Smrg </term> 819994689c1Smrg <listitem> 820994689c1Smrg <para> 821994689c1SmrgSpecifies the position of the top of the thumb as a fraction of the 822994689c1Smrglength of the Scrollbar. 823994689c1Smrg </para> 824994689c1Smrg </listitem> 825994689c1Smrg </varlistentry> 826994689c1Smrg <varlistentry> 827994689c1Smrg <term> 828994689c1Smrg <emphasis remap='I'>shown</emphasis> 829994689c1Smrg </term> 830994689c1Smrg <listitem> 831994689c1Smrg <para> 832994689c1SmrgSpecifies the length of the thumb as a fraction of the total length 833994689c1Smrgof the Scrollbar. 834994689c1Smrg </para> 835994689c1Smrg </listitem> 836994689c1Smrg </varlistentry> 837994689c1Smrg</variablelist> 838994689c1Smrg 839994689c1Smrg<para> 840994689c1Smrg<function>XawScrollbarThumb</function> 8415ec34c4cSmrgmoves the visible thumb to a new position (0.0 – 1.0) and length (0.0 – 1.0). 8425ec34c4cSmrgEither the top or shown arguments can be specified as -1.0, 843994689c1Smrgin which case the current value is left unchanged. 844994689c1SmrgValues greater than 1.0 are truncated to 1.0. 845994689c1Smrg</para> 846994689c1Smrg 847994689c1Smrg<para> 848421c997bSmrgIf called from <function>jumpProc</function>, <xref linkend='XawScrollbarSetThumb' xrefstyle='select: title'/> has no effect. 849994689c1Smrg</para> 850994689c1Smrg 851994689c1Smrg</sect2> 852994689c1Smrg 853994689c1Smrg<sect2 id="Setting_Float_Resources"> 854994689c1Smrg<title>Setting Float Resources</title> 8555ec34c4cSmrg<indexterm><primary>float resources</primary><secondary>setting</secondary></indexterm> 856994689c1Smrg<para> 857994689c1SmrgThe <function>shown</function> and <function>topOfThumb</function> resources are of type 858994689c1Smrg<emphasis remap='I'>float</emphasis>. These resources can be difficult to get into an 859994689c1Smrgargument list. The reason is that C performs an automatic cast of 860994689c1Smrgthe float value to an integer value, usually truncating the important 861994689c1Smrginformation. The following code fragment is one portable method of 862994689c1Smrggetting a float into an argument list. 863994689c1Smrg</para> 864994689c1Smrg<literallayout class="monospaced"> 865994689c1Smrg top = 0.5; 866994689c1Smrg if (sizeof(float) > sizeof(XtArgVal)) { 867994689c1Smrg /* 8685ec34c4cSmrg * If a float is larger than an XtArgVal then pass this 8695ec34c4cSmrg * resource value by reference. 8705ec34c4cSmrg */ 871994689c1Smrg XtSetArg(args[0], XtNshown, &top); 872994689c1Smrg } 873994689c1Smrg else { 874994689c1Smrg /* 8755ec34c4cSmrg * Convince C not to perform an automatic conversion, which 8765ec34c4cSmrg * would truncate 0.5 to 0. 8775ec34c4cSmrg */ 878994689c1Smrg XtArgVal * l_top = (XtArgVal *) &top; 879994689c1Smrg XtSetArg(args[0], XtNshown, *l_top); 880994689c1Smrg } 881994689c1Smrg</literallayout> 882994689c1Smrg 883994689c1Smrg</sect2> 884994689c1Smrg</sect1> 885