# PaCkAgE DaTaStReAm
libxaw 1 23844
# end of header
070701000560c9000081a40000000000000000000000014c5c74d7000001160000010000010036ffffffffffffffff0000000f00000000libxaw/pkginfo PKG=libxaw
NAME=libXaw 1.0.7 SPARC 64bit Solaris 10
VERSION=1.0.7
PSTAMP=7th August 2010
VENDOR=X.org
EMAIL=http://cgit.freedesktop.org/xorg/lib/libXaw/
DESC=X.org X11 Athena Widgets toolkit
ARCH=sparc
CATEGORY=utility
CLASSES=none
BASEDIR=/
ISTATES=S s 1 2 3
RSTATES=S s 1 2 3
070701000560c8000081a40000000000000000000000014c5c74d700001ec70000010000010036ffffffffffffffff0000000e00000000libxaw/pkgmap : 1 23844
1 d none /usr ? ? ?
1 d none /usr/local ? ? ?
1 d none /usr/local/include 0755 root root
1 d none /usr/local/include/X11 0755 root root
1 d none /usr/local/include/X11/Xaw 0755 root root
1 f none /usr/local/include/X11/Xaw/AllWidgets.h 0644 root root 1456 54147 1281127342
1 f none /usr/local/include/X11/Xaw/AsciiSink.h 0644 root root 3094 46160 1281127342
1 f none /usr/local/include/X11/Xaw/AsciiSinkP.h 0644 root root 3685 34926 1281127342
1 f none /usr/local/include/X11/Xaw/AsciiSrc.h 0644 root root 4005 60865 1281127342
1 f none /usr/local/include/X11/Xaw/AsciiSrcP.h 0644 root root 5031 10259 1281127342
1 f none /usr/local/include/X11/Xaw/AsciiText.h 0644 root root 4875 57820 1281127342
1 f none /usr/local/include/X11/Xaw/AsciiTextP.h 0644 root root 5024 14540 1281127342
1 f none /usr/local/include/X11/Xaw/Box.h 0644 root root 3710 32619 1281127342
1 f none /usr/local/include/X11/Xaw/BoxP.h 0644 root root 3543 22548 1281127342
1 f none /usr/local/include/X11/Xaw/Cardinals.h 0644 root root 1589 61946 1281127342
1 f none /usr/local/include/X11/Xaw/Command.h 0644 root root 5048 19050 1281127342
1 f none /usr/local/include/X11/Xaw/CommandP.h 0644 root root 4031 59580 1281127342
1 f none /usr/local/include/X11/Xaw/Dialog.h 0644 root root 3568 18913 1281127342
1 f none /usr/local/include/X11/Xaw/DialogP.h 0644 root root 3744 39678 1281127342
1 f none /usr/local/include/X11/Xaw/Form.h 0644 root root 5485 48084 1281127342
1 f none /usr/local/include/X11/Xaw/FormP.h 0644 root root 5014 14235 1281127342
1 f none /usr/local/include/X11/Xaw/Grip.h 0644 root root 3873 46145 1281127342
1 f none /usr/local/include/X11/Xaw/GripP.h 0644 root root 3214 60036 1281127342
1 f none /usr/local/include/X11/Xaw/Label.h 0644 root root 4656 47492 1281127342
1 f none /usr/local/include/X11/Xaw/LabelP.h 0644 root root 3962 53564 1281127342
1 f none /usr/local/include/X11/Xaw/List.h 0644 root root 6822 21384 1281127342
1 f none /usr/local/include/X11/Xaw/ListP.h 0644 root root 3669 28106 1281127342
1 f none /usr/local/include/X11/Xaw/MenuButtoP.h 0644 root root 2671 22816 1281127342
1 f none /usr/local/include/X11/Xaw/MenuButton.h 0644 root root 3295 61802 1281127342
1 f none /usr/local/include/X11/Xaw/MultiSink.h 0644 root root 4524 29050 1281127342
1 f none /usr/local/include/X11/Xaw/MultiSinkP.h 0644 root root 5074 16447 1281127342
1 f none /usr/local/include/X11/Xaw/MultiSrc.h 0644 root root 4224 9806 1281127342
1 f none /usr/local/include/X11/Xaw/MultiSrcP.h 0644 root root 6468 60538 1281127342
1 f none /usr/local/include/X11/Xaw/Paned.h 0644 root root 8007 41464 1281127342
1 f none /usr/local/include/X11/Xaw/PanedP.h 0644 root root 7203 44275 1281127342
1 f none /usr/local/include/X11/Xaw/Panner.h 0644 root root 3881 58011 1281127342
1 f none /usr/local/include/X11/Xaw/PannerP.h 0644 root root 4248 20784 1281127342
1 f none /usr/local/include/X11/Xaw/Porthole.h 0644 root root 2352 53769 1281127342
1 f none /usr/local/include/X11/Xaw/PortholeP.h 0644 root root 2126 45581 1281127342
1 f none /usr/local/include/X11/Xaw/Repeater.h 0644 root root 2684 17702 1281127342
1 f none /usr/local/include/X11/Xaw/RepeaterP.h 0644 root root 2828 34624 1281127342
1 f none /usr/local/include/X11/Xaw/Reports.h 0644 root root 2231 54010 1281127342
1 f none /usr/local/include/X11/Xaw/Scrollbar.h 0644 root root 5160 25390 1281127342
1 f none /usr/local/include/X11/Xaw/ScrollbarP.h 0644 root root 4313 18861 1281127342
1 f none /usr/local/include/X11/Xaw/Simple.h 0644 root root 4124 3404 1281127342
1 f none /usr/local/include/X11/Xaw/SimpleMenP.h 0644 root root 3575 31428 1281127342
1 f none /usr/local/include/X11/Xaw/SimpleMenu.h 0644 root root 5046 18167 1281127342
1 f none /usr/local/include/X11/Xaw/SimpleP.h 0644 root root 3452 14712 1281127342
1 f none /usr/local/include/X11/Xaw/Sme.h 0644 root root 2265 48254 1281127342
1 f none /usr/local/include/X11/Xaw/SmeBSB.h 0644 root root 3380 1311 1281127342
1 f none /usr/local/include/X11/Xaw/SmeBSBP.h 0644 root root 3189 60856 1281127342
1 f none /usr/local/include/X11/Xaw/SmeLine.h 0644 root root 2288 50298 1281127342
1 f none /usr/local/include/X11/Xaw/SmeLineP.h 0644 root root 2411 375 1281127342
1 f none /usr/local/include/X11/Xaw/SmeP.h 0644 root root 2616 16610 1281127342
1 f none /usr/local/include/X11/Xaw/StripCharP.h 0644 root root 4130 3569 1281127342
1 f none /usr/local/include/X11/Xaw/StripChart.h 0644 root root 4678 44438 1281127342
1 f none /usr/local/include/X11/Xaw/Template.c 0644 root root 4779 48766 1281127342
1 f none /usr/local/include/X11/Xaw/Template.h 0644 root root 2477 65516 1281127342
1 f none /usr/local/include/X11/Xaw/TemplateP.h 0644 root root 2103 43664 1281127342
1 f none /usr/local/include/X11/Xaw/Text.h 0644 root root 8703 4747 1281127342
1 f none /usr/local/include/X11/Xaw/TextP.h 0644 root root 10131 42425 1281127342
1 f none /usr/local/include/X11/Xaw/TextSink.h 0644 root root 8245 722 1281127342
1 f none /usr/local/include/X11/Xaw/TextSinkP.h 0644 root root 9082 27541 1281127342
1 f none /usr/local/include/X11/Xaw/TextSrc.h 0644 root root 6794 25053 1281127342
1 f none /usr/local/include/X11/Xaw/TextSrcP.h 0644 root root 7202 3367 1281127342
1 f none /usr/local/include/X11/Xaw/Tip.h 0644 root root 3428 16446 1281127342
1 f none /usr/local/include/X11/Xaw/TipP.h 0644 root root 2303 56823 1281127342
1 f none /usr/local/include/X11/Xaw/Toggle.h 0644 root root 4961 6120 1281127342
1 f none /usr/local/include/X11/Xaw/ToggleP.h 0644 root root 2740 26711 1281127342
1 f none /usr/local/include/X11/Xaw/Tree.h 0644 root root 4926 54014 1281127342
1 f none /usr/local/include/X11/Xaw/TreeP.h 0644 root root 4861 12525 1281127342
1 f none /usr/local/include/X11/Xaw/VendorEP.h 0644 root root 3199 157 1281127342
1 f none /usr/local/include/X11/Xaw/Viewport.h 0644 root root 3975 54961 1281127342
1 f none /usr/local/include/X11/Xaw/ViewportP.h 0644 root root 4134 12713 1281127342
1 f none /usr/local/include/X11/Xaw/XawImP.h 0644 root root 5053 12435 1281127342
1 f none /usr/local/include/X11/Xaw/XawInit.h 0644 root root 2096 36997 1281127342
1 d none /usr/local/lib 0755 root root
1 s none /usr/local/lib/libXaw.so=libXaw7.so
1 s none /usr/local/lib/libXaw.so.6=libXaw6.so.6
1 s none /usr/local/lib/libXaw.so.7=libXaw7.so.7
1 f none /usr/local/lib/libXaw6.a 0644 root root 2050080 61726 1281127343
1 f none /usr/local/lib/libXaw6.la 0755 root root 1175 37569 1281127343
1 s none /usr/local/lib/libXaw6.so=libXaw6.so.6.0.1
1 s none /usr/local/lib/libXaw6.so.6=libXaw6.so.6.0.1
1 f none /usr/local/lib/libXaw6.so.6.0.1 0755 root root 1754000 38112 1281127343
1 f none /usr/local/lib/libXaw7.a 0644 root root 2633424 61567 1281127343
1 f none /usr/local/lib/libXaw7.la 0755 root root 1230 42533 1281127343
1 s none /usr/local/lib/libXaw7.so=libXaw7.so.7.0.0
1 s none /usr/local/lib/libXaw7.so.7=libXaw7.so.7.0.0
1 f none /usr/local/lib/libXaw7.so.7.0.0 0755 root root 2230496 26335 1281127343
1 d none /usr/local/lib/pkgconfig 0755 root root
1 f none /usr/local/lib/pkgconfig/xaw6.pc 0644 root root 277 25154 1281127344
1 f none /usr/local/lib/pkgconfig/xaw7.pc 0644 root root 281 25529 1281127344
1 d none /usr/local/share 0755 root root
1 d none /usr/local/share/doc 0755 root root
1 d none /usr/local/share/doc/libXaw 0755 root root
1 f none /usr/local/share/doc/libXaw/widgets.html 0644 root root 760032 24755 1281127344
1 f none /usr/local/share/doc/libXaw/widgets.index.ps 0644 root root 31673 10137 1281127344
1 f none /usr/local/share/doc/libXaw/widgets.ps 0644 root root 729854 7848 1281127344
1 f none /usr/local/share/doc/libXaw/widgets.txt 0644 root root 517588 40396 1281127344
1 d none /usr/local/share/man 0755 root root
1 d none /usr/local/share/man/man3 0755 root root
1 f none /usr/local/share/man/man3/Xaw.3 0644 root root 22148 21431 1281127344
1 i checkinstall 785 2565 1281127639
1 i pkginfo 278 21563 1281127639
07070100000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000b00000000TRAILER!!! 070701000560c9000081a40000000000000000000000014c5c74d7000001160000010000010036ffffffffffffffff0000000800000000pkginfo PKG=libxaw
NAME=libXaw 1.0.7 SPARC 64bit Solaris 10
VERSION=1.0.7
PSTAMP=7th August 2010
VENDOR=X.org
EMAIL=http://cgit.freedesktop.org/xorg/lib/libXaw/
DESC=X.org X11 Athena Widgets toolkit
ARCH=sparc
CATEGORY=utility
CLASSES=none
BASEDIR=/
ISTATES=S s 1 2 3
RSTATES=S s 1 2 3
070701000560c8000081a40000000000000000000000014c5c74d700001ec70000010000010036ffffffffffffffff0000000700000000pkgmap : 1 23844
1 d none /usr ? ? ?
1 d none /usr/local ? ? ?
1 d none /usr/local/include 0755 root root
1 d none /usr/local/include/X11 0755 root root
1 d none /usr/local/include/X11/Xaw 0755 root root
1 f none /usr/local/include/X11/Xaw/AllWidgets.h 0644 root root 1456 54147 1281127342
1 f none /usr/local/include/X11/Xaw/AsciiSink.h 0644 root root 3094 46160 1281127342
1 f none /usr/local/include/X11/Xaw/AsciiSinkP.h 0644 root root 3685 34926 1281127342
1 f none /usr/local/include/X11/Xaw/AsciiSrc.h 0644 root root 4005 60865 1281127342
1 f none /usr/local/include/X11/Xaw/AsciiSrcP.h 0644 root root 5031 10259 1281127342
1 f none /usr/local/include/X11/Xaw/AsciiText.h 0644 root root 4875 57820 1281127342
1 f none /usr/local/include/X11/Xaw/AsciiTextP.h 0644 root root 5024 14540 1281127342
1 f none /usr/local/include/X11/Xaw/Box.h 0644 root root 3710 32619 1281127342
1 f none /usr/local/include/X11/Xaw/BoxP.h 0644 root root 3543 22548 1281127342
1 f none /usr/local/include/X11/Xaw/Cardinals.h 0644 root root 1589 61946 1281127342
1 f none /usr/local/include/X11/Xaw/Command.h 0644 root root 5048 19050 1281127342
1 f none /usr/local/include/X11/Xaw/CommandP.h 0644 root root 4031 59580 1281127342
1 f none /usr/local/include/X11/Xaw/Dialog.h 0644 root root 3568 18913 1281127342
1 f none /usr/local/include/X11/Xaw/DialogP.h 0644 root root 3744 39678 1281127342
1 f none /usr/local/include/X11/Xaw/Form.h 0644 root root 5485 48084 1281127342
1 f none /usr/local/include/X11/Xaw/FormP.h 0644 root root 5014 14235 1281127342
1 f none /usr/local/include/X11/Xaw/Grip.h 0644 root root 3873 46145 1281127342
1 f none /usr/local/include/X11/Xaw/GripP.h 0644 root root 3214 60036 1281127342
1 f none /usr/local/include/X11/Xaw/Label.h 0644 root root 4656 47492 1281127342
1 f none /usr/local/include/X11/Xaw/LabelP.h 0644 root root 3962 53564 1281127342
1 f none /usr/local/include/X11/Xaw/List.h 0644 root root 6822 21384 1281127342
1 f none /usr/local/include/X11/Xaw/ListP.h 0644 root root 3669 28106 1281127342
1 f none /usr/local/include/X11/Xaw/MenuButtoP.h 0644 root root 2671 22816 1281127342
1 f none /usr/local/include/X11/Xaw/MenuButton.h 0644 root root 3295 61802 1281127342
1 f none /usr/local/include/X11/Xaw/MultiSink.h 0644 root root 4524 29050 1281127342
1 f none /usr/local/include/X11/Xaw/MultiSinkP.h 0644 root root 5074 16447 1281127342
1 f none /usr/local/include/X11/Xaw/MultiSrc.h 0644 root root 4224 9806 1281127342
1 f none /usr/local/include/X11/Xaw/MultiSrcP.h 0644 root root 6468 60538 1281127342
1 f none /usr/local/include/X11/Xaw/Paned.h 0644 root root 8007 41464 1281127342
1 f none /usr/local/include/X11/Xaw/PanedP.h 0644 root root 7203 44275 1281127342
1 f none /usr/local/include/X11/Xaw/Panner.h 0644 root root 3881 58011 1281127342
1 f none /usr/local/include/X11/Xaw/PannerP.h 0644 root root 4248 20784 1281127342
1 f none /usr/local/include/X11/Xaw/Porthole.h 0644 root root 2352 53769 1281127342
1 f none /usr/local/include/X11/Xaw/PortholeP.h 0644 root root 2126 45581 1281127342
1 f none /usr/local/include/X11/Xaw/Repeater.h 0644 root root 2684 17702 1281127342
1 f none /usr/local/include/X11/Xaw/RepeaterP.h 0644 root root 2828 34624 1281127342
1 f none /usr/local/include/X11/Xaw/Reports.h 0644 root root 2231 54010 1281127342
1 f none /usr/local/include/X11/Xaw/Scrollbar.h 0644 root root 5160 25390 1281127342
1 f none /usr/local/include/X11/Xaw/ScrollbarP.h 0644 root root 4313 18861 1281127342
1 f none /usr/local/include/X11/Xaw/Simple.h 0644 root root 4124 3404 1281127342
1 f none /usr/local/include/X11/Xaw/SimpleMenP.h 0644 root root 3575 31428 1281127342
1 f none /usr/local/include/X11/Xaw/SimpleMenu.h 0644 root root 5046 18167 1281127342
1 f none /usr/local/include/X11/Xaw/SimpleP.h 0644 root root 3452 14712 1281127342
1 f none /usr/local/include/X11/Xaw/Sme.h 0644 root root 2265 48254 1281127342
1 f none /usr/local/include/X11/Xaw/SmeBSB.h 0644 root root 3380 1311 1281127342
1 f none /usr/local/include/X11/Xaw/SmeBSBP.h 0644 root root 3189 60856 1281127342
1 f none /usr/local/include/X11/Xaw/SmeLine.h 0644 root root 2288 50298 1281127342
1 f none /usr/local/include/X11/Xaw/SmeLineP.h 0644 root root 2411 375 1281127342
1 f none /usr/local/include/X11/Xaw/SmeP.h 0644 root root 2616 16610 1281127342
1 f none /usr/local/include/X11/Xaw/StripCharP.h 0644 root root 4130 3569 1281127342
1 f none /usr/local/include/X11/Xaw/StripChart.h 0644 root root 4678 44438 1281127342
1 f none /usr/local/include/X11/Xaw/Template.c 0644 root root 4779 48766 1281127342
1 f none /usr/local/include/X11/Xaw/Template.h 0644 root root 2477 65516 1281127342
1 f none /usr/local/include/X11/Xaw/TemplateP.h 0644 root root 2103 43664 1281127342
1 f none /usr/local/include/X11/Xaw/Text.h 0644 root root 8703 4747 1281127342
1 f none /usr/local/include/X11/Xaw/TextP.h 0644 root root 10131 42425 1281127342
1 f none /usr/local/include/X11/Xaw/TextSink.h 0644 root root 8245 722 1281127342
1 f none /usr/local/include/X11/Xaw/TextSinkP.h 0644 root root 9082 27541 1281127342
1 f none /usr/local/include/X11/Xaw/TextSrc.h 0644 root root 6794 25053 1281127342
1 f none /usr/local/include/X11/Xaw/TextSrcP.h 0644 root root 7202 3367 1281127342
1 f none /usr/local/include/X11/Xaw/Tip.h 0644 root root 3428 16446 1281127342
1 f none /usr/local/include/X11/Xaw/TipP.h 0644 root root 2303 56823 1281127342
1 f none /usr/local/include/X11/Xaw/Toggle.h 0644 root root 4961 6120 1281127342
1 f none /usr/local/include/X11/Xaw/ToggleP.h 0644 root root 2740 26711 1281127342
1 f none /usr/local/include/X11/Xaw/Tree.h 0644 root root 4926 54014 1281127342
1 f none /usr/local/include/X11/Xaw/TreeP.h 0644 root root 4861 12525 1281127342
1 f none /usr/local/include/X11/Xaw/VendorEP.h 0644 root root 3199 157 1281127342
1 f none /usr/local/include/X11/Xaw/Viewport.h 0644 root root 3975 54961 1281127342
1 f none /usr/local/include/X11/Xaw/ViewportP.h 0644 root root 4134 12713 1281127342
1 f none /usr/local/include/X11/Xaw/XawImP.h 0644 root root 5053 12435 1281127342
1 f none /usr/local/include/X11/Xaw/XawInit.h 0644 root root 2096 36997 1281127342
1 d none /usr/local/lib 0755 root root
1 s none /usr/local/lib/libXaw.so=libXaw7.so
1 s none /usr/local/lib/libXaw.so.6=libXaw6.so.6
1 s none /usr/local/lib/libXaw.so.7=libXaw7.so.7
1 f none /usr/local/lib/libXaw6.a 0644 root root 2050080 61726 1281127343
1 f none /usr/local/lib/libXaw6.la 0755 root root 1175 37569 1281127343
1 s none /usr/local/lib/libXaw6.so=libXaw6.so.6.0.1
1 s none /usr/local/lib/libXaw6.so.6=libXaw6.so.6.0.1
1 f none /usr/local/lib/libXaw6.so.6.0.1 0755 root root 1754000 38112 1281127343
1 f none /usr/local/lib/libXaw7.a 0644 root root 2633424 61567 1281127343
1 f none /usr/local/lib/libXaw7.la 0755 root root 1230 42533 1281127343
1 s none /usr/local/lib/libXaw7.so=libXaw7.so.7.0.0
1 s none /usr/local/lib/libXaw7.so.7=libXaw7.so.7.0.0
1 f none /usr/local/lib/libXaw7.so.7.0.0 0755 root root 2230496 26335 1281127343
1 d none /usr/local/lib/pkgconfig 0755 root root
1 f none /usr/local/lib/pkgconfig/xaw6.pc 0644 root root 277 25154 1281127344
1 f none /usr/local/lib/pkgconfig/xaw7.pc 0644 root root 281 25529 1281127344
1 d none /usr/local/share 0755 root root
1 d none /usr/local/share/doc 0755 root root
1 d none /usr/local/share/doc/libXaw 0755 root root
1 f none /usr/local/share/doc/libXaw/widgets.html 0644 root root 760032 24755 1281127344
1 f none /usr/local/share/doc/libXaw/widgets.index.ps 0644 root root 31673 10137 1281127344
1 f none /usr/local/share/doc/libXaw/widgets.ps 0644 root root 729854 7848 1281127344
1 f none /usr/local/share/doc/libXaw/widgets.txt 0644 root root 517588 40396 1281127344
1 d none /usr/local/share/man 0755 root root
1 d none /usr/local/share/man/man3 0755 root root
1 f none /usr/local/share/man/man3/Xaw.3 0644 root root 22148 21431 1281127344
1 i checkinstall 785 2565 1281127639
1 i pkginfo 278 21563 1281127639
07070100056163000041ed0000000000000000000000024c5c74d7000000000000010000010036ffffffffffffffff0000000800000000install 07070100056164000081ed0000000000000000000000014c5c74d7000003110000010000010036ffffffffffffffff0000001500000000install/checkinstall #!/bin/sh
#
expected_bits="64"
expected_release="5.10"
expected_platform="sparc"
#
release=`uname -r`
platform=`uname -p`
bits=`isainfo -b`
#
if [ ${platform} != ${expected_platform} ]; then
echo "\n\n\n\tThis package must be installed on a ${expected_platform} architecture\n"
echo "\tAborting installation.\n\n\n"
exit 1
fi
if [ ${release} != ${expected_release} ]; then
echo "\n\n\n\tThis package must be installed on a ${expected_release} machine\n"
echo "\tAborting installation.\n\n\n"
exit 1
fi
if [ ${bits} != ${expected_bits} ]; then
echo "\n\n\n\tThis package must be installed on a ${expected_bits} bit machine\n"
echo "\tYour machine is running a ${bits} bit O.S. currently\n"
echo "\tAborting installation.\n\n\n"
exit 1
fi
exit 0
070701000560ca000041ed0000000000000000000000034c5c74d7000000000000010000010036ffffffffffffffff0000000500000000root 070701000560cb000041ed0000000000000000000000034c5c74d7000000000000010000010036ffffffffffffffff0000000900000000root/usr 070701000560cc000041ed0000000000000000000000054c5c74d7000000000000010000010036ffffffffffffffff0000000f00000000root/usr/local 07070100056155000041ed0000000000000000000000044c5c74d7000000000000010000010036ffffffffffffffff0000001500000000root/usr/local/share 07070100056156000041ed0000000000000000000000034c5c74d7000000000000010000010036ffffffffffffffff0000001900000000root/usr/local/share/doc 07070100056157000041ed0000000000000000000000024c5c74d7000000000000010000010036ffffffffffffffff0000002000000000root/usr/local/share/doc/libXaw 0707010005615f000081a40000000000000000000000014c5c73b00007e5d40000010000010036ffffffffffffffff0000002c00000000root/usr/local/share/doc/libXaw/widgets.txt
[1mAthena Widget Set -- C Language Interface[0m
[1mX Window System[0m
[1mX Version 11, Release 7[0m
[1mlibXaw 1.0.7[0m
Chris D. Peterson
formerly MIT X Consortium
X Window System is a trademark of The Open Group.
Copyright (C) 1985, 1986, 1987, 1988, 1989, 1991, 1994 X
Consortium
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documenta-
tion files (the ``Software''), to deal in the Software with-
out restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to
whom the Software is furnished to do so, subject to the fol-
lowing conditions:
The above copyright notice and this permission notice shall
be included in all copies or substantial portions of the
Software.
THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY
KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PUR-
POSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE X CONSOR-
TIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of the X Con-
sortium shall not be used in advertising or otherwise to
promote the sale, use or other dealings in this Software
without prior written authorization from the X Consortium.
Copyright (C) 1985, 1986, 1987, 1988, 1989, 1991 Digital
Equipment Corporation, Maynard, Massachusetts.
Permission to use, copy, modify and distribute this documen-
tation for any purpose and without fee is hereby granted,
provided that the above copyright notice appears in all
copies and that both that copyright notice and this permis-
sion notice appear in supporting documentation, and that the
name of Digital not be used in in advertising or publicity
pertaining to distribution of the software without specific,
written prior permission. Digital makes no representations
about the suitability of the software described herein for
any purpose. It is provided ``as is'' without express or
implied warranty.
[1mAcknowledgments[0m
Many thanks go to Ralph Swick (Project Athena / Digital) who
has contributed much time and effort to this widget set.
Previous versions of the widget set are largely due to his
time and effort. Many of the improvements that I have been
able to make are because he provided a solid foundation to
build upon. While much of the effort has been Ralph's, many
other people have contributed to the code.
Mark Ackerman (formerly Project Athena)
Donna Converse (MIT X Consortium)
Jim Fulton (formerly MIT X Consortium)
Loretta Guarino-Reid (Digital WSL)
Charles Haynes (Digital WSL)
Rich Hyde (Digital WSL)
Mary Larson (Digital UEG)
Joel McCormack (Digital WSL)
Ron Newman (formerly Project Athena)
Jeanne Rich (Digital WSL)
Terry Weissman (formerly Digital WSL)
While not much remains of the X10 toolkit, many of the ideas
for this widget set come from that original version. The
design and implementation of the X10 toolkit were done by:
Mike Gancarz (formerly Digital UEG)
Charles Haynes (Digital WSL)
Phil Karlton (formerly Digital WSL)
Kathleen Langone (Digital UEG)
Mary Larson (Digital UEG)
Ram Rao (Digital UEG)
Smokey Wallace (formerly Digital WSL)
Terry Weissman (formerly Digital WSL)
I have used the formatting ideas, and some of the words from
previous versions of this document. The X11R3 Athena widget
document was written by:
Ralph R. Swick (Project Athena/ Digital)
Terry Weissman (formerly Digital WSL)
Al Mento (Digital UEG)
Putting this manual together was a major task in and of
itself. I would like to thank Ralph Swick, Donna Converse,
[1mv[0m
and Jim Fulton for taking the time to help convert my tech-
nical knowledge into legible text. A special thanks to Jean
Diaz (O'Reilly and Associates) for spending nearly a month
with me working out all the annoying little details.
Chris D. Peterson
MIT X Consortium 1989
The R5 edition of this document has been edited by the
research staff of the MIT X Consortium, with significant
contributions by Jim Fulton (NCD).
Donna Converse
MIT X Consortium 1991
The R6 edition of this document has been edited to reflect
changes brought about by research staff of the Omron Corpo-
ration, with special recognition to Li Yuhong, Seiji Kuwari,
and Hiroshi Kuribayashi for the X11R5/contrib/lib/Xaw inter-
nationalization that inspired this version.
Frank Sheeran
Omron Corporation 1994
[1mvi[0m
[1mChapter 1[0m
[1mAthena Widgets and The Intrinsics[0m
The X Toolkit is made up of two distinct pieces, the Xt
Intrinsics and a widget set. The Athena widget set is a
sample implementation of a widget set built upon the Intrin-
sics. In the X Toolkit, a widget is the combination of an X
window or subwindow and its associated input and output
semantics.
Because the Intrinsics provide the same basic functionality
to all widget sets it may be possible to use widgets from
the Athena widget set with other widget sets based upon the
Intrinsics. Since widget sets may also implement private
protocols, all functionality may not be available when mix-
ing and matching widget sets. For information about the
Intrinsics, see the [4mX[24m [4mToolkit[24m [4mIntrinsics[24m [4m--[24m [4mC[24m [4mLanguage[0m
[4mInterface[24m.
The Athena widget set is a library package layered on top of
the Intrinsics and Xlib that provides a set of user inter-
face tools sufficient to build a wide variety of applica-
tions. This layer extends the basic abstractions provided
by X and provides the next layer of functionality primarily
by supplying a cohesive set of sample widgets. Although the
Intrinsics are a Consortium standard, there is no standard
widget set.
To the extent possible, the Intrinsics are "policy-free".
The application environment and widget set, not the Intrin-
sics, define, implement, and enforce:
+o Policy
+o Consistency
+o Style
Each individual widget implementation defines its own pol-
icy. The X Toolkit design allows for, but does not neces-
sarily encourage, the free mixing of radically differing
widget implementations.
[4m1.1.[24m [4mIntroduction[24m [4mto[24m [4mthe[24m [4mX[24m [4mToolkit[0m
The X Toolkit provides tools that simplify the design of
application user interfaces in the X Window System program-
ming environment. It assists application programmers by
providing a set of common underlying user-interface
[1m1[0m
[1mAthena Widget Set libXaw 1.0.7[0m
functions. It also lets widget programmers modify existing
widgets, by subclassing, or add new widgets. By using the X
Toolkit in their applications, programmers can present a
similar user interface across applications to all worksta-
tion users.
The X Toolkit consists of:
+o A set of Intrinsics functions for building widgets
+o An architectural model for constructing widgets
+o A widget set for application programming
While the majority of the Intrinsics functions are intended
for the widget programmer, a subset of the Intrinsics func-
tions are to be used by application programmers (see [4mX[0m
[4mToolkit[24m [4mIntrinsics[24m [4m--[24m [4mC[24m [4mLanguage[24m [4mInterface[24m). The architec-
tural model lets the widget programmer design new widgets by
using the Intrinsics and by combining other widgets. The
application interface layers built on top of the X Toolkit
include a coordinated set of widgets and composition poli-
cies. Some of these widgets and policies are specific to a
single application domain, and others are common to a vari-
ety of applications.
The remainder of this chapter discusses the X Toolkit and
Athena widget set:
+o Terminology
+o Model
+o Conventions used in this manual
+o Format of the Widget Reference Chapters
[4m1.2.[24m [4mTerminology[0m
In addition to the terms already defined for X programming
(see [4mXlib[24m [4m--[24m [4mC[24m [4mLanguage[24m [4mX[24m [4mInterface[24m), the following terms
are specific to the Intrinsics and Athena widget set and
used throughout this document.
[1mApplication programmer[0m
A programmer who uses the X Toolkit to produce an
application user interface.
[1mChild[0m
A widget that is contained within another "parent" wid-
get.
[1m2[0m
[1mAthena Widget Set libXaw 1.0.7[0m
[1mClass[0m
The general group to which a specific object belongs.
[1mClient[0m
A function that uses a widget in an application or for
composing other widgets.
[1mFullName[0m
The name of a widget instance appended to the full name
of its parent.
[1mInstance[0m
A specific widget object as opposed to a general widget
class.
[1mMethod[0m
A function or procedure implemented by a widget class.
[1mName[0m
The name that is specific to an instance of a widget
for a given client. This name is specified at creation
time and cannot be modified.
[1mObject[0m
A data abstraction consisting of private data and pri-
vate and public functions that operate on the private
data. Users of the abstraction can interact with the
object only through calls to the object's public func-
tions. In the X Toolkit, some of the object's public
functions are called directly by the application, while
others are called indirectly when the application calls
the common Intrinsics functions. In general, if a
function is common to all widgets, an application uses
a single Intrinsics function to invoke the function for
all types of widgets. If a function is unique to a
single widget type, the widget exports the function.
[1mParent[0m
A widget that contains at least one other ("child")
widget. A parent widget is also known as a composite
widget.
[1mResource[0m
A named piece of data in a widget that can be set by a
client, by an application, or by user defaults.
[1m3[0m
[1mAthena Widget Set libXaw 1.0.7[0m
[1mSuperclass[0m
A larger class of which a specific class is a member.
All members of a class are also members of the super-
class.
[1mUser[0m
A person interacting with a workstation.
[1mWidget[0m
An object providing a user-interface abstraction (for
example, a Scrollbar widget).
[1mWidget class[0m
The general group to which a specific widget belongs,
otherwise known as the type of the widget.
[1mWidget programmer[0m
A programmer who adds new widgets to the X Toolkit.
[4m1.3.[24m [4mUnderlying[24m [4mModel[0m
The underlying architectural model is based on the following
premises:
Widgets are X windows
Every user-interface widget is associated with an X
window. The X window ID for a widget is readily avail-
able from the widget. Standard Xlib calls can be used
by widgets for many of their input and output opera-
tions.
Information hiding
The data for every widget is private to the widget and
its subclasses. That is, the data is neither directly
accessible nor visible outside of the module implement-
ing the widget. All program interaction with the wid-
get is performed by a set of operations (methods) that
are defined for the widget.
[1m4[0m
[1mAthena Widget Set libXaw 1.0.7[0m
Widget semantics and widget layout geometry
Widget semantics are clearly separated from widget lay-
out geometry. Widgets are concerned with implementing
specific user-interface semantics. They have little
control over issues such as their size or placement
relative to other widget peers. Mechanisms are provid-
ed for associating geometric managers with widgets and
for widgets to make suggestions about their own geome-
try.
[4m1.4.[24m [4mConventions[24m [4mUsed[24m [4min[24m [4mthis[24m [4mManual[0m
+o All resources available to the widgets are listed with
each widget. Many of these are available to more than
one widget class due to the object oriented nature of
the Intrinsics. The new resources for each widget are
listed in bold text, and the inherited resources are
listed in plain text.
+o Global symbols are printed in [1mbold [22mand can be function
names, symbols defined in include files, or structure
names. Arguments are printed in [4mitalics[24m.
+o Each function is introduced by a general discussion
that distinguishes it from other functions. The func-
tion declaration itself follows, and each argument is
specifically explained. General discussion of the
function, if any is required, follows the arguments.
Where applicable, the last paragraph of the explanation
lists the return values of the function.
+o To eliminate any ambiguity between those arguments that
you pass and those that a function returns to you, the
explanations for all arguments that you pass start with
the word [4mspecifies[24m or, in the case of multiple argu-
ments, the word [4mspecify[24m. The explanations for all argu-
ments that are returned to you start with the word
[4mreturns[24m or, in the case of multiple arguments, the word
[4mreturn[24m. The explanations for all arguments that you
can pass and are returned start with the words [4mspeci-[0m
[4mfies[24m [4mand[24m [4mreturns[24m.
+o Any pointer to a structure that is used to return a
value is designated as such by the [4m_return[24m suffix as
part of its name. All other pointers passed to these
functions are used for reading only. A few arguments
use pointers to structures that are used for both input
and output and are indicated by using the [4m_in_out[24m suf-
fix.
[1m5[0m
[1mAthena Widget Set libXaw 1.0.7[0m
[4m1.5.[24m [4mFormat[24m [4mof[24m [4mthe[24m [4mWidget[24m [4mReference[24m [4mChapters[0m
The majority of this document is a reference guide for the
Athena widget set. Chapters three through six give the pro-
grammer all information necessary to use the widgets. The
layout of the chapters follows a specific pattern to allow
the programmer to easily find the desired information.
The first few pages of every chapter give an overview of the
widgets in that section. Widgets are grouped into chapters
by functionality.
Chapter 3
Simple Widgets
Chapter 4
Menus
Chapter 5
Text Widgets
Chapter 6
Composite and Constraint Widget
Following the introduction will be a description of each
widget in that chapter. When no functional grouping is
obvious the widgets are listed in alphabetical order, such
as in chapters three and six.
The first section of each widget's description is a table
that contains general information about this widget class.
Here is the table for the Box widget, and an explanation of
all the entries.
Application Header file
Class Header file
Class boxWidgetClass
Class Name Box
Superclass Composite
[1mApplication Header File[0m
This file must be included when an
application uses this widget. It usu-
ally contains the class definition, and
some resource macros. This is often
called the ``public'' header file.
[1mClass Header File [22mThis file will only be used by widget
programmers. It will need to be
included by any widget that subclasses
this widget. This is often called the
[1m6[0m
[1mAthena Widget Set libXaw 1.0.7[0m
``private'' header file.
[1mClass [22mThis is the widget class of this widget.
This global symbol is passed to [1mXtCre-[0m
[1mateWidget [22mso that the Intrinsics will
know which type of widget to create.
[1mClass Name [22mThis is the resource name of this class.
This name can be used in a resource file
to match any widget of this class.
[1mSuperclass [22mThis is the superclass that this widget
class is descended from. If you under-
stand how the superclass works it will
allow you to more quickly understand
what this widget does, since much of its
functionality may be inherited from its
superclass.
After this table follows a general description of the
default behavior of this widget, as seen by the user. In
many cases this functionality may be overridden by the
application programmer, or by the user.
The next section is a table showing the name, class, type
and default value of each resource that is available to this
widget. There is also a column containing notes describing
special restrictions placed upon individual resources.
A This resource may be automatically adjusted when
another resource is changed.
C This resource is only settable at widget creation time,
and may not be modified with [1mXtSetValues[22m.
D Do not modify this resource. While setting this
resource will work, it can cause unexpected behavior.
When this symbol appears there is another, preferred,
interface provided by the X Toolkit.
R This resource is READ-ONLY, and may not be modified.
After the resource table is a detailed description of every
resource available to that widget. Many of these are redun-
dant, but printing them with each widget saves page flip-
ping. The names of the resources that are inherited are
printed in plain text, while the names of the resources that
are new to this class are printed in [1mbold[22m. If you have
already read the description of the superclass you need only
pay attention to the resources printed in bold.
For each composite widget there is a section on layout
semantics that follows the resource description. This
[1m7[0m
[1mAthena Widget Set libXaw 1.0.7[0m
section will describe the effect of constraint resources on
the layout of the children, as well as a general description
of where it prefers to place its children.
Descriptions of default translations and action routines
come next, for widgets to which they apply. The last item
in each widget's documentation is the description of all
convenience routines provided by the widget.
[4m1.6.[24m [4mInput[24m [4mFocus[0m
The Intrinsics define a resource on all Shell widgets that
interact with the window manager called [1minput[22m. This
resource requests the assistance of window manager in
acquiring the input focus. The resource defaults to [1mFalse[0m
in the Intrinsics, but is redefined to default to [1mTrue [22mwhen
an application is using the Athena widget set. An applica-
tion programmer may override this default and set the
resource back to [1mFalse [22mif the application does not need the
window manager to give it the input focus. See the [4mX[24m [4mTool-[0m
[4mkit[24m [4mIntrinsics[24m [4m--[24m [4mC[24m [4mLanguage[24m [4mInterface[24m for details on the
[4minput[24m resource.
[1m8[0m
[1mAthena Widget Set libXaw 1.0.7[0m
[1mChapter 2[0m
[1mUsing Widgets[0m
Widgets serve as the primary tools for building a user
interface or application environment. The Athena widget set
consists of primitive widgets that contain no children (for
example, a command button) and composite widgets which may
contain one or more widget children (for example, a Box wid-
get).
The remaining chapters explain the widgets that are provided
by the Athena widget set. These user-interface components
serve as an interface for application programmers who do not
want to implement their own widgets. In addition, they
serve as a starting point for those widget programmers who,
using the Intrinsics mechanisms, want to implement alterna-
tive application programming interfaces.
This chapter is a brief introduction to widget programming.
The examples provided use the Athena widgets, though most of
the concepts will apply to all widget sets. Although there
are several programming interfaces to the X Toolkit, only
one is described here. A full description of the program-
ming interface is provided in the document [4mX[24m [4mToolkit[24m [4mIntrin-[0m
[4msics[24m [4m--[24m [4mC[24m [4mLanguage[24m [4mInterface[24m.
[4m2.1.[24m [4mSetting[24m [4mthe[24m [4mLocale[0m
If it is desirable that the application take advantage of
internationalization (i18n), you must establish locale with
[4mXtSetLanguageProc[24m before [1mXtDisplayInitialize [22mor [1mXtAppIni-[0m
[1mtialize [22mis called. For full details, please refer to the
document [4mX[24m [4mToolkit[24m [4mIntrinsics[24m [4m--[24m [4mC[24m [4mLanguage[24m [4mInterface[24m, sec-
tion 2.2. However, the following simplest-case call is suf-
ficient in many or most applications.
XtSetLanguageProc(NULL, NULL, NULL);
Most notably, this will affect the Standard C locale, deter-
mine which resource files will be loaded, and what fonts
will be required of FontSet specifications. In many cases,
the addition of this line is the only source change required
to internationalize Xaw programs, and will not disturb the
function of programs in the default "C" locale.
[1m9[0m
[1mAthena Widget Set libXaw 1.0.7[0m
[4m2.2.[24m [4mInitializing[24m [4mthe[24m [4mToolkit[0m
You must call a toolkit initialization function before
invoking any other toolkit routines (besides locale setting,
above). [4mXtAppInitialize[24m opens the X server connection,
parses the command line, and creates an initial widget that
will serve as the root of a tree of widgets created by this
application.
Widget XtAppInitialize([4mapp_context_return[24m, [4mapplication_class[24m, [4moptions[24m, [4mnum_options[24m,
[4margc_in_out[24m, [4margv_in_out[24m, [4mfallback_resources[24m, [4margs[24m, [4mnum_args[24m)
XtAppContext *[4mapp_context_return[24m;
String [4mapplication_class[24m;
XrmOptionDescRec [4moptions[24m[];
Cardinal [4mnum_options[24m;
int *[4margc_in_out[24m;
String *[4margv_in_out[24m[];
String *[4mfallback_resources[24m;
ArgList [4margs[24m;
Cardinal [4mnum_args[24m;
[4mapp_con_return[24m Returns the application context of this
application, if non-NULL.
[4mapplication_class[0m
Specifies the class name of this application,
which is usually the generic name for all
instances of this application. A useful con-
vention is to form the class name by capital-
izing the first letter of the application
name. For example, the application named
``xman'' has a class name of ``Xman''.
[4moptions[24m Specifies how to parse the command line for
any application-specific resources. The
options argument is passed as a parameter to
[4mXrmParseCommand[24m. For further information,
see [4mXlib[24m [4m--[24m [4mC[24m [4mLanguage[24m [4mX[24m [4mInterface[24m.
[4mnum_options[24m Specifies the number of entries in the
options list.
[4margc_in_out[24m Specifies a pointer to the number of command
line parameters.
[4margv_in_out[24m Specifies the command line parameters.
[4mfallback_resources[0m
Specifies resource values to be used if the
site-wide application class defaults file
cannot be opened, or NULL.
[4margs[24m Specifies the argument list to use when
[1m10[0m
[1mAthena Widget Set libXaw 1.0.7[0m
creating the Application shell.
[4mnum_args[24m Specifies the number of arguments in [4margs[24m.
This function will remove the command line arguments that
the toolkit reads from [4margc_in_out[24m, and [4margv_in_out[24m. It
will then attempt to open the display. If the display can-
not be opened, an error message is issued and XtAppInitial-
ize terminates the application. Once the display is opened,
all resources are read from the locations specified by the
Intrinsics. This function returns an ApplicationShell wid-
get to be used as the root of the application's widget tree.
[4m2.3.[24m [4mCreating[24m [4ma[24m [4mWidget[0m
Creating a widget is a three-step process. First, the wid-
get instance is allocated, and various instance-specific
attributes are set by using [1mXtCreateWidget[22m. Second, the
widget's parent is informed of the new child by using [1mXtMan-[0m
[1mageChild[22m. Finally, X windows are created for the parent and
all its children by using [1mXtRealizeWidget [22mand specifying the
top-most widget. The first two steps can be combined by
using [1mXtCreateManagedWidget[22m. In addition, [1mXtRealizeWidget[0m
is automatically called when the child becomes managed if
the parent is already realized.
To allocate, initialize, and manage a widget, use [4mXtCreateM-[0m
[4managedWidget[24m.
Widget XtCreateManagedWidget([4mname[24m, [4mwidget_class[24m, [4mparent[24m, [4margs[24m, [4mnum_args[24m)
String [4mname[24m;
WidgetClass [4mwidget_class[24m;
Widget [4mparent[24m;
ArgList [4margs[24m;
Cardinal [4mnum_args[24m;
[4mname[24m Specifies the instance name for the created widget
that is used for retrieving widget resources.
[4mwidget_class[0m
Specifies the widget class pointer for the created
widget.
[4mparent[24m Specifies the parent widget ID.
[4margs[24m Specifies the argument list. The argument list is
a variable-length list composed of name and value
pairs that contain information pertaining to the
specific widget instance being created. For fur-
ther information, see Section 2.7.2.
[4mnum_args[24m Specifies the number of arguments in the argument
list. If the num_args is zero, the argument list
[1m11[0m
[1mAthena Widget Set libXaw 1.0.7[0m
is never referenced.
When a widget instance is successfully created, the widget
identifier is returned to the application. If an error is
encountered, the [4mXtError[24m routine is invoked to inform the
user of the error.
For further information, see [4mX[24m [4mToolkit[24m [4mIntrinsics[24m [4m--[24m [4mC[24m [4mLan-[0m
[4mguage[24m [4mInterface[24m.
[4m2.4.[24m [4mCommon[24m [4mResources[0m
Although a widget can have unique arguments that it under-
stands, all widgets have common arguments that provide some
regularity of operation. The common arguments allow arbi-
trary widgets to be managed by higher-level components with-
out regard for the individual widget type. Widgets will
ignore any argument that they do not understand.
The following resources are retrieved from the argument list
or from the resource database by all of the Athena widgets:
--------------------------------------------------------------------------------
[4mName[24m [4mClass[24m [4mType[24m [4mDefault[24m [4mValue[0m
--------------------------------------------------------------------------------
accelerators Accelerators AcceleratorTable NULL
ancestorSensitive AncestorSensitive Boolean True
background Background Pixel XtDefaultBackground
backgroundPixmap Pixmap Pixmap XtUnspecifiedPixmap
borderColor BorderColor Pixel XtDefaultForeground
borderPixmap Pixmap Pixmap XtUnspecifiedPixmap
borderWidth BorderWidth Dimension 1
colormap Colormap Colormap Parent's Colormap
depth Depth int Parent's Depth
destroyCallback Callback XtCallbackList NULL
height Height Dimension [4mwidget[24m [4mdependent[0m
mappedWhenManaged MappedWhenManaged Boolean True
screen Screen Screen Parent's Screen
sensitive Sensitive Boolean True
translations Translations TranslationTable [4mwidget[24m [4mdependent[0m
width Width Dimension [4mwidget[24m [4mdependent[0m
x Position Position 0
y Position Position 0
--------------------------------------------------------------------------------
The following additional resources are retrieved from the
argument list or from the resource database by many of the
Athena widgets:
------------------------------------------------------------------------
[4mName[24m [4mClass[24m [4mType[24m [4mDefault[24m [4mValue[0m
------------------------------------------------------------------------
[1m12[0m
[1mAthena Widget Set libXaw 1.0.7[0m
------------------------------------------------------------------------
[4mName[24m [4mClass[24m [4mType[24m [4mDefault[24m [4mValue[0m
------------------------------------------------------------------------
callback Callback XtCallbackList NULL
cursor Cursor Cursor [4mwidget[24m [4mdependent[0m
foreground Foreground Pixel XtDefaultForeground
insensitiveBorder Insensitive Pixmap GreyPixmap
------------------------------------------------------------------------
[4m2.5.[24m [4mResource[24m [4mConversions[0m
Most resources in the Athena widget set have a converter
registered that will translate the string in a resource file
to the correct internal representation. While some are
obvious (string to integer, for example), others need spe-
cific mention of the allowable values. Three general con-
verters are described here:
+o Cursor
+o Pixel
+o Bitmap
Many widgets have defined special converters that apply only
to that widget. When these occur, the documentation section
for that widget will describe the converter.
[4m2.5.1.[24m [4mCursor[24m [4mConversion[0m
The value for the [1mcursorName [22mresource is specified in the
resource database as a string, and is of the following
forms:
+o A standard X cursor name from [1m< X11/cursorfont.h >[22m.
The names in [1mcursorfont.h [22meach describe a specific cur-
sor. The resource names for these cursors are exactly
like the names in this file except the [1mXC_ [22mis not used.
The cursor definition [1mXC_gumby [22mhas a resource name of
[1mgumby[22m.
+o Glyphs, as in [4mFONT[24m [4mfont-name[24m [4mglyph-index[24m [4m[[[24m [4mfont-name[24m [4m][0m
[4mglyph-index[24m [4m][24m. The first font and glyph specify the
cursor source pixmap. The second font and glyph spec-
ify the cursor mask pixmap. The mask font defaults to
the source font, and the mask glyph index defaults to
the source glyph index.
+o A relative or absolute file name. If a relative or
absolute file name is specified, that file is used to
create the source pixmap. Then the string "Mask" is
appended to locate the cursor mask pixmap. If the
"Mask" file does not exist, the suffix "msk" is tried.
[1m13[0m
[1mAthena Widget Set libXaw 1.0.7[0m
If "msk" fails, no cursor mask will be used. If the
filename does not start with '/' or './' the the bitmap
file path is used (see section 2.4.3).
[4m2.5.2.[24m [4mPixel[24m [4mConversion[0m
The string-to-pixel converter takes any name that is accept-
able to XParseColor (see [4mXlib[24m [4m--[24m [4mC[24m [4mLanguage[24m [4mX[24m [4mInterface[24m).
In addition this routine understands the special toolkit
symbols `XtDefaultForeground' and `XtDefaultBackground',
described in [4mX[24m [4mToolkit[24m [4mIntrinsics[24m [4m--[24m [4mC[24m [4mLanguage[24m [4mInterface[24m.
In short the acceptable pixel names are:
+o Any color name for the rgb.txt file (typically in the
directory /usr/lib/X11 on POSIX systems).
+o A numeric specification of the form #
where these numeric values are hexadecimal digits (both
upper and lower case).
+o The special strings `XtDefaultForeground' and `XtDe-
faultBackground'
[4m2.5.3.[24m [4mBitmap[24m [4mConversion[0m
The string-to-bitmap converter attempts to locate a file
containing bitmap data whose name is specified by the input
string. If the file name is relative (i.e. does not begin
with / or ./), the directories to be searched are specified
in the [1mbitmapFilePath [22mresource--class [1mBitmapFilePath[22m. This
resource specifies a colon (:) separated list of directories
that will be searched for the named bitmap or cursor glyph
(see section 2.4.1). The [1mbitmapFilePath [22mresource is global
to the application, and may [1mnot [22mbe specified differently for
each widget that wishes to convert a cursor to bitmap. In
addition to the directories specified in the [1mbitmapFilePath[0m
resource a default directory is searched. When using POSIX
the default directory is [4m/usr/include/X11/bitmaps[24m.
[4m2.6.[24m [4mRealizing[24m [4ma[24m [4mWidget[0m
The [4mXtRealizeWidget[24m function performs two tasks:
+o Calculates the geometry constraints of all managed
descendants of this widget. The actual calculation is
put off until realize time for performance reasons.
+o Creates an X window for the widget and, if it is a com-
posite widget, realizes each of its managed children.
void XtRealizeWidget([4mw[24m)
Widget [4mw[24m;
[1m14[0m
[1mAthena Widget Set libXaw 1.0.7[0m
[4mw[24m Specifies the widget.
For further information about this function, see the [4mX[24m [4mTool-[0m
[4mkit[24m [4mIntrinsics[24m [4m--[24m [4mC[24m [4mLanguage[24m [4mInterface[24m.
[4m2.7.[24m [4mProcessing[24m [4mEvents[0m
Now that the application has created, managed and realized
its widgets, it is ready to process the events that will be
delivered by the X Server to this client. A function call
that will process the events is [1mXtAppMainLoop[22m.
void XtAppMainLoop([4mapp_context[24m)
XtAppContext [4mapp_context[24m;
[4mapp_context[24mSpecifies the application context of this appli-
cation. The value is normally returned by [1mXtAp-[0m
[1mpInitialize[22m.
This function never returns: it is an infinite loop that
processes the X events. User input can be handled through
callback procedures and application defined action routines.
More details are provided in [4mX[24m [4mToolkit[24m [4mIntrinsics[24m [4m--[24m [4mC[24m [4mLan-[0m
[4mguage[24m [4mInterface[24m.
[4m2.8.[24m [4mStandard[24m [4mWidget[24m [4mManipulation[24m [4mFunctions[0m
After a widget has been created, a client can interact with
that widget by calling one of the standard widget manipula-
tion routines provided by the Intrinsics, or a widget class-
specific manipulation routine.
The Intrinsics provide generic routines to give the applica-
tion programmer access to a set of standard widget func-
tions. The common widget routines let an application or
composite widget perform the following operations on widgets
without requiring explicit knowledge of the widget type.
+o Control the mapping of widget windows
+o Destroy a widget instance
+o Obtain an argument value
+o Set an argument value
[4m2.8.1.[24m [4mMapping[24m [4mWidgets[0m
By default, widget windows are mapped (made viewable) auto-
matically by [1mXtRealizeWidget[22m. This behavior can be disabled
by using [1mXtSetMappedWhenManaged[22m, making the client responsi-
ble for calling [1mXtMapWidget [22mto make the widget viewable.
[1m15[0m
[1mAthena Widget Set libXaw 1.0.7[0m
void XtSetMappedWhenManaged([4mw[24m, [4mmap_when_managed[24m)
Widget [4mw[24m;
Boolean [4mmap_when_managed[24m;
[4mw[24m Specifies the widget.
[4mmap_when_managed[0m
Specifies the new value. If map_when_managed is
[1mTrue[22m, the widget is mapped automatically when it
is realized. If map_when_managed is [1mFalse[22m, the
client must call [4mXtMapWidget[24m or make a second call
to [4mXtSetMappedWhenManaged[24m to cause the child win-
dow to be mapped.
The definition for [4mXtMapWidget[24m is:
void XtMapWidget([4mw[24m)
Widget [4mw[24m;
[4mw[24m Specifies the widget.
When you are creating several children in sequence for a
previously realized common parent it is generally more effi-
cient to construct a list of children as they are created
(using [1mXtCreateWidget[22m) and then use [1mXtManageChildren [22mto
request that their parent managed them all at once. By man-
aging a list of children at one time, the parent can avoid
wasteful duplication of geometry processing and the associ-
ated ``screen flash''.
void XtManageChildren([4mchildren[24m, [4mnum_children[24m)
WidgetList [4mchildren[24m;
Cardinal [4mnum_children[24m;
[4mchildren[24m Specifies a list of children to add.
[4mnum_children[0m
Specifies the number of children to add.
If the parent is already visible on the screen, it is espe-
cially important to batch updates so that the minimum amount
of visible window reconfiguration is performed.
For further information about these functions, see the [4mX[0m
[4mToolkit[24m [4mIntrinsics[24m [4m--[24m [4mC[24m [4mLanguage[24m [4mInterface[24m.
[4m2.8.2.[24m [4mDestroying[24m [4mWidgets[0m
To destroy a widget instance of any type, use [4mXtDestroyWid-[0m
[4mget[24m.
[1m16[0m
[1mAthena Widget Set libXaw 1.0.7[0m
void XtDestroyWidget([4mw[24m)
Widget [4mw[24m;
[4mw[24m Specifies the widget.
[4mXtDestroyWidget[24m destroys the widget and recursively destroys
any children that it may have, including the windows created
by its children. After calling [4mXtDestroyWidget[24m, no further
references should be made to the widget or any children that
the destroyed widget may have had.
[4m2.8.3.[24m [4mRetrieving[24m [4mWidget[24m [4mResource[24m [4mValues[0m
To retrieve the current value of a resource attribute asso-
ciated with a widget instance, use [4mXtGetValues[24m.
void XtGetValues([4mw[24m, [4margs[24m, [4mnum_args[24m)
Widget [4mw[24m;
ArgList [4margs[24m;
Cardinal [4mnum_args[24m;
[4mw[24m Specifies the widget.
[4margs[24m Specifies a variable-length argument list of name
and [1maddress [22mpairs that contain the resource name
and the address into which the resource value is
stored.
[4mnum_args[24m Specifies the number of arguments in the argument
list.
The arguments and values passed in the argument list are
dependent on the widget. Note that the caller is responsible
for providing space into which the returned resource value
is copied; the [1mArgList [22mcontains a pointer to this storage
(e.g. x and y must be allocated as Position). For further
information, see the [4mX[24m [4mToolkit[24m [4mIntrinsics[24m [4m--[24m [4mC[24m [4mLanguage[0m
[4mInterface[24m.
[4m2.8.4.[24m [4mModifying[24m [4mWidget[24m [4mResource[24m [4mValues[0m
To modify the current value of a resource attribute associ-
ated with a widget instance, use [4mXtSetValues[24m.
void XtSetValues([4mw[24m, [4margs[24m, [4mnum_args[24m)
Widget [4mw[24m;
ArgList [4margs[24m;
Cardinal [4mnum_args[24m;
[4mw[24m Specifies the widget.
[1m17[0m
[1mAthena Widget Set libXaw 1.0.7[0m
[4margs[24m Specifies an array of name and [1mvalue [22mpairs that
contain the arguments to be modified and their new
values.
[4mnum_args[24m Specifies the number of arguments in the argument
list.
The arguments and values that are passed will depend on the
widget being modified. Some widgets may not allow certain
resources to be modified after the widget instance has been
created or realized. No notification is given if any part
of a [1mXtSetValues [22mrequest is ignored.
For further information about these functions, see the [4mX[0m
[4mToolkit[24m [4mIntrinsics[24m [4m--[24m [4mC[24m [4mLanguage[24m [4mInterface[24m.
Note
The argument list entry for [4mXtGetValues[24m specifies
the address to which the caller wants the value
copied. The argument list entry for [4mXtSetValues[24m,
however, contains the new value itself, if the
size of value is less than sizeof(XtArgVal)
(architecture dependent, but at least
sizeof(long)); otherwise, it is a pointer to the
value. String resources are always passed as
pointers, regardless of the length of the string.
[4m2.9.[24m [4mUsing[24m [4mthe[24m [4mClient[24m [4mCallback[24m [4mInterface[0m
Widgets can communicate changes in their state to their
clients by means of a callback facility. The format for a
client's callback handler is:
void [4mCallbackProc[24m([4mw[24m, [4mclient_data[24m, [4mcall_data[24m)
Widget [4mw[24m;
XtPointer [4mclient_data[24m;
XtPointer [4mcall_data[24m;
[4mw[24m Specifies widget for which the callback is regis-
tered.
[4mclient_data[24mSpecifies arbitrary client-supplied data that the
widget should pass back to the client when the
widget executes the client's callback procedure.
This is a way for the client registering the call-
back to also register client-specific data: a
pointer to additional information about the wid-
get, a reason for invoking the callback, and so
on. If no additional information is necessary,
NULL may be passed as this argument. This field
is also frequently known as the [4mclosure[24m.
[1m18[0m
[1mAthena Widget Set libXaw 1.0.7[0m
[4mcall_data[24m Specifies any callback-specific data the widget
wants to pass to the client. For example, when
Scrollbar executes its [1mjumpProc [22mcallback list, it
passes the current position of the thumb in
[4mcall_data[24m.
Callbacks can be registered either by creating an argument
containing the callback list described below or by using the
special convenience routines [1mXtAddCallback [22mand [1mXtAddCall-[0m
[1mbacks[22m. When the widget is created, a pointer to a list of
callback procedure and data pairs can be passed in the argu-
ment list to [4mXtCreateWidget[24m. The list is of type [4mXtCall-[0m
[4mbackList[24m:
typedef struct {
XtCallbackProc callback;
XtPointer closure;
} XtCallbackRec, *XtCallbackList;
The callback list must be allocated and initialized before
calling [4mXtCreateWidget[24m. The end of the list is identified
by an entry containing NULL in callback and closure. Once
the widget is created, the client can change or de-allocate
this list; the widget itself makes no further reference to
it. The closure field contains the client_data passed to
the callback when the callback list is executed.
The second method for registering callbacks is to use [4mXtAdd-[0m
[4mCallback[24m after the widget has been created.
void XtAddCallback([4mw[24m, [4mcallback_name,[24m [4mcallback[24m, [4mclient_data[24m)
Widget [4mw[24m;
String [4mcallback_name[24m;
XtCallbackProc [4mcallback[24m;
XtPointer [4mclient_data[24m;
[4mw[24m Specifies the widget to add the callback to.
[4mcallback_name[0m
Specifies the callback list within the widget to
append to.
[4mcallback[24m Specifies the callback procedure to add.
[4mclient_data[24mSpecifies the data to be passed to the callback
when it is invoked.
[4mXtAddCallback[24m adds the specified callback to the list for
the named widget.
All widgets provide a callback list named [4mdestroyCallback[0m
[1m19[0m
[1mAthena Widget Set libXaw 1.0.7[0m
where clients can register procedures that are to be exe-
cuted when the widget is destroyed. The destroy callbacks
are executed when the widget or an ancestor is destroyed.
The [4mcall_data[24m argument is unused for destroy callbacks.
[4m2.10.[24m [4mProgramming[24m [4mConsiderations[0m
This section provides some guidelines on how to set up an
application program that uses the X Toolkit.
[4m2.10.1.[24m [4mWriting[24m [4mApplications[0m
When writing an application that uses the X Toolkit, you
should make sure that your application performs the follow-
ing:
1. Include [4mX11/Intrinsic.h[24m> in your application programs.
This header file automatically includes [4mX11/Xlib.h[24m>,
so all Xlib functions also are defined. It may also be
necessary to include [1m< X11/StringDefs.h > [22mwhen setting
up argument lists, as many of the XtN[4msomething[24m defini-
tions are only defined in this file.
2. Include the widget-specific header files for each wid-
get type that you need to use. For example,
[4mX11/Xaw/Label.h[24m> and [4mX11/Xaw/Command.h[24m>.
3. Call the [4mXtAppInitialize[24m function before invoking any
other toolkit or Xlib functions. For further informa-
tion, see Section 2.1 and the [4mX[24m [4mToolkit[24m [4mIntrinsics[24m [4m--[24m [4mC[0m
[4mLanguage[24m [4mInterface[24m.
4. To pass attributes to the widget creation routines that
will override any site or user customizations, set up
argument lists. In this document, a list of valid
argument names is provided in the discussion of each
widget. The names each have a global symbol defined
that begins with [1mXtN [22mto help catch spelling errors.
For example, [1mXtNlabel [22mis defined for the [1mlabel [22mresource
of many widgets.
For further information, see Section 2.9.2.2.
5. When the argument list is set up, create the widget
with the [1mXtCreateManagedWidget [22mfunction. For further
information, see Section 2.2 and the [4mX[24m [4mToolkit[24m [4mIntrin-[0m
[4msics[24m [4m--[24m [4mC[24m [4mLanguage[24m [4mInterface[24m.
6. If the widget has any callback routines, set by the
[4mXtNcallback[24m argument or the [4mXtAddCallback[24m function,
declare these routines within the application.
7. After creating the initial widget hierarchy, windows
must be created for each widget by calling
[1m20[0m
[1mAthena Widget Set libXaw 1.0.7[0m
[4mXtRealizeWidget[24m on the top level widget.
8. Most applications now sit in a loop processing events
using [4mXtAppMainLoop[24m, for example:
XtCreateManagedWidget([4mname[24m, [4mclass[24m, [4mparent[24m, [4margs[24m, [4mnum_args[24m);
XtRealizeWidget([4mshell[24m);
XtAppMainLoop([4mapp_context[24m);
For information about this function, see the [4mX[24m [4mToolkit[0m
[4mIntrinsics[24m [4m--[24m [4mC[24m [4mLanguage[24m [4mInterface[24m.
9. Link your application with [4mlibXaw[24m (the Athena widgets),
[4mlibXmu[24m (miscellaneous utilities), [4mlibXt[24m (the X Toolkit
Intrinsics), [4mlibSM[24m (Session Management), [4mlibICE[24m (Inter-
Client Exchange), [4mlibXext[24m (the extension library needed
for the shape extension code which allows rounded Com-
mand buttons), and [4mlibX11[24m (the core X library). The
following provides a sample command line:
cc -o [4mapplication[24m [4mapplication[24m.c -lXaw -lXmu -lXt -lSM -lICE -lXext -lX11
[4m2.10.2.[24m [4mChanging[24m [4mResource[24m [4mValues[0m
The Intrinsics support two methods of changing the default
resource values; the resource manager, and an argument list
passed into XtCreateWidget. While resources values will get
updated no matter which method you use, the two methods pro-
vide slightly different functionality.
Resource ManagerThis method picks up resource definitions
described in [4mXlib[24m [4m--[24m [4mC[24m [4mLanguage[24m [4mX[24m [4mInterface[0m
from many different locations at run time.
The locations most important to the applica-
tion programmer are the [4mfallback[24m [4mresources[0m
and the [4mapp-defaults[24m file, (see [4mX[24m [4mToolkit[0m
[4mIntrinsics[24m [4m--[24m [4mC[24m [4mLanguage[24m [4mInterface[24m for the
complete list). Since these resource are
loaded at run time, they can be overridden by
the user, allowing an application to be cus-
tomized to fit the particular needs of each
individual user. These values can also be
modified without the need to rebuild the
application, allowing rapid prototyping of
user interfaces. Application programmers
should use resources in preference to hard-
coded values whenever possible.
Argument Lists The values passed into the widget at creation
time via an argument list cannot be modified
[1m21[0m
[1mAthena Widget Set libXaw 1.0.7[0m
by the user, and allow no opportunity for
customization. It is used to set resources
that cannot be specified as strings (e.g.
callback lists) or resources that should not
be overridden (e.g. window depth) by the
user.
[4m2.10.2.1.[24m [4mSpecifying[24m [4mResources[0m
It is important for all X Toolkit application programmers to
understand how to use the X Resource Manager to specify
resources for widgets in an X application. This section
will describe the most common methods used to specify these
resources, and how to use the X Resource manager.
[1mXrdb [22mThe [1mxrdb [22mutility may be used to load a file
containing resources into the X server.
Once the resources are loaded, the resources
will affect any new applications started on
the display that they were loaded onto.
[1mApplication Defaults[0m
The application defaults (app-defaults) file
(normally in /usr/lib/X11/app-defaults/[4mclass-[0m
[4mname[24m) for an application is loaded whenever
the application is started.
The resource specification has two colon-separated parts, a
name, and a value. The [4mvalue[24m is a string whose format is
dependent on the resource specified by [4mname[24m. [4mName[24m is con-
structed by appending a resource name to a full widget name.
The full widget name is a list of the name of every ancestor
of the desired widget separated by periods (.). Each widget
also has a class associated with it. A class is a type of
widget (e.g. Label or Scrollbar or Box). Notice that class
names, by convention, begin with capital letters and
instance names begin with lower case letters. The class of
any widget may be used in place of its name in a resource
specification. Here are a few examples:
xman.form.button1
This is a fully specified resource name, and
will affect only widgets called button1 that
are children of widgets called form that are
children of applications named xman. (Note
that while typically two widgets that are
siblings will have different names, it is not
prohibited.)
Xman.Form.Command
This will match any Command widget that is a
child of a Form widget that is itself a child
[1m22[0m
[1mAthena Widget Set libXaw 1.0.7[0m
of an application of class [4mXman[24m.
Xman.Form.button1
This is a mixed resource name with both wid-
get names and classes specified.
This syntax allows an application programmer to specify any
widget in the widget tree. To match more than one widget
(for example a user may want to make all Command buttons
blue), use an asterisk (*) instead of a period. When an
asterisk is used, any number of widgets (including zero) may
exist between the two widget names. For example:
Xman*Command This matches all Command widgets in the Xman
application.
Foo*button1 This matches any widget in the Foo applica-
tion that is named [4mbutton1[24m.
The root of all application widget trees is the widget
returned by [1mXtAppInitialize[22m. Even though this is actually
an ApplicationShell widget, the toolkit replaces its widget
class with the class name of the application. The name of
this widget is either the name used to invoke the applica-
tion ([1margv[0][22m) or the name of the application specified
using the standard [4m-name[24m command line option supported by
the Intrinsics.
The last step in constructing the resource name is to append
the name of the resource with either a period or asterisk to
the full or partial widget name already constructed.
*foreground:Blue Specifies that all widgets in all
applications will have a foreground
color of blue.
Xman*borderWidth:10 Specifies that all widgets in an
application whose class is Xman will
have a border width of 10 (pixels).
xman.form.button1.label:Testing
Specifies that a particular widget in
the xman application will have a label
named [4mTesting[24m.
An exclamation point (!) in the first column of a line indi-
cates that the rest of the line should be treated as a com-
ment.
[1mFinal Words[0m
The Resource manager is a powerful tool that can be used
very effectively to customize X Toolkit applications at run
time by either the application programmer or the user. Some
[1m23[0m
[1mAthena Widget Set libXaw 1.0.7[0m
final points to note:
+o An application programmer may add new resources to
their application. These resources are associated with
the global application, and not any particular widget.
The X Toolkit function used for adding the application
resources is [1mXtGetApplicationResources[22m.
+o Be careful when creating resource files. Since widgets
will ignore resources that they do not understand, any
spelling errors will cause a resource to have no
effect.
+o Only one resource line will match any given resource.
There is a set of precedence rules, which take the fol-
lowing general stance.
+o More specific overrides less specific, thus period
always overrides asterisk.
+o Names on the left are more specific and override
names on the right.
+o When resource specifications are exactly the same,
user defaults
will override program defaults.
For a complete explanation of the rules of precedence, and
other specific topics see [4mX[24m [4mToolkit[24m [4mIntrinsics[24m [4m--[24m [4mC[24m [4mLanguage[0m
[4mInterface[24m and [4mXlib[24m [4m--[24m [4mC[24m [4mLanguage[24m [4mX[24m [4mInterface[24m.
[4m2.10.2.2.[24m [4mCreating[24m [4mArgument[24m [4mLists[0m
To set up an argument list for the inline specification of
widget attributes, you may use any of the four approaches
discussed in this section. Each resource name has a global
symbol associated with it. This global symbol has the form
XtN[4mresource[24m [4mname[24m. For example, the symbol for ``fore-
ground'' is [1mXtNforeground[22m. For further information, see the
[4mX[24m [4mToolkit[24m [4mIntrinsics[24m [4m--[24m [4mC[24m [4mLanguage[24m [4mInterface[24m.
Argument are specified by using the following structure:
typedef struct {
String name;
XtArgVal value;
} Arg, *ArgList;
The first approach is to statically initialize the argument
list. For example:
[1m24[0m
[1mAthena Widget Set libXaw 1.0.7[0m
static Arg arglist[] = {
{XtNwidth, (XtArgVal) 400},
{XtNheight, (XtArgVal) 300},
};
This approach is convenient for lists that do not need to be
computed at runtime and makes adding or deleting new ele-
ments easy. The [4mXtNumber[24m macro is used to compute the num-
ber of elements in the argument list, preventing simple pro-
gramming errors:
XtCreateWidget([4mname[24m, [4mclass[24m, [4mparent[24m, [4marglist[24m, XtNumber([4marglist[24m));
The second approach is to use the [4mXtSetArg[24m macro. For exam-
ple:
Arg arglist[10];
XtSetArg(arglist[1], XtNwidth, 400);
XtSetArg(arglist[2], XtNheight, 300);
To make it easier to insert and delete entries, you also can
use a variable index:
Arg arglist[10];
Cardinal i=0;
XtSetArg(arglist[i], XtNwidth, 400); i++;
XtSetArg(arglist[i], XtNheight, 300); i++;
The i variable can then be used as the argument list count
in the widget create function. In this example, [4mXtNumber[0m
would return 10, not 2, and therefore is not useful.
Note
You should not use auto-increment or auto-decre-
ment within the first argument to [4mXtSetArg[24m. As it
is currently implemented, [4mXtSetArg[24m is a macro that
dereferences the first argument twice.
The third approach is to individually set the elements of
the argument list array:
Arg arglist[10];
arglist[0].name = XtNwidth;
arglist[0].value = (XtArgVal) 400;
[1m25[0m
[1mAthena Widget Set libXaw 1.0.7[0m
arglist[1].name = XtNheight;
arglist[1].value = (XtArgVal) 300;
Note that in this example, as in the previous example,
[4mXtNumber[24m would return 10, not 2, and therefore would not be
useful.
The fourth approach is to use a mixture of the first and
third approaches: you can statically define the argument
list but modify some entries at runtime. For example:
static Arg arglist[] = {
{XtNwidth, (XtArgVal) 400},
{XtNheight, (XtArgVal) NULL},
};
arglist[1].value = (XtArgVal) 300;
In this example, [4mXtNumber[24m can be used, as in the first
approach, for easier code maintenance.
[4m2.11.[24m [4mExample[24m [4mPrograms[0m
The best way to understand how to use any programming
library is by trying some simple examples. A collection of
example programs that introduces each of the widgets in that
Athena widget set, as well as many important toolkit pro-
gramming concepts, is available in the X11R6 release as dis-
tributed by the X Consortium. It can be found in the dis-
tribution directory [1mcontrib/examples/mit/Xaw[22m, but see your
site administrator for the exact location of these files on
your system. See the README file from that directory for a
guide to the examples.
[1m26[0m
[1mAthena Widget Set libXaw 1.0.7[0m
[1mChapter 3[0m
[1mSimple Widgets[0m
Each of these widgets performs a specific user interface
function. They are [4msimple[24m because they cannot have widget
children--they may only be used as leaves of the widget
tree. These widgets display information or take user input.
[1mCommand [22mA push button that, when selected, may cause a
specific action to take place. This widget can
display a multi-line string or a bitmap or pixmap
image.
[1mGrip [22mA rectangle that, when selected, will cause an
action to take place.
[1mLabel [22mA rectangle that can display a multi-line string
or a bitmap or pixmap image.
[1mList [22mA list of text strings presented in row column
format that may be individually selected. When an
element is selected an action may take place.
[1mPanner [22mA rectangular area containing a [4mslider[24m that may be
moved in two dimensions. Notification of movement
may be continuous or discrete.
[1mRepeater [22mA push button that triggers an action at an
increasing rate when selected. This widget can
display a multi-line string or a bitmap or pixmap
image.
[1mScrollbar [22mA rectangular area containing a [4mthumb[24m that when
slid along one dimension may cause a specific
action to take place. The Scrollbar may be ori-
ented horizontally or vertically.
[1mSimple [22mThe base class for most of the simple widgets.
Provides a rectangular area with a settable mouse
cursor and special border.
[1mStripChart[22mA real time data graph that will automatically
update and scroll.
[1mToggle [22mA push button that contains state information.
Toggles may also be used as ``radio buttons'' to
implement a ``one of many'' or ``zero or one of
[1m27[0m
[1mAthena Widget Set libXaw 1.0.7[0m
many'' group of buttons. This widget can display
a multi-line string or a bitmap or pixmap image.
[4m3.1.[24m [4mCommand[24m [4mWidget[0m
Application header file
Class header file
Class commandWidgetClass
Class Name Command
Superclass Label
The Command widget is an area, often rectangular, that con-
tains text or a graphical image. Command widgets are often
referred to as ``push buttons.'' When the pointer is over a
Command widget, the widget becomes highlighted by drawing a
rectangle around its perimeter. This highlighting indicates
that the widget is ready for selection. When mouse button 1
is pressed, the Command widget indicates that it has been
selected by reversing its foreground and background colors.
When the mouse button is released, the Command widget's
[1mnotify [22maction is invoked, calling all functions on its call-
back list. If the pointer is moved off of the widget before
the pointer button is released, the widget reverts to its
normal foreground and background colors, and releasing the
pointer button has no effect. This behavior allows the user
to cancel an action.
[4m3.1.1.[24m [4mResources[0m
When creating a Command widget instance, the following
resources are retrieved from the argument list or from the
resource database:
-------------------------------------------------------------------------------------------------
[4mName[24m [4mClass[24m [4mType[24m [4mNotesDefault[24m [4mValue[0m
-------------------------------------------------------------------------------------------------
accelerators Accelerators AcceleratorTable NULL
ancestorSensitive AncestorSensitive Boolean D True
background Background Pixel XtDefaultBackground
backgroundPixmap Pixmap Pixmap XtUnspecifiedPixmap
bitmap Bitmap Pixmap None
borderColor BorderColor Pixel XtDefaultForeground
borderPixmap Pixmap Pixmap XtUnspecifiedPixmap
borderWidth BorderWidth Dimension 1
callback Callback XtCallbackList NULL
colormap Colormap Colormap Parent's Colormap
cornerRoundPercent CornerRoundPercentDimension 25
cursor Cursor Cursor None
cursorName Cursor String NULL
[1m28[0m
[1mAthena Widget Set libXaw 1.0.7[0m
-------------------------------------------------------------------------------------------------
[4mName[24m [4mClass[24m [4mType[24m [4mNotesDefault[24m [4mValue[0m
-------------------------------------------------------------------------------------------------
depth Depth int C Parent's Depth
destroyCallback Callback XtCallbackList NULL
encoding Encoding UnsignedChar XawTextEncoding8bit
font Font XFontStruct XtDefaultFont
foreground Foreground Pixel XtDefaultForeground
height Height Dimension A graphic height + 2 * [1minternalHeight[0m
highlightThickness Thickness Dimension A 2 (0 if Shaped)
insensitiveBorder Insensitive Pixmap GreyPixmap
internalHeight Height Dimension 2
internalWidth Width Dimension 4
international International Boolean C False
justify Justify Justify XtJustifyCenter (center)
label Label String name of widget
leftBitmap LeftBitmap Bitmap None
mappedWhenManaged MappedWhenManaged Boolean True
pointerColor Foreground Pixel XtDefaultForeground
pointerColorBackgroundBackground Pixel XtDefaultBackground
resize Resize Boolean True
screen Screen Screen R Parent's Screen
sensitive Sensitive Boolean True
shapeStyle ShapeStyle ShapeStyle Rectangle
translations Translations TranslationTable See below
width Width Dimension A graphic width + 2 * [1minternalWidth[0m
x Position Position 0
y Position Position 0
-------------------------------------------------------------------------------------------------
accelerators A list of event to action bindings to be exe-
cuted by this widget, even though the event
occurred in another widget. (See the [4mX[24m [4mTool-[0m
[4mkit[24m [4mIntrinsics[24m [4m--[24m [4mC[24m [4mLanguage[24m [4mInterface[24m for
details).
ancestorSensitive
The sensitivity state of the ancestors of
this widget. A widget is insensitive if
either it or any of its ancestors is insensi-
tive. This resource should not be changed
with [1mXtSetValues[22m, although it may be queried.
background A pixel value which indexes the widget's col-
ormap to derive the background color of the
widget's window.
backgroundPixmapThe background pixmap of this widget's win-
dow. If this resource is set to anything
other than [1mXtUnspecifiedPixmap[22m, the pixmap
specified will be used instead of the back-
ground color.
[1m29[0m
[1mAthena Widget Set libXaw 1.0.7[0m
bitmap A bitmap to display instead of the [1mlabel[22m.
The default size of the widget will be just
large enough to contain the bitmap and the
widget's internal width and height. The
resource converter for this resource con-
structs bitmaps from the contents of files.
(See [1mConverting Bitmaps [22mfor details.) If
this bitmap is one bit deep then the 1's will
be rendered in the foreground color, and the
0's in the background color. If [1mbitmap [22mhas a
depth greater than one, it is copied directly
into the window.
borderColor A pixel value which indexes the widget's col-
ormap to derive the border color of the wid-
get's window.
borderPixmap The border pixmap of this widget's window.
If this resource is set to anything other
than [1mXtUnspecifiedPixmap[22m, the pixmap speci-
fied will be used instead of the border
color.
borderWidth The width of this widget's window border.
[1mcallback [22mA list of routines to be called when the
[1mnotify [22maction is invoked.
colormap The colormap that this widget will use.
[1mcornerRoundPercent[0m
When a [1mShapeStyle [22mof [1mroundedRectangle [22mis
used, this resource controls the radius of
the rounded corner. The radius of the
rounded corners is specified as a percentage
of the length of the shortest side of the
widget.
cursor The image that will be displayed as the
pointer cursor whenever it is in this widget.
The use of this resource is deprecated in
favor of [1mcursorName[22m.
cursorName The name of the symbol to use to represent
the pointer cursor. This resource will over-
ride the [1mcursor [22mresource if both are speci-
fied. (See 2.4.1)
depth The depth of this widget's window.
destroyCallbackAll functions on this list are called when
this widget is destroyed.
encoding The encoding method used by the value of the
[1m30[0m
[1mAthena Widget Set libXaw 1.0.7[0m
[1mlabel [22mresource. The value may be [1mXawTextEn-[0m
[1mcoding8bit [22mor [1mXawTextEncodingChar2b[22m. When
[1minternational [22mis set to [1mtrue [22mthis resource is
not used.
font The text font to use when displaying the
[1mlabel[22m, when the [1minternational [22mresource is
[1mfalse[22m.
fontSet The text font set to use when displaying the
[1mlabel[22m, when the [1minternational [22mresource is
[1mtrue[22m.
foreground A pixel value which indexes the widget's col-
ormap to derive the foreground color of the
widget's window. This color is also used to
render all 1's in a [1mbitmap [22mone plane deep.
height
width The height and width of this widget in pix-
els.
[1mhighlightThickness[0m
The thickness of the rectangle that is used
to highlight the internal border of this wid-
get, alerting the user that it is ready to be
selected. The default value is 2 pixels if
the [1mshapeStyle [22mis [1mrectangle[22m, and 0 Pixels (no
highlighting) otherwise.
insensitiveBorder
This pixmap will be tiled into the widget's
border if the widget becomes insensitive.
internalHeight
internalWidth The minimum amount of space to leave between
the graphic and the vertical and horizontal
edges of the window.
international This is a boolean flag, only settable at wid-
get creation time. A value of [1mfalse [22msignals
the widget to use pre-R6 internationalization
(specifically, the lack thereof), such as
using fonts for displaying text, etc. A
value of [1mtrue [22mdirects the widget to act in an
internationalized manner, such as utilizing
font sets for displaying text, etc.
justify Specifies left, center, or right alignment of
graphic within the widget. This resource may
be specified with the values [1mXtJustifyLeft[22m,
[1mXtJustifyCenter[22m, or [1mXtJustifyRight[22m. A con-
verter is registered for this resource that
will convert the following strings: [1mleft,[0m
[1m31[0m
[1mAthena Widget Set libXaw 1.0.7[0m
[1mright, [22mand [1mcenter[22m. This resource only has
noticeable effect when the width of the wid-
get is larger than necessary to display the
graphic. Note that when the graphic is a
multi-line [1mlabel[22m, the longest line will obey
this justification while shorter lines will
be left-justified with the longest one.
label Specifies the text string to be displayed in
the widget's window if no bitmap is speci-
fied. The default is the name of this wid-
get. Regardless of the value of [1mencoding [22mor
[1minternational[22m, a single newline character (1
byte) will cause a line break.
leftBitmap Specifies a bitmap to display to the left of
the graphic in the widget's window.
mappedWhenManaged
If this resource is [1mTrue[22m, then the widget's
window will automatically be mapped by the
Toolkit when it is realized and managed.
pointerColor A pixel value which indexes the widget's col-
ormap to derive the foreground color of the
pointer symbol specified by the [1mcursorName[0m
resource.
pointerColorBackground
A pixel value which indexes the widget's
colormap to derive the background color of
the pointer symbol specified by the [1mcursor-[0m
[1mName [22mresource.
resize Specifies whether the widget should attempt
to resize to its preferred dimensions when-
ever its resources are modified with [1mXtSet-[0m
[1mValues[22m. This attempt to resize may be denied
by the parent of this widget. The parent is
always free to resize the widget regardless
of the state of this resource.
screen The screen on which this widget is displayed.
This is not a settable resource.
sensitive Whether or not the toolkit should pass user
events to this widget. The widget will not
get input events if either [1mancestorSensitive[0m
or [1msensitive [22mis [1mFalse[22m.
[1mshapeStyle [22mNonrectangular widgets may be created using
this resource. Nonrectangular widgets are
supported only on a server that supports the
[1m32[0m
[1mAthena Widget Set libXaw 1.0.7[0m
[1mShape Extension[22m. If nonrectangular widgets
are specified for a server lacking this
extension, the shape is ignored and the wid-
gets will be rectangular. The following
shapes are currently supported: [1mXmuShapeRect-[0m
[1mangle[22m, [1mXmuShapeOval[22m, [1mXmuShapeEllipse[22m, and
[1mXmuShapeRoundedRectangle[22m. A converter is
registered for this resource that will con-
vert the following strings: [1mrectangle, oval,[0m
[1mellipse, [22mand [1mroundedRectangle[22m.
translations The event bindings associated with this wid-
get.
x
y The location of the upper left outside corner
of this widget in its parent.
[4m3.1.2.[24m [4mCommand[24m [4mActions[0m
The Command widget supports the following actions:
+o Switching the button's interior between the foreground
and background colors with [1mset[22m, [1munset[22m, and [1mreset[22m.
+o Processing application callbacks with [1mnotify[0m
+o Switching the internal border between highlighted and
unhighlighted states with [1mhighlight [22mand [1munhighlight[0m
The following are the default translation bindings used by
the Command widget:
: highlight()
: reset()
: set()
: notify() unset()
The full list of actions supported by Command is:
[1mhighlight[22m([4mcondition[24m)
Displays the internal highlight border in the
color ([1mforeground [22mor [1mbackground [22m) that con-
trasts with the interior color of the Command
widget. The conditions [1mWhenUnset [22mand [1mAlways[0m
are understood by this action procedure. If
no argument is passed, [1mWhenUnset [22mis assumed.
[1munhighlight[22m() Displays the internal highlight border in the
color ([1mforeground [22mor [1mbackground [22m) that
matches the interior color of the Command
widget.
[1m33[0m
[1mAthena Widget Set libXaw 1.0.7[0m
[1mset[22m() Enters the [4mset[24m state, in which [1mnotify [22mis pos-
sible. This action causes the button to dis-
play its interior in the [1mforeground [22mcolor.
The label or bitmap is displayed in the [1mback-[0m
[1mground [22mcolor.
[1munset[22m() Cancels the [4mset[24m state and displays the inte-
rior of the button in the [1mbackground [22mcolor.
The label or bitmap is displayed in the [1mfore-[0m
[1mground [22mcolor.
[1mreset[22m() Cancels any [4mset[24m or [4mhighlight[24m and displays the
interior of the button in the [1mbackground[0m
color, with the label or bitmap displayed in
the [1mforeground [22mcolor.
[1mnotify[22m() When the button is in the [1mset [22mstate this
action calls all functions in the callback
list named by the [1mcallback [22mresource. The
value of the [4mcall_data[24m argument passed to
these functions is undefined.
A very common alternative to registering callbacks is to
augment a Command's translations with an action performing
the desired function. This often takes the form of:
*Myapp*save.translations: #augment ,: Save()
Note
When a bitmap of depth greater that one (1) is
specified the [4mset[24m(), [4munset[24m(), and [4mreset[24m() actions
have no effect, since there are no foreground and
background colors used in a multi-plane pixmap.
[4m3.2.[24m [4mGrip[24m [4mWidget[0m
Application header file
Class header file
Class gripWidgetClass
Class Name Grip
Superclass Simple
The Grip widget provides a small rectangular region in which
user input events (such as ButtonPress or ButtonRelease) may
be handled. The most common use for the Grip widget is as
an attachment point for visually repositioning an object,
[1m34[0m
[1mAthena Widget Set libXaw 1.0.7[0m
such as the pane border in a Paned widget.
[4m3.2.1.[24m [4mResources[0m
When creating a Grip widget instance, the following
resources are retrieved from the argument list or from the
resource database:
---------------------------------------------------------------------------------
[4mName[24m [4mClass[24m [4mType[24m [4mNotesDefault[24m [4mValue[0m
---------------------------------------------------------------------------------
accelerators Accelerators AcceleratorTable NULL
ancestorSensitive AncestorSensitiveBoolean D True
background Background Pixel XtDefaultBackground
backgroundPixmap Pixmap Pixmap XtUnspecifiedPixmap
borderColor BorderColor Pixel XtDefaultForeground
borderPixmap Pixmap Pixmap XtUnspecifiedPixmap
borderWidth BorderWidth Dimension 0
callback Callback Callback NULL
colormap Colormap Colormap Parent's Colormap
cursor Cursor Cursor None
cursorName Cursor String NULL
depth Depth int C Parent's Depth
destroyCallback Callback XtCallbackList NULL
foreground Foreground Pixel XtDefaultForeground
height Height Dimension 8
insensitiveBorder Insensitive Pixmap GreyPixmap
international International Boolean C False
mappedWhenManaged MappedWhenManagedBoolean True
pointerColor Foreground Pixel XtDefaultForeground
pointerColorBackgroundBackground Pixel XtDefaultBackground
screen Screen Screen R Parent's Screen
sensitive Sensitive Boolean True
translations Translations TranslationTable NULL
width Width Dimension 8
x Position Position 0
y Position Position 0
---------------------------------------------------------------------------------
accelerators A list of event to action bindings to be exe-
cuted by this widget, even though the event
occurred in another widget. (See the [4mX[24m [4mTool-[0m
[4mkit[24m [4mIntrinsics[24m [4m--[24m [4mC[24m [4mLanguage[24m [4mInterface[24m for
details).
ancestorSensitive
The sensitivity state of the ancestors of
this widget. A widget is insensitive if
either it or any of its ancestors is insensi-
tive. This resource should not be changed
with [1mXtSetValues[22m, although it may be queried.
[1m35[0m
[1mAthena Widget Set libXaw 1.0.7[0m
background A pixel value which indexes the widget's col-
ormap to derive the background color of the
widget's window.
backgroundPixmapThe background pixmap of this widget's win-
dow. If this resource is set to anything
other than [1mXtUnspecifiedPixmap[22m, the pixmap
specified will be used instead of the back-
ground color.
borderColor A pixel value which indexes the widget's col-
ormap to derive the border color of the wid-
get's window.
borderPixmap The border pixmap of this widget's window.
If this resource is set to anything other
than [1mXtUnspecifiedPixmap[22m, the pixmap speci-
fied will be used instead of the border
color.
borderWidth The width of this widget's window border.
[1mcallback [22mAll routines on this list are called whenever
the [1mGripAction [22maction routine is invoked.
The [4mcall_data[24m contains all information passed
to the action routine. A detailed descrip-
tion is given below in the [1mGrip Actions [22msec-
tion.
colormap The colormap that this widget will use.
cursor The image that will be displayed as the
pointer cursor whenever it is in this widget.
The use of this resource is deprecated in
favor of [1mcursorName[22m.
cursorName The name of the symbol to use to represent
the pointer cursor. This resource will over-
ride the [1mcursor [22mresource if both are speci-
fied. (See 2.4.1)
depth The depth of this widget's window.
destroyCallbackAll functions on this list are called when
this widget is destroyed.
[1mforeground [22mA pixel value which indexes the widget's col-
ormap to derive the color used to flood fill
the entire Grip widget.
height
width The height and width of this widget in pix-
els.
[1m36[0m
[1mAthena Widget Set libXaw 1.0.7[0m
insensitiveBorder
This pixmap will be tiled into the widget's
border if the widget becomes insensitive.
international This is a boolean flag, only settable at wid-
get creation time. While not utilized in
this widget, it can and should be checked by
any subclasses that have behavior that should
vary with locale.
mappedWhenManaged
If this resource is [1mTrue[22m, then the widget's
window will automatically be mapped by the
Toolkit when it is realized and managed.
pointerColor A pixel value which indexes the widget's col-
ormap to derive the foreground color of the
pointer symbol specified by the [1mcursorName[0m
resource.
pointerColorBackground
A pixel value which indexes the widget's
colormap to derive the background color of
the pointer symbol specified by the [1mcursor-[0m
[1mName [22mresource.
screen The screen on which this widget is displayed.
This is not a settable resource.
sensitive Whether or not the toolkit should pass user
events to this widget. The widget will not
get input events if either [1mancestorSensitive[0m
or [1msensitive [22mis [1mFalse[22m.
translations The event bindings associated with this wid-
get.
x
y The location of the upper left outside corner
of this widget in its parent.
[4m3.2.2.[24m [4mGrip[24m [4mActions[0m
The Grip widget does not declare any default event transla-
tion bindings, but it does declare a single action routine
named [1mGripAction[22m. The client specifies an arbitrary event
translation table, optionally giving parameters to the [1mGri-[0m
[1mpAction [22mroutine.
The [1mGripAction [22mroutine executes the callbacks on the [1mcall-[0m
[1mback [22mlist, passing as [4mcall_data[24m a pointer to a [1mXawGripCall-[0m
[1mData [22mstructure, defined in the Grip widget's application
header file.
[1m37[0m
[1mAthena Widget Set libXaw 1.0.7[0m
typedef struct _XawGripCallData {
XEvent *event;
String *params;
Cardinal num_params;
} XawGripCallDataRec, *XawGripCallData,
GripCallDataRec, *GripCallData; /* supported for R4 compatibility */
In this structure, the [4mevent[24m is a pointer to the input event
that triggered the action. [4mparams[24m and [4mnum_params[24m give the
string parameters specified in the translation table for the
particular event binding.
The following is an example of a translation table that uses
the GripAction:
: GripAction(press)
: GripAction(move)
: GripAction(release)
For a complete description of the format of translation
tables, see the [4mX[24m [4mToolkit[24m [4mIntrinsics[24m [4m--[24m [4mC[24m [4mLanguage[24m [4mInter-[0m
[4mface[24m.
[4m3.3.[24m [4mLabel[24m [4mWidget[0m
Application header file
Class header file
Class labelWidgetClass
Class Name Label
Superclass Simple
A Label widget holds a graphic displayed within a rectangu-
lar region of the screen. The graphic may be a text string
containing multiple lines of characters in an 8 bit or 16
bit character set (to be displayed with a [4mfont[24m), or in a
multi-byte encoding (for use with a [4mfontset[24m). The graphic
may also be a bitmap or pixmap. The Label widget will allow
its graphic to be left, right, or center justified. Nor-
mally, this widget can be neither selected nor directly
edited by the user. It is intended for use as an output
device only.
[4m3.3.1.[24m [4mResources[0m
When creating a Label widget instance, the following
resources are retrieved from the argument list or from the
[1m38[0m
[1mAthena Widget Set libXaw 1.0.7[0m
resource database:
------------------------------------------------------------------------------------------------
[4mName[24m [4mClass[24m [4mType[24m [4mNotesDefault[24m [4mValue[0m
------------------------------------------------------------------------------------------------
accelerators Accelerators AcceleratorTable NULL
ancestorSensitive AncestorSensitiveBoolean D True
background Background Pixel XtDefaultBackground
backgroundPixmap Pixmap Pixmap XtUnspecifiedPixmap
bitmap Bitmap Pixmap None
borderColor BorderColor Pixel XtDefaultForeground
borderPixmap Pixmap Pixmap XtUnspecifiedPixmap
borderWidth BorderWidth Dimension 1
colormap Colormap Colormap Parent's Colormap
cursor Cursor Cursor None
cursorName Cursor String NULL
depth Depth int C Parent's Depth
destroyCallback Callback XtCallbackList NULL
encoding Encoding UnsignedChar XawTextEncoding8bit
font Font XFontStruct XtDefaultFont
fontSet FontSet XFontSet XtDefaultFontSet
foreground Foreground Pixel XtDefaultForeground
height Height Dimension A graphic height + 2 * [1minternalHeight[0m
insensitiveBorder Insensitive Pixmap GreyPixmap
internalHeight Height Dimension 2
internalWidth Width Dimension 4
international International Boolean C False
justify Justify Justify XtJustifyCenter (center)
label Label String name of widget
leftBitmap LeftBitmap Bitmap None
mappedWhenManaged MappedWhenManagedBoolean True
pointerColor Foreground Pixel XtDefaultForeground
pointerColorBackgroundBackground Pixel XtDefaultBackground
resize Resize Boolean True
screen Screen Screen R Parent's Screen
sensitive Sensitive Boolean True
translations Translations TranslationTable See above
width Width Dimension A graphic width + 2 * [1minternalWidth[0m
x Position Position 0
y Position Position 0
------------------------------------------------------------------------------------------------
accelerators A list of event to action bindings to be exe-
cuted by this widget, even though the event
occurred in another widget. (See the [4mX[24m [4mTool-[0m
[4mkit[24m [4mIntrinsics[24m [4m--[24m [4mC[24m [4mLanguage[24m [4mInterface[24m for
details).
ancestorSensitive
The sensitivity state of the ancestors of
this widget. A widget is insensitive if
either it or any of its ancestors is
[1m39[0m
[1mAthena Widget Set libXaw 1.0.7[0m
insensitive. This resource should not be
changed with [1mXtSetValues[22m, although it may be
queried.
background A pixel value which indexes the widget's col-
ormap to derive the background color of the
widget's window.
backgroundPixmapThe background pixmap of this widget's win-
dow. If this resource is set to anything
other than [1mXtUnspecifiedPixmap[22m, the pixmap
specified will be used instead of the back-
ground color.
[1mbitmap [22mA bitmap to display instead of the [1mlabel[22m.
The default size of the widget will be just
large enough to contain the bitmap and the
widget's internal width and height. The
resource converter for this resource con-
structs bitmaps from the contents of files.
(See [1mConverting Bitmaps [22mfor details.) If
this bitmap is one bit deep then the 1's will
be rendered in the foreground color, and the
0's in the background color. If [1mbitmap [22mhas a
depth greater than one, it is copied directly
into the window.
borderColor A pixel value which indexes the widget's col-
ormap to derive the border color of the wid-
get's window.
borderPixmap The border pixmap of this widget's window.
If this resource is set to anything other
than [1mXtUnspecifiedPixmap[22m, the pixmap speci-
fied will be used instead of the border
color.
borderWidth The width of this widget's window border.
colormap The colormap that this widget will use.
cursor The image that will be displayed as the
pointer cursor whenever it is in this widget.
The use of this resource is deprecated in
favor of [1mcursorName[22m.
cursorName The name of the symbol to use to represent
the pointer cursor. This resource will over-
ride the [1mcursor [22mresource if both are speci-
fied. (See 2.4.1)
depth The depth of this widget's window.
destroyCallbackAll functions on this list are called when
[1m40[0m
[1mAthena Widget Set libXaw 1.0.7[0m
this widget is destroyed.
[1mencoding [22mThe encoding method used by the value of the
[1mlabel [22mresource. The value may be [1mXawTextEn-[0m
[1mcoding8bit [22mor [1mXawTextEncodingChar2b[22m. When
[1minternational [22mis set to [1mtrue [22mthis resource is
not used.
[1mfont [22mThe text font to use when displaying the
[1mlabel[22m, when the [1minternational [22mresource is
[1mfalse[22m.
[1mfontSet [22mThe text font set to use when displaying the
[1mlabel[22m, when the [1minternational [22mresource is
[1mtrue[22m.
[1mforeground [22mA pixel value which indexes the widget's col-
ormap to derive the foreground color of the
widget's window. This color is also used to
render all 1's in a [1mbitmap [22mone plane deep.
height
width The height and width of this widget in pix-
els.
insensitiveBorder
This pixmap will be tiled into the widget's
border if the widget becomes insensitive.
[1minternalHeight[0m
[1minternalWidth [22mThe minimum amount of space to leave between
the graphic and the vertical and horizontal
edges of the window.
international This is a boolean flag, only settable at wid-
get creation time. A value of [1mfalse [22msignals
the widget to use pre-R6 internationalization
(specifically, the lack thereof), such as
using fonts for displaying text, etc. A
value of [1mtrue [22mdirects the widget to act in an
internationalized manner, such as utilizing
font sets for displaying text, etc.
[1mjustify [22mSpecifies left, center, or right alignment of
graphic within the widget. This resource may
be specified with the values [1mXtJustifyLeft[22m,
[1mXtJustifyCenter[22m, or [1mXtJustifyRight[22m. A con-
verter is registered for this resource that
will convert the following strings: [1mleft,[0m
[1mright, [22mand [1mcenter[22m. This resource only has
noticeable effect when the width of the wid-
get is larger than necessary to display the
graphic. Note that when the graphic is a
multi-line [1mlabel[22m, the longest line will obey
[1m41[0m
[1mAthena Widget Set libXaw 1.0.7[0m
this justification while shorter lines will
be left-justified with the longest one.
[1mlabel [22mSpecifies the text string to be displayed in
the widget's window if no bitmap is speci-
fied. The default is the name of this wid-
get. Regardless of the value of [1mencoding [22mor
[1minternational[22m, a single newline character (1
byte) will cause a line break.
[1mleftBitmap [22mSpecifies a bitmap to display to the left of
the graphic in the widget's window.
mappedWhenManaged
If this resource is [1mTrue[22m, then the widget's
window will automatically be mapped by the
Toolkit when it is realized and managed.
pointerColor A pixel value which indexes the widget's col-
ormap to derive the foreground color of the
pointer symbol specified by the [1mcursorName[0m
resource.
pointerColorBackground
A pixel value which indexes the widget's
colormap to derive the background color of
the pointer symbol specified by the [1mcursor-[0m
[1mName [22mresource.
[1mresize [22mSpecifies whether the widget should attempt
to resize to its preferred dimensions when-
ever its resources are modified with [1mXtSet-[0m
[1mValues[22m. This attempt to resize may be denied
by the parent of this widget. The parent is
always free to resize the widget regardless
of the state of this resource.
screen The screen on which this widget is displayed.
This is not a settable resource.
sensitive Whether or not the toolkit should pass user
events to this widget. The widget will not
get input events if either [1mancestorSensitive[0m
or [1msensitive [22mis [1mFalse[22m.
translations The event bindings associated with this wid-
get.
x
y The location of the upper left outside corner
of this widget in its parent.
[1m42[0m
[1mAthena Widget Set libXaw 1.0.7[0m
[4m3.4.[24m [4mList[24m [4mWidget[0m
Application header file
Class header file
Class listWidgetClass
Class Name List
Superclass Simple
The List widget contains a list of strings formatted into
rows and columns. When one of the strings is selected, it is
highlighted, and the List widget's [1mNotify [22maction is invoked,
calling all routines on its callback list. Only one string
may be selected at a time.
[4m3.4.1.[24m [4mResources[0m
When creating a List widget instance, the following
resources are retrieved from the argument list or from the
resource database:
----------------------------------------------------------------------------------------------
[4mName[24m [4mClass[24m [4mType[24m [4mNotesDefault[24m [4mValue[0m
----------------------------------------------------------------------------------------------
accelerators Accelerators AcceleratorTable NULL
ancestorSensitive AncestorSensitiveBoolean D True
background Background Pixel XtDefaultBackground
backgroundPixmap Pixmap Pixmap XtUnspecifiedPixmap
borderColor BorderColor Pixel XtDefaultForeground
borderPixmap Pixmap Pixmap XtUnspecifiedPixmap
borderWidth BorderWidth Dimension 1
callback Callback Callback NULL
colormap Colormap Colormap Parent's Colormap
columnSpacing Spacing Dimension 6
cursor Cursor Cursor XC_left_ptr
cursorName Cursor String NULL
defaultColumns Columns int 2
depth Depth int C Parent's Depth
destroyCallback Callback XtCallbackList NULL
font Font FontStruct XtDefaultFont
fontSet FontSet XFontSet XtDefaultFontSet
forceColumns Columns Boolean False
foreground Foreground Pixel XtDefaultForeground
height Height Dimension A Enough space to contain the list
insensitiveBorder Insensitive Pixmap GreyPixmap
internalHeight Height Dimension 2
internalWidth Width Dimension 4
international International Boolean C False
[1m43[0m
[1mAthena Widget Set libXaw 1.0.7[0m
----------------------------------------------------------------------------------------------
[4mName[24m [4mClass[24m [4mType[24m [4mNotesDefault[24m [4mValue[0m
----------------------------------------------------------------------------------------------
list List Pointer name of widget
longest Longest int A 0
mappedWhenManaged MappedWhenManagedBoolean True
numberStrings NumberStrings int A computed for NULL terminated list
pasteBuffer Boolean Boolean False
pointerColor Foreground Pixel XtDefaultForeground
pointerColorBackgroundBackground Pixel XtDefaultBackground
rowSpacing Spacing Dimension 2
screen Screen Screen R Parent's Screen
sensitive Sensitive Boolean True
translations Translations TranslationTable See below
verticalList Boolean Boolean False
width Width Dimension A Enough space to contain the list
x Position Position 0
y Position Position 0
----------------------------------------------------------------------------------------------
accelerators A list of event to action bindings to be exe-
cuted by this widget, even though the event
occurred in another widget. (See the [4mX[24m [4mTool-[0m
[4mkit[24m [4mIntrinsics[24m [4m--[24m [4mC[24m [4mLanguage[24m [4mInterface[24m for
details).
ancestorSensitive
The sensitivity state of the ancestors of
this widget. A widget is insensitive if
either it or any of its ancestors is insensi-
tive. This resource should not be changed
with [1mXtSetValues[22m, although it may be queried.
background A pixel value which indexes the widget's col-
ormap to derive the background color of the
widget's window.
backgroundPixmapThe background pixmap of this widget's win-
dow. If this resource is set to anything
other than [1mXtUnspecifiedPixmap[22m, the pixmap
specified will be used instead of the back-
ground color.
borderColor A pixel value which indexes the widget's col-
ormap to derive the border color of the wid-
get's window.
borderPixmap The border pixmap of this widget's window.
If this resource is set to anything other
than [1mXtUnspecifiedPixmap[22m, the pixmap speci-
fied will be used instead of the border
color.
[1m44[0m
[1mAthena Widget Set libXaw 1.0.7[0m
borderWidth The width of this widget's window border.
[1mcallback [22mAll functions on this list are called when-
ever the [1mnotify [22maction is invoked. The
[4mcall_data[24m argument contains information about
the element selected and is described in
detail in the [1mList Callbacks [22msection.
colormap The colormap that this widget will use.
[1mcolumnSpacing[0m
[1mrowSpacing [22mThe amount of space, in pixels, between each
of the rows and columns in the list.
cursor The image that will be displayed as the
pointer cursor whenever it is in this widget.
The use of this resource is deprecated in
favor of [1mcursorName[22m.
cursorName The name of the symbol to use to represent
the pointer cursor. This resource will over-
ride the [1mcursor [22mresource if both are speci-
fied. (See 2.4.1)
[1mdefaultColumns [22mThe default number of columns. This value is
used when neither the width nor the height of
the List widget is specified or when
[1mforceColumns [22mis [1mTrue[22m.
depth The depth of this widget's window.
destroyCallbackAll functions on this list are called when
this widget is destroyed.
[1mfont [22mThe text font to use when displaying the
[1mlist[22m, when the [1minternational [22mresource is
[1mfalse[22m.
[1mfontSet [22mThe text font set to use when displaying the
[1mlist[22m, when the [1minternational [22mresource is
[1mtrue[22m.
[1mforceColumns [22mForces the default number of columns to be
used regardless of the List widget's current
size.
[1mforeground [22mA pixel value which indexes the widget's col-
ormap to derive the color used to paint the
text of the list elements.
height
width The height and width of this widget in pix-
els.
[1m45[0m
[1mAthena Widget Set libXaw 1.0.7[0m
insensitiveBorder
This pixmap will be tiled into the widget's
border if the widget becomes insensitive.
internalHeight
internalWidth The margin, in pixels, between the edges of
the list and the corresponding edge of the
List widget's window.
[1mlist [22mAn array of text strings displayed in the
List widget. If [1mnumberStrings [22mis zero (the
default) then the [1mlist [22mmust be NULL termi-
nated. If a value is not specified for the
[1mlist[22m, then [1mnumberStrings [22mis set to 1, and the
name of the widget is used as the [1mlist[22m, and
[1mlongest [22mis set to the length of the name of
the widget. The [1mlist [22mis used in place, and
must be available to the List widget for the
lifetime of this widget, or until it is
changed with [1mXtSetValues [22mor [1mXawListChange[22m.
international This is a boolean flag, only settable at wid-
get creation time. A value of [1mfalse [22msignals
the widget to use pre-R6 internationalization
(specifically, the lack thereof), such as
using fonts for displaying text, etc. A
value of [1mtrue [22mdirects the widget to act in an
internationalized manner, such as utilizing
font sets for displaying text, etc.
[1mlongest [22mSpecifies the width, in pixels, of the long-
est string in the current list. The List
widget will compute this value if zero (the
default) is specified. If this resource is
set by hand, entries longer than this will be
clipped to fit.
mappedWhenManaged
If this resource is [1mTrue[22m, then the widget's
window will automatically be mapped by the
Toolkit when it is realized and managed.
[1mnumberStrings [22mThe number of strings in the current list.
If a value of zero (the default) is speci-
fied, the List widget will compute it. When
computing the number of strings the List wid-
get assumes that the [1mlist [22mis NULL terminated.
[1mpasteBuffer [22mIf this resource is set to [1mTrue [22mthen the name
of the currently selected list element will
be put into [1mCUT_BUFFER_0[22m.
pointerColor A pixel value which indexes the widget's col-
ormap to derive the foreground color of the
[1m46[0m
[1mAthena Widget Set libXaw 1.0.7[0m
pointer symbol specified by the [1mcursorName[0m
resource.
pointerColorBackground
A pixel value which indexes the widget's
colormap to derive the background color of
the pointer symbol specified by the [1mcursor-[0m
[1mName [22mresource.
screen The screen on which this widget is displayed.
This is not a settable resource.
sensitive Whether or not the toolkit should pass user
events to this widget. The widget will not
get input events if either [1mancestorSensitive[0m
or [1msensitive [22mis [1mFalse[22m.
translations The event bindings associated with this wid-
get.
[1mverticalList [22mIf this resource is set to [1mTrue [22mthen the list
elements will be presented in column major
order.
x
y The location of the upper left outside corner
of this widget in its parent.
[4m3.4.2.[24m [4mList[24m [4mActions[0m
The List widget supports the following actions:
+o Highlighting and unhighlighting the list element under
the pointer with [1mSet [22mand [1mUnset[0m
+o Processing application callbacks with [1mNotify[0m
The following is the default translation table used by the
List Widget:
,: Set() Notify()
The full list of actions supported by List widget is:
[1mSet[22m() [4mSets[24m the list element that is currently under
the pointer. To inform the user that this
element is currently set, it is drawn with
foreground and background colors reversed.
If this action is called when there is no
list element under the cursor, the currently
[4mset[24m element will be [4munset[24m.
[1m47[0m
[1mAthena Widget Set libXaw 1.0.7[0m
[1mUnset[22m() Cancels the [4mset[24m state of the element under
the pointer, and redraws it with normal fore-
ground and background colors.
[1mNotify[22m() Calls all callbacks on the List widget's
callback list. Information about the cur-
rently selected list element is passed in the
[4mcall_data[24m argument (see [1mList Callbacks[0m
below).
[4m3.4.3.[24m [4mList[24m [4mCallbacks[0m
All procedures on the List widget's callback list will have
a [1mXawListReturnStruct [22mpassed to them as [4mcall_data[24m. The
structure is defined in the List widget's application header
file.
typedef struct _XawListReturnStruct {
String string; /* string shown in the list. */
int list_index; /* index of the item selected. */
} XawListReturnStruct;
Note
The [4mlist_index[24m item used to be called simply [4mindex[24m.
Unfortunately, this name collided with a global name defined on some
operating systems, and had to be changed.
[4m3.4.4.[24m [4mChanging[24m [4mthe[24m [4mList[0m
To change the list that is displayed, use [4mXawListChange[24m.
void XawListChange([4mw[24m, [4mlist[24m, [4mnitems[24m, [4mlongest[24m, [4mresize[24m)
Widget [4mw[24m;
String * [4mlist[24m;
int [4mnitems[24m, [4mlongest[24m;
Boolean [4mresize[24m;
[4mw[24m Specifies the List widget.
[4mlist[24m Specifies the new list for the List widget to dis-
play.
[4mnitems[24m Specifies the number of items in the [4mlist[24m. If a
value less than 1 is specified, [4mlist[24m must be NULL
terminated, and the number of items will be calcu-
lated by the List widget.
[4mlongest[24m Specifies the length of the longest item in the
[4mlist[24m in pixels. If a value less than 1 is
[1m48[0m
[1mAthena Widget Set libXaw 1.0.7[0m
specified, the List widget will calculate the
value.
[4mresize[24m Specifies a Boolean value that if [1mTrue [22mindicates
that the List widget should try to resize itself
after making the change. The constraints of the
List widget's parent are always enforced, regard-
less of the value specified here.
[4mXawListChange[24m will [4munset[24m all list elements that are cur-
rently [1mset [22mbefore the list is actually changed. The [4mlist[24m is
used in place, and must remain usable for the lifetime of
the List widget, or until [4mlist[24m has been changed again with
this function or with [1mXtSetValues[22m.
[4m3.4.5.[24m [4mHighlighting[24m [4man[24m [4mItem[0m
To highlight an item in the list, use [4mXawListHighlight[24m.
void XawListHighlight([4mw[24m, [4mitem[24m)
Widget [4mw[24m;
int [4mitem[24m;
[4mw[24m Specifies the List widget.
[4mitem[24m Specifies an index into the current list that
indicates the item to be highlighted.
Only one item can be highlighted at a time. If an item is
already highlighted when [4mXawListHighlight[24m is called, the
highlighted item is unhighlighted before the new item is
highlighted.
[4m3.4.6.[24m [4mUnhighlighting[24m [4man[24m [4mItem[0m
To unhighlight the currently highlighted item in the list,
use [4mXawListUnhighlight[24m.
void XawListUnhighlight([4mw[24m)
Widget [4mw[24m;
[4mw[24m Specifies the List widget.
[4m3.4.7.[24m [4mRetrieving[24m [4mthe[24m [4mCurrently[24m [4mSelected[24m [4mItem[0m
To retrieve the list element that is currently [4mset[24m, use
[4mXawListShowCurrent[24m.
XawListReturnStruct *XawListShowCurrent([4mw[24m)
Widget [4mw[24m;
[1m49[0m
[1mAthena Widget Set libXaw 1.0.7[0m
[4mw[24m Specifies the List widget.
[4mXawListShowCurrent[24m returns a pointer to an [4mXawListReturn-[0m
[4mStruct[24m structure, containing the currently highlighted item.
If the value of the index member is XAW_LIST_NONE, the
string member is undefined, and no item is currently
selected.
[4m3.4.8.[24m [4mRestrictions[0m
Many programmers create a ``scrolled list'' by putting a
List widget with many entries as a child of a Viewport wid-
get. The List continues to create a window as big as its
contents, but that big window is only visible where it
intersects the parent Viewport's window. (I.e., it is
``clipped.'')
While this is a useful technique, there is a serious draw-
back. X does not support windows above 32,767 pixels in
width or height, but this height limit will be exceeded by a
List's window when the List has many entries (i.e., with a
12 point font, about 3000 entries would be too many.)
[4m3.5.[24m [4mPanner[24m [4mWidget[0m
Application header file
Class header file
Class pannerWidgetClass
Class Name Panner
Superclass Simple
A Panner widget is a rectangle, called the ``canvas,'' on
which another rectangle, the ``slider,'' moves in two dimen-
sions. It is often used with a Porthole widget to move, or
``scroll,'' a third widget in two dimensions, in which case
the slider's size and position gives feedback as to what
portion of the third widget is visible.
The slider may be scrolled around the canvas by pressing,
dragging, and releasing Button1; the default translation
also enables scrolling via arrow keys and some other keys.
While scrolling is in progress, the application receives
notification through callback procedures. Notification may
be done either continuously whenever the slider moves or
discretely whenever the slider has been given a new loca-
tion.
[1m50[0m
[1mAthena Widget Set libXaw 1.0.7[0m
[4m3.5.1.[24m [4mResources[0m
When creating a Panner widget instance, the following
resources are retrieved from the argument list or from the
resource database:
-----------------------------------------------------------------------------------
[4mName[24m [4mClass[24m [4mType[24m [4mNotesDefault[24m [4mValue[0m
-----------------------------------------------------------------------------------
accelerators Accelerators AcceleratorTable NULL
allowOff AllowOff Boolean False
ancestorSensitive AncestorSensitiveBoolean D True
background Background Pixel XtDefaultBackground
backgroundPixmap Pixmap Pixmap XtUnspecifiedPixmap
backgroundStipple BackgroundStippleString NULL
borderColor BorderColor Pixel XtDefaultForeground
borderPixmap Pixmap Pixmap XtUnspecifiedPixmap
borderWidth BorderWidth Dimension 1
canvasHeight CanvasHeight Dimension 0
canvasWidth CanvasWidth Dimension 0
colormap Colormap Colormap Parent's Colormap
cursor Cursor Cursor None
cursorName Cursor String NULL
defaultScale DefaultScale Dimension 8
depth Depth int C Parent's Depth
destroyCallback Callback XtCallbackList NULL
foreground Foreground Pixel XtDefaultForeground
height Height Dimension A depends on orientation
internalSpace InternalSpace Dimension 4
international International Boolean C False
lineWidth LineWidth Dimension 0
mappedWhenManaged MappedWhenManagedBoolean True
pointerColor Foreground Pixel XtDefaultForeground
pointerColorBackgroundBackground Pixel XtDefaultBackground
reportCallback ReportCallback Callback NULL
resize Resize Boolean True
rubberBand RubberBand Boolean False
screen Screen Screen R Parent's Screen
sensitive Sensitive Boolean True
shadowColor ShadowColor Pixel XtDefaultForeground
shadowThickness ShadowThickness Dimension 2
sliderX SliderX Position 0
sliderY SliderY Position 0
sliderHeight SliderHeight Dimension 0
sliderWidth SliderWidth Dimension 0
translations Translations TranslationTable See below
width Width Dimension A depends on orientation
x Position Position 0
y Position Position 0
-----------------------------------------------------------------------------------
accelerators A list of event to action bindings to be
[1m51[0m
[1mAthena Widget Set libXaw 1.0.7[0m
executed by this widget, even though the
event occurred in another widget. (See the [4mX[0m
[4mToolkit[24m [4mIntrinsics[24m [4m--[24m [4mC[24m [4mLanguage[24m [4mInterface[0m
for details).
[1mallowOff [22mWhether to allow the edges of the slider to
go off the edges of the canvas.
ancestorSensitive
The sensitivity state of the ancestors of
this widget. A widget is insensitive if
either it or any of its ancestors is insensi-
tive. This resource should not be changed
with [1mXtSetValues[22m, although it may be queried.
background A pixel value which indexes the widget's col-
ormap to derive the background color of the
widget's window.
backgroundPixmapThe background pixmap of this widget's win-
dow. If this resource is set to anything
other than [1mXtUnspecifiedPixmap[22m, the pixmap
specified will be used instead of the back-
ground color.
[1mbackgroundStipple[0m
The name of a bitmap pattern to be used as
the background for the area representing the
canvas.
borderColor A pixel value which indexes the widget's col-
ormap to derive the border color of the wid-
get's window.
borderPixmap The border pixmap of this widget's window.
If this resource is set to anything other
than [1mXtUnspecifiedPixmap[22m, the pixmap speci-
fied will be used instead of the border
color.
borderWidth The width of this widget's window border.
[1mcanvasHeight[0m
[1mcanvasWidth [22mThe size of the canvas.
colormap The colormap that this widget will use.
cursor The image that will be displayed as the
pointer cursor whenever it is in this widget.
The use of this resource is deprecated in
favor of [1mcursorName[22m.
cursorName The name of the symbol to use to represent
the pointer cursor. This resource will
[1m52[0m
[1mAthena Widget Set libXaw 1.0.7[0m
override the [1mcursor [22mresource if both are
specified. (See 2.4.1)
[1mdefaultScale [22mThe percentage size that the Panner widget
should have relative to the size of the can-
vas.
depth The depth of this widget's window.
destroyCallbackAll functions on this list are called when
this widget is destroyed.
[1mforeground [22mA pixel value which indexes the widget's col-
ormap to derive the color used to draw the
slider.
height
width The height and width of this widget in pix-
els.
[1minternalSpace [22mThe width of internal border in pixels
between a slider representing the full size
of the canvas and the edge of the Panner wid-
get.
international This is a boolean flag, only settable at wid-
get creation time. While not utilized in
this widget, it can and should be checked by
any subclasses that have behavior that should
vary with locale.
[1mlineWidth [22mThe width of the lines in the rubberbanding
rectangle when rubberbanding is in effect
instead of continuous scrolling. The default
is 0.
mappedWhenManaged
If this resource is [1mTrue[22m, then the widget's
window will automatically be mapped by the
Toolkit when it is realized and managed.
pointerColor A pixel value which indexes the widget's col-
ormap to derive the foreground color of the
pointer symbol specified by the [1mcursorName[0m
resource.
pointerColorBackground
A pixel value which indexes the widget's
colormap to derive the background color of
the pointer symbol specified by the [1mcursor-[0m
[1mName [22mresource.
[1mreportCallback [22mAll functions on this callback list are
called when the [1mnotify [22maction is invoked.
[1m53[0m
[1mAthena Widget Set libXaw 1.0.7[0m
See the [1mPanner Actions [22msection for details.
[1mresize [22mWhether or not to resize the panner whenever
the canvas size is changed so that the
[1mdefaultScale [22mis maintained.
[1mrubberBand [22mWhether or not scrolling should be discrete
(only moving a rubberbanded rectangle until
the scrolling is done) or continuous (moving
the slider itself). This controls whether or
not the [1mmove [22maction procedure also invokes
the [1mnotify [22maction procedure.
screen The screen on which this widget is displayed.
This is not a settable resource.
sensitive Whether or not the toolkit should pass user
events to this widget. The widget will not
get input events if either [1mancestorSensitive[0m
or [1msensitive [22mis [1mFalse[22m.
[1mshadowColor [22mThe color of the shadow underneath the
slider.
[1mshadowThickness[22mThe width of the shadow underneath the
slider.
[1msliderX[0m
[1msliderY [22mThe location of the slider in the coordinates
of the canvas.
[1msliderHeight[0m
[1msliderWidth [22mThe size of the slider.
translations The event bindings associated with this wid-
get.
x
y The location of the upper left outside corner
of this widget in its parent.
[4m3.5.2.[24m [4mPanner[24m [4mActions[0m
The actions supported by the Panner widget are:
[1mstart[22m() This action begins movement of the slider.
[1mstop[22m() This action ends movement of the slider.
[1mabort[22m() This action ends movement of the slider and
restores it to the position it held when the
[1mstart [22maction was invoked.
[1mmove[22m() This action moves the outline of the slider
[1m54[0m
[1mAthena Widget Set libXaw 1.0.7[0m
(if the [1mrubberBand [22mresource is True) or the
slider itself (by invoking the [1mnotify [22maction
procedure).
[1mpage[22m([4mxamount[24m,[4myamount[24m)
This action moves the slider by the specified
amounts. The format for the amounts is a
signed or unsigned floating-point number
(e.g., +1.0 or -.5) followed by either [1mp[0m
indicating pages (slider sizes), or [1mc [22mindi-
cating canvas sizes. Thus, [4mpage(+0,+.5p)[0m
represents vertical movement down one-half
the height of the slider and [4mpage(0,0)[24m repre-
sents moving to the upper left corner of the
canvas.
[1mnotify[22m() This action informs the application of the
slider's current position by invoking the
[1mreportCallback [22mfunctions registered by the
application.
[1mset[22m([4mwhat[24m,[4mvalue[24m)This action changes the behavior of the Pan-
ner. The [4mwhat[24m argument must currently be the
string [1mrubberband [22mand controls the value of
the [1mrubberBand [22mresource. The [4mvalue[24m argument
may have one of the values [1mon[22m, [1moff[22m, or [1mtog-[0m
[1mgle[22m.
The default bindings for Panner are:
: start()
:move()
: notify() stop()
: abort()
KP_Enter:set(rubberband,toggle)
space: page(+1p,+1p)
Delete:page(-1p,-1p)
BackSpace:page(-1p,-1p)
Left: page(-.5p,+0)
Right: page(+.5p,+0)
Up: page(+0,-.5p)
Down: page(+0,+.5p)
Home: page(0,0)
[4m3.5.3.[24m [4mPanner[24m [4mCallbacks[0m
The functions registered on the [1mreportCallback [22mlist are
invoked by the [1mnotify [22maction as follows:
[1m55[0m
[1mAthena Widget Set libXaw 1.0.7[0m
void ReportProc([4mpanner[24m, [4mclient_data[24m, [4mreport[24m)
Widget [4mpanner[24m;
XtPointer [4mclient_data[24m;
XtPointer [4mreport[24m; /* (XawPannerReport *) */
[4mpanner[24m Specifies the Panner widget.
[4mclient_data[24mSpecifies the client data.
[4mreport[24m Specifies a pointer to an [1mXawPannerReport [22mstruc-
ture containing the location and size of the
slider and the size of the canvas.
[4m3.6.[24m [4mRepeater[24m [4mWidget[0m
Application header file
Class header file
Class repeaterWidgetClass
Class Name Repeater
Superclass Command
The Repeater widget is a subclass of the Command widget; see
the Command documentation for details. The difference is
that the Repeater can call its registered callbacks repeat-
edly, at an increasing rate. The default translation does
so for the duration the user holds down pointer button 1
while the pointer is on the Repeater.
[4m3.6.1.[24m [4mResources[0m
When creating a Repeater widget instance, the following
resources are retrieved from the argument list or from the
resource database:
-------------------------------------------------------------------------------------------------
[4mName[24m [4mClass[24m [4mType[24m [4mNotesDefault[24m [4mValue[0m
-------------------------------------------------------------------------------------------------
accelerators Accelerators AcceleratorTable NULL
ancestorSensitive AncestorSensitive Boolean D True
background Background Pixel XtDefaultBackground
backgroundPixmap Pixmap Pixmap XtUnspecifiedPixmap
bitmap Bitmap Pixmap None
borderColor BorderColor Pixel XtDefaultForeground
borderPixmap Pixmap Pixmap XtUnspecifiedPixmap
borderWidth BorderWidth Dimension 1
callback Callback XtCallbackList NULL
colormap Colormap Colormap Parent's Colormap
cornerRoundPercent CornerRoundPercentDimension 25
[1m56[0m
[1mAthena Widget Set libXaw 1.0.7[0m
-------------------------------------------------------------------------------------------------
[4mName[24m [4mClass[24m [4mType[24m [4mNotesDefault[24m [4mValue[0m
-------------------------------------------------------------------------------------------------
cursor Cursor Cursor None
cursorName Cursor String NULL
decay Decay Int 5
depth Depth int C Parent's Depth
destroyCallback Callback XtCallbackList NULL
encoding Encoding UnsignedChar XawTextEncoding8bit
flash Boolean Boolean False
font Font XFontStruct XtDefaultFont
fontSet FontSet XFontSet XtDefaultFontSet
foreground Foreground Pixel XtDefaultForeground
height Height Dimension A graphic height + 2 * [1minternalHeight[0m
highlightThickness Thickness Dimension A 2 (0 if Shaped)
initialDelay Delay Int 200
insensitiveBorder Insensitive Pixmap GreyPixmap
internalHeight Height Dimension 2
internalWidth Width Dimension 4
international International Boolean C False
justify Justify Justify XtJustifyCenter (center)
label Label String name of widget
leftBitmap LeftBitmap Bitmap None
mappedWhenManaged MappedWhenManaged Boolean True
minimumDelay MinimumDelay Int 10
pointerColor Foreground Pixel XtDefaultForeground
pointerColorBackgroundBackground Pixel XtDefaultBackground
repeatDelay Delay Int 50
resize Resize Boolean True
screen Screen Pointer R Parent's Screen
sensitive Sensitive Boolean True
shapeStyle ShapeStyle ShapeStyle Rectangle
startCallback StartCallback Callback NULL
stopCallback StopCallback Callback NULL
translations Translations TranslationTable See below
width Width Dimension A graphic width + 2 * [1minternalWidth[0m
x Position Position 0
y Position Position 0
-------------------------------------------------------------------------------------------------
accelerators A list of event to action bindings to be exe-
cuted by this widget, even though the event
occurred in another widget. (See the [4mX[24m [4mTool-[0m
[4mkit[24m [4mIntrinsics[24m [4m--[24m [4mC[24m [4mLanguage[24m [4mInterface[24m for
details).
ancestorSensitive
The sensitivity state of the ancestors of
this widget. A widget is insensitive if
either it or any of its ancestors is insensi-
tive. This resource should not be changed
with [1mXtSetValues[22m, although it may be queried.
[1m57[0m
[1mAthena Widget Set libXaw 1.0.7[0m
background A pixel value which indexes the widget's col-
ormap to derive the background color of the
widget's window.
backgroundPixmapThe background pixmap of this widget's win-
dow. If this resource is set to anything
other than [1mXtUnspecifiedPixmap[22m, the pixmap
specified will be used instead of the back-
ground color.
bitmap A bitmap to display instead of the [1mlabel[22m.
The default size of the widget will be just
large enough to contain the bitmap and the
widget's internal width and height. The
resource converter for this resource con-
structs bitmaps from the contents of files.
(See [1mConverting Bitmaps [22mfor details.) If
this bitmap is one bit deep then the 1's will
be rendered in the foreground color, and the
0's in the background color. If [1mbitmap [22mhas a
depth greater than one, it is copied directly
into the window.
borderColor A pixel value which indexes the widget's col-
ormap to derive the border color of the wid-
get's window.
borderPixmap The border pixmap of this widget's window.
If this resource is set to anything other
than [1mXtUnspecifiedPixmap[22m, the pixmap speci-
fied will be used instead of the border
color.
borderWidth The width of this widget's window border.
callback A list of routines to be called when the
[1mnotify [22maction is invoked.
colormap The colormap that this widget will use.
cornerRoundPercent
When a [1mShapeStyle [22mof [1mroundedRectangle [22mis
used, this resource controls the radius of
the rounded corner. The radius of the
rounded corners is specified as a percentage
of the length of the shortest side of the
widget.
cursor The image that will be displayed as the
pointer cursor whenever it is in this widget.
The use of this resource is deprecated in
favor of [1mcursorName[22m.
cursorName The name of the symbol to use to represent
[1m58[0m
[1mAthena Widget Set libXaw 1.0.7[0m
the pointer cursor. This resource will over-
ride the [1mcursor [22mresource if both are speci-
fied. (See 2.4.1)
[1mdecay [22mThe number of milliseconds that should be
subtracted from each succeeding interval
while the Repeater button is being held down
until the interval has reached [1mminimumDelay[0m
milliseconds.
depth The depth of this widget's window.
destroyCallbackAll functions on this list are called when
this widget is destroyed.
encoding The encoding method used by the value of the
[1mlabel [22mresource. The value may be [1mXawTextEn-[0m
[1mcoding8bit [22mor [1mXawTextEncodingChar2b[22m. When
[1minternational [22mis set to [1mtrue [22mthis resource is
not used.
[1mflash [22mWhether or not to flash the Repeater button
whenever the timer goes off.
font The text font to use when displaying the
[1mlabel[22m, when the [1minternational [22mresource is
[1mfalse[22m.
fontSet The text font set to use when displaying the
[1mlabel[22m, when the [1minternational [22mresource is
[1mtrue[22m.
foreground A pixel value which indexes the widget's col-
ormap to derive the foreground color of the
widget's window. This color is also used to
render all 1's in a [1mbitmap [22mone plane deep.
height
width The height and width of this widget in pix-
els.
highlightThickness
The thickness of the rectangle that is used
to highlight the internal border of this wid-
get, alerting the user that it is ready to be
selected. The default value is 2 pixels if
the [1mshapeStyle [22mis [1mrectangle[22m, and 0 Pixels (no
highlighting) otherwise.
[1minitialDelay [22mThe number of milliseconds between the begin-
ning of the Repeater button being held down
and the first invocation of the [1mcallback[0m
function.
[1m59[0m
[1mAthena Widget Set libXaw 1.0.7[0m
insensitiveBorder
This pixmap will be tiled into the widget's
border if the widget becomes insensitive.
internalHeight
internalWidth The minimum amount of space to leave between
the graphic and the vertical and horizontal
edges of the window.
international This is a boolean flag, only settable at wid-
get creation time. A value of [1mfalse [22msignals
the widget to use pre-R6 internationalization
(specifically, the lack thereof), such as
using fonts for displaying text, etc. A
value of [1mtrue [22mdirects the widget to act in an
internationalized manner, such as utilizing
font sets for displaying text, etc.
justify Specifies left, center, or right alignment of
graphic within the widget. This resource may
be specified with the values [1mXtJustifyLeft[22m,
[1mXtJustifyCenter[22m, or [1mXtJustifyRight[22m. A con-
verter is registered for this resource that
will convert the following strings: [1mleft,[0m
[1mright, [22mand [1mcenter[22m. This resource only has
noticeable effect when the width of the wid-
get is larger than necessary to display the
graphic. Note that when the graphic is a
multi-line [1mlabel[22m, the longest line will obey
this justification while shorter lines will
be left-justified with the longest one.
label Specifies the text string to be displayed in
the widget's window if no bitmap is speci-
fied. The default is the name of this wid-
get. Regardless of the value of [1mencoding [22mor
[1minternational[22m, a single newline character (1
byte) will cause a line break.
leftBitmap Specifies a bitmap to display to the left of
the graphic in the widget's window.
mappedWhenManaged
If this resource is [1mTrue[22m, then the widget's
window will automatically be mapped by the
Toolkit when it is realized and managed.
[1mminimumDelay [22mThe minimum time between callbacks in mil-
liseconds.
pointerColor A pixel value which indexes the widget's col-
ormap to derive the foreground color of the
pointer symbol specified by the [1mcursorName[0m
[1m60[0m
[1mAthena Widget Set libXaw 1.0.7[0m
resource.
pointerColorBackground
A pixel value which indexes the widget's
colormap to derive the background color of
the pointer symbol specified by the [1mcursor-[0m
[1mName [22mresource.
[1mrepeatDelay [22mThe number of milliseconds between each call-
back after the first (minus an increasing
number of [1mdecay[22ms).
resize Specifies whether the widget should attempt
to resize to its preferred dimensions when-
ever its resources are modified with [1mXtSet-[0m
[1mValues[22m. This attempt to resize may be denied
by the parent of this widget. The parent is
always free to resize the widget regardless
of the state of this resource.
screen The screen on which this widget is displayed.
This is not a settable resource.
sensitive Whether or not the toolkit should pass user
events to this widget. The widget will not
get input events if either [1mancestorSensitive[0m
or [1msensitive [22mis [1mFalse[22m.
shapeStyle Nonrectangular widgets may be created using
this resource. Nonrectangular widgets are
supported only on a server that supports the
[1mShape Extension[22m. If nonrectangular widgets
are specified for a server lacking this
extension, the shape is ignored and the wid-
gets will be rectangular. The following
shapes are currently supported: [1mXmuShapeRect-[0m
[1mangle[22m, [1mXmuShapeOval[22m, [1mXmuShapeEllipse[22m, and
[1mXmuShapeRoundedRectangle[22m. A converter is
registered for this resource that will con-
vert the following strings: [1mrectangle, oval,[0m
[1mellipse, [22mand [1mroundedRectangle[22m.
[1mstartCallback [22mThe list of functions to invoke by the [1mstart[0m
action (typically when the Repeater button is
first pressed). The callback data parameter
is set to NULL.
[1mstopCallback [22mThe list of functions to invoke by the [1mstop[0m
action (typically when the Repeater button is
released). The callback data parameter is
set to NULL.
translations The event bindings associated with this wid-
get.
[1m61[0m
[1mAthena Widget Set libXaw 1.0.7[0m
x
y The location of the upper left outside corner
of this widget in its parent.
[4m3.6.2.[24m [4mRepeater[24m [4mActions[0m
The Repeater widget supports the following actions beyond
those of the Command button:
[1mstart[22m() This invokes the functions on the [1mstartCall-[0m
[1mback [22mand [1mcallback [22mlists and sets a timer to
go off in [1minitialDelay [22mmilliseconds. The
timer will cause the [1mcallback [22mfunctions to be
invoked with increasing frequency until the
[1mstop [22maction occurs.
[1mstop[22m() This invokes the functions on the [1mstopCall-[0m
[1mback [22mlist and prevents any further timers
from occuring until the next [1mstart [22maction.
The following are the default translation bindings used by
the Repeater widget:
: highlight()
: unhighlight()
: set() start()
: stop() unset()
[4m3.7.[24m [4mScrollbar[24m [4mWidget[0m
Application header file
Class header file
Class scrollbarWidgetClass
Class Name Scrollbar
Superclass Simple
A Scrollbar widget is a rectangle, called the ``canvas,'' on
which another rectangle, the ``thumb,'' moves in one dimen-
sion, either vertically or horizontally. A Scrollbar can be
used alone, as a value generator, or it can be used within a
composite widget (for example, a Viewport). When a Scroll-
bar is used to move, or ``scroll,'' the contents of another
widget, the size and the position of the thumb usually give
feedback as to what portion of the other widget's contents
are visible.
[1m62[0m
[1mAthena Widget Set libXaw 1.0.7[0m
Each pointer button invokes a specific action. Pointer but-
tons 1 and 3 do not move the thumb automatically. Instead,
they return the pixel position of the cursor on the scroll
region. When pointer button 2 is clicked, the thumb moves
to the current pointer position. When pointer button 2 is
held down and the pointer is moved, the thumb follows the
pointer.
The pointer cursor in the scroll region changes depending on
the current action. When no pointer button is pressed, the
cursor appears as a double-headed arrow that points in the
direction that scrolling can occur. When pointer button 1
or 3 is pressed, the cursor appears as a single-headed arrow
that points in the logical direction that the thumb will
move. When pointer button 2 is pressed, the cursor appears
as an arrow that points to the top or the left of the thumb.
When the user scrolls, the application receives notification
through callback procedures. For both discrete scrolling
actions, the callback returns the Scrollbar widget, the
client_data, and the pixel position of the pointer when the
button was released. For continuous scrolling, the callback
routine returns the scroll bar widget, the client data, and
the current relative position of the thumb. When the thumb
is moved using pointer button 2, the callback procedure is
invoked continuously. When either button 1 or 3 is pressed,
the callback procedure is invoked only when the button is
released and the client callback procedure is responsible
for moving the thumb.
[4m3.7.1.[24m [4mResources[0m
When creating a Scrollbar widget instance, the following
resources are retrieved from the argument list or from the
resource database:
----------------------------------------------------------------------------------------
[4mName[24m [4mClass[24m [4mType[24m [4mNotesDefault[24m [4mValue[0m
----------------------------------------------------------------------------------------
accelerators Accelerators AcceleratorTable NULL
ancestorSensitive AncestorSensitiveBoolean D True
background Background Pixel XtDefaultBackground
backgroundPixmap Pixmap Pixmap XtUnspecifiedPixmap
borderColor BorderColor Pixel XtDefaultForeground
borderPixmap Pixmap Pixmap XtUnspecifiedPixmap
borderWidth BorderWidth Dimension 1
colormap Colormap Colormap parent's Colormap
cursor Cursor Cursor None
cursorName Cursor String NULL
depth Depth int C parent's Depth
destroyCallback Callback XtCallbackList NULL
foreground Foreground Pixel XtDefaultForeground
[1m63[0m
[1mAthena Widget Set libXaw 1.0.7[0m
----------------------------------------------------------------------------------------
[4mName[24m [4mClass[24m [4mType[24m [4mNotesDefault[24m [4mValue[0m
----------------------------------------------------------------------------------------
height Height Dimension A depends on orientation
insensitiveBorder Insensitive Pixmap GreyPixmap
international International Boolean C False
jumpProc Callback XtCallbackList NULL
length Length Dimension 1
mappedWhenManaged MappedWhenManagedBoolean True
minimumThumb MinimumThumb Dimension 7
orientation Orientation Orientation XtorientVertical (vertical)
pointerColor Foreground Pixel XtDefaultForeground
pointerColorBackgroundBackground Pixel XtDefaultBackground
screen Screen Screen R parent's Screen
scrollDCursor Cursor Cursor XC_sb_down_arrow
scrollHCursor Cursor Cursor XC_sb_h_double_arrow
scrollLCursor Cursor Cursor XC_sb_left_arrow
scrollProc Callback XtCallbackList NULL
scrollRCursor Cursor Cursor XC_sb_right_arrow
scrollUCursor Cursor Cursor XC_sb_up_arrow
scrollVCursor Cursor Cursor XC_sb_v_arrow
sensitive Sensitive Boolean True
shown Shown Float 0.0
thickness Thickness Dimension 14
thumb Thumb Bitmap GreyPixmap
thumbProc Callback XtCallbackList NULL
topOfThumb TopOfThumb Float 0.0
translations Translations TranslationTable See below
width Width Dimension A depends on orientation
x Position Position 0
y Position Position 0
----------------------------------------------------------------------------------------
accelerators A list of event to action bindings to be exe-
cuted by this widget, even though the event
occurred in another widget. (See the [4mX[24m [4mTool-[0m
[4mkit[24m [4mIntrinsics[24m [4m--[24m [4mC[24m [4mLanguage[24m [4mInterface[24m for
details).
ancestorSensitive
The sensitivity state of the ancestors of
this widget. A widget is insensitive if
either it or any of its ancestors is insensi-
tive. This resource should not be changed
with [1mXtSetValues[22m, although it may be queried.
background A pixel value which indexes the widget's col-
ormap to derive the background color of the
widget's window.
backgroundPixmapThe background pixmap of this widget's win-
dow. If this resource is set to anything
other than [1mXtUnspecifiedPixmap[22m, the pixmap
[1m64[0m
[1mAthena Widget Set libXaw 1.0.7[0m
specified will be used instead of the back-
ground color.
borderColor A pixel value which indexes the widget's col-
ormap to derive the border color of the wid-
get's window.
borderPixmap The border pixmap of this widget's window.
If this resource is set to anything other
than [1mXtUnspecifiedPixmap[22m, the pixmap speci-
fied will be used instead of the border
color.
borderWidth The width of this widget's window border.
colormap The colormap that this widget will use.
cursor The image that will be displayed as the
pointer cursor whenever it is in this widget.
The use of this resource is deprecated in
favor of [1mcursorName[22m.
cursorName The name of the symbol to use to represent
the pointer cursor. This resource will over-
ride the [1mcursor [22mresource if both are speci-
fied. (See 2.4.1)
depth The depth of this widget's window.
destroyCallbackAll functions on this list are called when
this widget is destroyed.
[1mforeground [22mA pixel value which indexes the widget's col-
ormap to derive the color used to draw the
thumb.
height
width The height and width of this widget in pix-
els.
insensitiveBorder
This pixmap will be tiled into the widget's
border if the widget becomes insensitive.
international This is a boolean flag, only settable at wid-
get creation time. While not utilized in
this widget, it can and should be checked by
any subclasses that have behavior that should
vary with locale.
[1mjumpProc [22mAll functions on this callback list are
called when the [1mNotifyThumb [22maction is
invoked. See the [1mScrollbar Actions [22msection
for details.
[1m65[0m
[1mAthena Widget Set libXaw 1.0.7[0m
[1mlength [22mThe height of a vertical scrollbar or the
width of a horizontal scrollbar.
mappedWhenManaged
If this resource is [1mTrue[22m, then the widget's
window will automatically be mapped by the
Toolkit when it is realized and managed.
[1mminimumThumb [22mThe smallest size, in pixels, to which the
thumb can shrink.
[1morientation [22mThe orientation is the direction that the
thumb will be allowed to move. This value
can be either [1mXtorientVertical [22mor [1mXtorientHo-[0m
[1mrizontal[22m. A converter is registered for this
resource that will convert the following
strings: [1mvertical [22mand [1mhorizontal[22m.
pointerColor A pixel value which indexes the widget's col-
ormap to derive the foreground color of the
pointer symbol specified by the [1mcursorName[0m
resource.
pointerColorBackground
A pixel value which indexes the widget's
colormap to derive the background color of
the pointer symbol specified by the [1mcursor-[0m
[1mName [22mresource.
screen The screen on which this widget is displayed.
This is not a settable resource.
[1mscrollDCursor [22mThis cursor is used when scrolling backward
in a vertical scrollbar.
[1mscrollHCursor [22mThis cursor is used when a horizontal scroll-
bar is inactive.
[1mscrollLCursor [22mThis cursor is used when scrolling forward in
a horizontal scrollbar.
[1mscrollProc [22mAll functions on this callback list may be
called when the [1mNotifyScroll [22maction is
invoked. See the [1mScrollbar Actions [22msection
for details.
[1mscrollRCursor [22mThis cursor is used when scrolling backward
in a horizontal scrollbar, or when thumbing a
vertical scrollbar.
[1mscrollUCursor [22mThis cursor is used when scrolling forward in
a vertical scrollbar, or when thumbing a hor-
izontal scrollbar.
[1m66[0m
[1mAthena Widget Set libXaw 1.0.7[0m
[1mscrollVCursor [22mThis cursor is used when a vertical scrollbar
is inactive.
sensitive Whether or not the toolkit should pass user
events to this widget. The widget will not
get input events if either [1mancestorSensitive[0m
or [1msensitive [22mis [1mFalse[22m.
[1mshown [22mThis is the size of the thumb, expressed as a
percentage (0.0 - 1.0) of the length of the
scrollbar.
[1mthickness [22mThe width of a vertical scrollbar or the
height of a horizontal scrollbar.
[1mthumb [22mThis pixmap is used to tile (or stipple) the
thumb of the scrollbar. If no tiling is
desired, then set this resource to [1mNone[22m.
This resource will accept either a bitmap or
a pixmap that is the same depth as the win-
dow. The resource converter for this
resource constructs bitmaps from the contents
of files. (See [1mConverting Bitmaps [22mfor
details.)
[1mtopOfThumb [22mThe location of the top of the thumb, as a
percentage (0.0 - 1.0) of the length of the
scrollbar. This resource was called [1mtop [22min
previous versions of the Athena widget set.
The name collided with the a Form widget con-
straint resource, and had to be changed.
translations The event bindings associated with this wid-
get.
x
y The location of the upper left outside corner
of this widget in its parent.
[4m3.7.2.[24m [4mScrollbar[24m [4mActions[0m
The actions supported by the Scrollbar widget are:
[1mStartScroll[22m([4mvalue[24m)
The possible [4mvalues[24m are Forward, Backward, or
Continuous. This must be the first action to
begin a new movement.
[1mNotifyScroll[22m([4mvalue[24m)
The possible [4mvalues[24m are Proportional or Full-
Length. If the argument to StartScroll was
Forward or Backward, NotifyScroll executes
the [1mscrollProc [22mcallbacks and passes either;
the position of the pointer, if [4mvalue[24m is
[1m67[0m
[1mAthena Widget Set libXaw 1.0.7[0m
Proportional, or the full length of the
scroll bar, if [4mvalue[24m is FullLength. If the
argument to StartScroll was Continuous, Noti-
fyScroll returns without executing any call-
backs.
[1mEndScroll[22m() This must be the last action after a movement
is complete.
[1mMoveThumb[22m() Repositions the Scrollbar's thumb to the cur-
rent pointer location.
[1mNotifyThumb[22m() Calls the [4mjumpProc[24m callbacks and passes the
relative position of the pointer as a per-
centage of the scroll bar length.
The default bindings for Scrollbar are:
: StartScroll(Forward)
: StartScroll(Continuous) MoveThumb() NotifyThumb()
: StartScroll(Backward)
:MoveThumb() NotifyThumb()
: NotifyScroll(Proportional) EndScroll()
Examples of additional bindings a user might wish to specify
in a resource file are:
*Scrollbar.Translations: \
~Metaspace: StartScroll(Forward) NotifyScroll(FullLength) \n\
Metaspace: StartScroll(Backward) NotifyScroll(FullLength) \n\
EndScroll()
[4m3.7.3.[24m [4mScrollbar[24m [4mCallbacks[0m
There are two callback lists provided by the Scrollbar wid-
get. The procedural interface for these functions is
described here.
The calling interface to the [1mscrollProc [22mcallback procedure
is:
void ScrollProc([4mscrollbar[24m, [4mclient_data[24m, [4mposition[24m)
Widget [4mscrollbar[24m;
XtPointer [4mclient_data[24m;
XtPointer [4mposition[24m; /* int */
[4mscrollbar[24m Specifies the Scrollbar widget.
[1m68[0m
[1mAthena Widget Set libXaw 1.0.7[0m
[4mclient_data[24mSpecifies the client data.
[4mposition[24m Specifies a pixel position in integer form.
The [1mscrollProc [22mcallback is used for incremental scrolling
and is called by the [1mNotifyScroll [22maction. The position
argument is a signed quantity and should be cast to an int
when used. Using the default button bindings, button 1
returns a positive value, and button 3 returns a negative
value. In both cases, the magnitude of the value is the dis-
tance of the pointer in pixels from the top (or left) of the
Scrollbar. The value will never be greater than the length
of the Scrollbar.
The calling interface to the [1mjumpProc [22mcallback procedure is:
void JumpProc([4mscrollbar[24m, [4mclient_data[24m, [4mpercent[24m)
Widget [4mscrollbar[24m;
XtPointer [4mclient_data[24m;
XtPointer [4mpercent_ptr[24m; /* float* */
[4mscrollbar[24m Specifies the ID of the scroll bar widget.
[4mclient_data[24mSpecifies the client data.
[4mpercent_ptr[24mSpecifies the floating point position of the
thumb (0.0 - 1.0).
The [1mjumpProc [22mcallback is used to implement smooth scrolling
and is called by the [1mNotifyThumb [22maction. Percent_ptr must
be cast to a pointer to float before use; i.e.
float percent = *(float*)percent_ptr;
With the default button bindings, button 2 moves the thumb
interactively, and the [1mjumpProc [22mis called on each new posi-
tion of the pointer, while the pointer button remains down.
The value specified by [4mpercent_ptr[24m is the current location
of the thumb (from the top or left of the Scrollbar)
expressed as a percentage of the length of the Scrollbar.
[4m3.7.4.[24m [4mConvenience[24m [4mRoutines[0m
To set the position and length of a Scrollbar thumb, use
[4mXawScrollbarSetThumb[24m.
void XawScrollbarSetThumb([4mw[24m, [4mtop[24m, [4mshown[24m)
Widget [4mw[24m;
float [4mtop[24m;
float [4mshown[24m;
[1m69[0m
[1mAthena Widget Set libXaw 1.0.7[0m
[4mw[24m Specifies the Scrollbar widget.
[4mtop[24m Specifies the position of the top of the thumb as
a fraction of the length of the Scrollbar.
[4mshown[24m Specifies the length of the thumb as a fraction of
the total length of the Scrollbar.
[4mXawScrollbarThumb[24m moves the visible thumb to a new position
(0.0 - 1.0) and length (0.0 - 1.0). Either the top or shown
arguments can be specified as -1.0, in which case the cur-
rent value is left unchanged. Values greater than 1.0 are
truncated to 1.0.
If called from [1mjumpProc[22m, [1mXawScrollbarSetThumb [22mhas no effect.
[4m3.7.5.[24m [4mSetting[24m [4mFloat[24m [4mResources[0m
The [1mshown [22mand [1mtopOfThumb [22mresources are of type [4mfloat[24m. These
resources can be difficult to get into an argument list.
The reason is that C performs an automatic cast of the float
value to an integer value, usually truncating the important
information. The following code fragment is one portable
method of getting a float into an argument list.
top = 0.5;
if (sizeof(float) > sizeof(XtArgVal)) {
/*
* If a float is larger than an XtArgVal then pass this
* resource value by reference.
*/
XtSetArg(args[0], XtNshown, &top);
}
else {
/*
* Convince C not to perform an automatic conversion, which
* would truncate 0.5 to 0.
*/
XtArgVal * l_top = (XtArgVal *) &top;
XtSetArg(args[0], XtNshown, *l_top);
}
[4m3.8.[24m [4mSimple[24m [4mWidget[0m
Application Header file
Class Header file
Class simpleWidgetClass
Class Name Simple
Superclass Core
[1m70[0m
[1mAthena Widget Set libXaw 1.0.7[0m
The Simple widget is not very useful by itself, as it has no
semantics of its own. It main purpose is to be used as a
common superclass for the other [4msimple[24m Athena widgets. This
widget adds six resources to the resource list provided by
the Core widget and its superclasses.
[4m3.8.1.[24m [4mResources[0m
When creating a Simple widget instance, the following
resources are retrieved from the argument list or from the
resource database:
---------------------------------------------------------------------------------
[4mName[24m [4mClass[24m [4mType[24m [4mNotesDefault[24m [4mValue[0m
---------------------------------------------------------------------------------
accelerators Accelerators AcceleratorTable NULL
ancestorSensitive AncestorSensitiveBoolean D True
background Background Pixel XtDefaultBackground
backgroundPixmap Pixmap Pixmap XtUnspecifiedPixmap
borderColor BorderColor Pixel XtDefaultForeground
borderPixmap Pixmap Pixmap XtUnspecifiedPixmap
borderWidth BorderWidth Dimension 1
colormap Colormap Colormap Parent's Colormap
cursor Cursor Cursor None
cursorName Cursor String NULL
depth Depth int C Parent's Depth
destroyCallback Callback XtCallbackList NULL
height Height Dimension 0
insensitiveBorder Insensitive Pixmap GreyPixmap
international International Boolean C False
mappedWhenManaged MappedWhenManagedBoolean True
pointerColor Foreground Pixel XtDefaultForeground
pointerColorBackgroundBackground Pixel XtDefaultBackground
screen Screen Screen R Parent's Screen
sensitive Sensitive Boolean True
translations Translations TranslationTable NULL
width Width Dimension 0
x Position Position 0
y Position Position 0
---------------------------------------------------------------------------------
accelerators A list of event to action bindings to be exe-
cuted by this widget, even though the event
occurred in another widget. (See the [4mX[24m [4mTool-[0m
[4mkit[24m [4mIntrinsics[24m [4m--[24m [4mC[24m [4mLanguage[24m [4mInterface[24m for
details).
ancestorSensitive
The sensitivity state of the ancestors of
this widget. A widget is insensitive if
either it or any of its ancestors is insensi-
tive. This resource should not be changed
[1m71[0m
[1mAthena Widget Set libXaw 1.0.7[0m
with [1mXtSetValues[22m, although it may be queried.
background A pixel value which indexes the widget's col-
ormap to derive the background color of the
widget's window.
backgroundPixmapThe background pixmap of this widget's win-
dow. If this resource is set to anything
other than [1mXtUnspecifiedPixmap[22m, the pixmap
specified will be used instead of the back-
ground color.
borderColor A pixel value which indexes the widget's col-
ormap to derive the border color of the wid-
get's window.
borderPixmap The border pixmap of this widget's window.
If this resource is set to anything other
than [1mXtUnspecifiedPixmap[22m, the pixmap speci-
fied will be used instead of the border
color.
borderWidth The width of this widget's window border.
colormap The colormap that this widget will use.
[1mcursor [22mThe image that will be displayed as the
pointer cursor whenever it is in this widget.
The use of this resource is deprecated in
favor of [1mcursorName[22m.
[1mcursorName [22mThe name of the symbol to use to represent
the pointer cursor. This resource will over-
ride the [1mcursor [22mresource if both are speci-
fied. (See 2.4.1)
depth The depth of this widget's window.
destroyCallbackAll functions on this list are called when
this widget is destroyed.
height
width The height and width of this widget in pix-
els.
[1minsensitiveBorder[0m
This pixmap will be tiled into the widget's
border if the widget becomes insensitive.
[1minternational [22mThis is a boolean flag, only settable at wid-
get creation time. While not utilized in
this widget, it can and should be checked by
any subclasses that have behavior that should
vary with locale.
[1m72[0m
[1mAthena Widget Set libXaw 1.0.7[0m
mappedWhenManaged
If this resource is [1mTrue[22m, then the widget's
window will automatically be mapped by the
Toolkit when it is realized and managed.
[1mpointerColor [22mA pixel value which indexes the widget's col-
ormap to derive the foreground color of the
pointer symbol specified by the [1mcursorName[0m
resource.
[1mpointerColorBackground[0m
A pixel value which indexes the widget's
colormap to derive the background color of
the pointer symbol specified by the [1mcursor-[0m
[1mName [22mresource.
screen The screen on which this widget is displayed.
This is not a settable resource.
sensitive Whether or not the toolkit should pass user
events to this widget. The widget will not
get input events if either [1mancestorSensitive[0m
or [1msensitive [22mis [1mFalse[22m.
translations The event bindings associated with this wid-
get.
x
y The location of the upper left outside corner
of this widget in its parent.
[4m3.9.[24m [4mStripChart[24m [4mWidget[0m
Application Header file
Class Header file
Class stripChartWidgetClass
Class Name StripChart
Superclass Simple
The StripChart widget is used to provide a roughly real time
graphical chart of a single value. For example, it is used
by the common client program [1mxload [22mto provide a graph of
processor load. The StripChart reads data from an applica-
tion, and updates the chart at the [1mupdate [22minterval speci-
fied.
[4m3.9.1.[24m [4mResources[0m
When creating a StripChart widget instance, the following
resources are retrieved from the argument list or from the
resource database:
[1m73[0m
[1mAthena Widget Set libXaw 1.0.7[0m
-----------------------------------------------------------------------------------------
[4mName[24m [4mClass[24m [4mType[24m [4mNotesDefault[24m [4mValue[0m
-----------------------------------------------------------------------------------------
accelerators Accelerators AcceleratorTable NULL
ancestorSensitive AncestorSensitiveBoolean D True
background Background Pixel XtDefaultBackground
backgroundPixmap Pixmap Pixmap XtUnspecifiedPixmap
borderColor BorderColor Pixel XtDefaultForeground
borderPixmap Pixmap Pixmap XtUnspecifiedPixmap
borderWidth BorderWidth Dimension 1
colormap Colormap Colormap Parent's Colormap
cursor Cursor Cursor None
cursorName Cursor String NULL
depth Depth int C Parent's Depth
destroyCallback Callback XtCallbackList NULL
foreground Foreground Pixel XtDefaultForeground
getValue Callback XtCallbackList NULL
height Height Dimension 120
highlight Foreground Pixel XtDefaultForeground
insensitiveBorder Insensitive Pixmap GreyPixmap
international International Boolean C False
jumpScroll JumpScroll int A half the width of the widget
mappedWhenManaged MappedWhenManagedBoolean True
minScale Scale int 1
pointerColor Foreground Pixel XtDefaultForeground
pointerColorBackgroundBackground Pixel XtDefaultBackground
screen Screen Pointer R Parent's Screen
sensitive Sensitive Boolean True
translations Translations TranslationTable NULL
update Interval int 10
width Width Dimension 120
x Position Position 0
y Position Position 0
-----------------------------------------------------------------------------------------
accelerators A list of event to action bindings to be exe-
cuted by this widget, even though the event
occurred in another widget. (See the [4mX[24m [4mTool-[0m
[4mkit[24m [4mIntrinsics[24m [4m--[24m [4mC[24m [4mLanguage[24m [4mInterface[24m for
details).
ancestorSensitive
The sensitivity state of the ancestors of
this widget. A widget is insensitive if
either it or any of its ancestors is insensi-
tive. This resource should not be changed
with [1mXtSetValues[22m, although it may be queried.
background A pixel value which indexes the widget's col-
ormap to derive the background color of the
widget's window.
backgroundPixmapThe background pixmap of this widget's
[1m74[0m
[1mAthena Widget Set libXaw 1.0.7[0m
window. If this resource is set to anything
other than [1mXtUnspecifiedPixmap[22m, the pixmap
specified will be used instead of the back-
ground color.
borderColor A pixel value which indexes the widget's col-
ormap to derive the border color of the wid-
get's window.
borderPixmap The border pixmap of this widget's window.
If this resource is set to anything other
than [1mXtUnspecifiedPixmap[22m, the pixmap speci-
fied will be used instead of the border
color.
borderWidth The width of this widget's window border.
colormap The colormap that this widget will use.
cursor The image that will be displayed as the
pointer cursor whenever it is in this widget.
The use of this resource is deprecated in
favor of [1mcursorName[22m.
cursorName The name of the symbol to use to represent
the pointer cursor. This resource will over-
ride the [1mcursor [22mresource if both are speci-
fied. (See 2.4.1)
depth The depth of this widget's window.
destroyCallbackAll functions on this list are called when
this widget is destroyed.
[1mforeground [22mA pixel value which indexes the widget's col-
ormap to derive the color that will be used
to draw the graph.
[1mgetValue [22mA list of callback functions to call every
[1mupdate [22mseconds. This list should contain one
function, which returns the value to be
graphed by the StripChart widget. The fol-
lowing section describes the procedural
interface. Behavior when this list has more
than one function is undefined.
height
width The height and width of this widget in pix-
els.
[1mhighlight [22mA pixel value which indexes the widget's col-
ormap to derive the color that will be used
to draw the scale lines on the graph.
[1m75[0m
[1mAthena Widget Set libXaw 1.0.7[0m
insensitiveBorder
This pixmap will be tiled into the widget's
border if the widget becomes insensitive.
international This is a boolean flag, only settable at wid-
get creation time. While not utilized in
this widget, it can and should be checked by
any subclasses that have behavior that should
vary with locale.
[1mjumpScroll [22mWhen the graph reaches the right edge of the
window it must be scrolled to the left. This
resource specifies the number of pixels it
will jump. Smooth scrolling can be achieved
by setting this resource to 1.
mappedWhenManaged
If this resource is [1mTrue[22m, then the widget's
window will automatically be mapped by the
Toolkit when it is realized and managed.
[1mminScale [22mThe minimum scale for the graph. The number
of divisions on the graph will always be
greater than or equal to this value.
pointerColor A pixel value which indexes the widget's col-
ormap to derive the foreground color of the
pointer symbol specified by the [1mcursorName[0m
resource.
pointerColorBackground
A pixel value which indexes the widget's
colormap to derive the background color of
the pointer symbol specified by the [1mcursor-[0m
[1mName [22mresource.
screen The screen on which this widget is displayed.
This is not a settable resource.
sensitive Whether or not the toolkit should pass user
events to this widget. The widget will not
get input events if either [1mancestorSensitive[0m
or [1msensitive [22mis [1mFalse[22m.
translations The event bindings associated with this wid-
get.
[1mupdate [22mThe number of seconds between graph updates.
Each update is represented on the graph as a
1 pixel wide line. Every [1mupdate [22mseconds the
[1mgetValue [22mprocedure will be used to get a new
graph point, and this point will be added to
the right end of the StripChart.
[1m76[0m
[1mAthena Widget Set libXaw 1.0.7[0m
x
y The location of the upper left outside corner
of this widget in its parent.
[4m3.9.2.[24m [4mGetting[24m [4mthe[24m [4mStripChart[24m [4mValue[0m
The StripChart widget will call the application routine
passed to it as the [1mgetValue [22mcallback function every [1mupdate[0m
seconds to obtain another point for the StripChart graph.
The calling interface for the [1mgetValue [22mcallback is:
void (*[4mgetValueProc[24m)([4mw[24m, [4mclient_data[24m, [4mvalue[24m)
Widget [4mw[24m;
XtPointer [4mclient_data[24m;
XtPointer [4mvalue[24m; /* double * */
[4mw[24m Specifies the StripChart widget.
[4mclient_data[24mSpecifies the client data.
[4mvalue[24m Returns a pointer to a double. The application
should set the address pointed to by this argument
to a double containing the value to be graphed on
the StripChart.
This function is used by the StripChart to call an applica-
tion routine. The routine will pass the value to be graphed
back to the the StripChart in the [1mvalue [22mfield of this rou-
tine.
[4m3.10.[24m [4mToggle[24m [4mWidget[0m
Application Header file
Class Header file
Class toggleWidgetClass
Class Name Toggle
Superclass Command
The Toggle widget is an area, often rectangular, that dis-
plays a graphic. The graphic may be a text string contain-
ing multiple lines of characters in an 8 bit or 16 bit char-
acter set (to be displayed with a [4mfont[24m), or in a multi-byte
encoding (for use with a [4mfontset[24m). The graphic may also be
a bitmap or pixmap.
This widget maintains a Boolean state (e.g. True/False or
On/Off) and changes state whenever it is selected. When the
pointer is on the Toggle widget, the Toggle widget may
[1m77[0m
[1mAthena Widget Set libXaw 1.0.7[0m
become highlighted by drawing a rectangle around its perime-
ter. This highlighting indicates that the Toggle widget is
ready for selection. When pointer button 1 is pressed and
released, the Toggle widget indicates that it has changed
state by reversing its foreground and background colors, and
its [1mnotify [22maction is invoked, calling all functions on its
callback list. If the pointer is moved off of the widget
before the pointer button is released, the Toggle widget
reverts to its previous foreground and background colors,
and releasing the pointer button has no effect. This behav-
ior allows the user to cancel the operation.
Toggle widgets may also be part of a ``radio group.'' A
radio group is a list of at least two Toggle widgets in
which no more than one Toggle may be set at any time. A
radio group is identified by the widget ID of any one of its
members. The convenience routine [1mXawToggleGetCurrent [22mwill
return information about the Toggle widget in the radio
group.
Toggle widget state is preserved across changes in sensitiv-
ity.
[4m3.10.1.[24m [4mResources[0m
When creating a Toggle widget instance, the following
resources are retrieved from the argument list or from the
resource database:
-------------------------------------------------------------------------------------------------
[4mName[24m [4mClass[24m [4mType[24m [4mNotesDefault[24m [4mValue[0m
-------------------------------------------------------------------------------------------------
accelerators Accelerators AcceleratorTable NULL
ancestorSensitive AncestorSensitive Boolean D True
background Background Pixel XtDefaultBackground
backgroundPixmap Pixmap Pixmap XtUnspecifiedPixmap
bitmap Bitmap Pixmap None
borderColor BorderColor Pixel XtDefaultForeground
borderPixmap Pixmap Pixmap XtUnspecifiedPixmap
borderWidth BorderWidth Dimension 1
callback Callback XtCallbackList NULL
colormap Colormap Colormap Parent's Colormap
cornerRoundPercent CornerRoundPercentDimension 25
cursor Cursor Cursor None
cursorName Cursor String NULL
depth Depth int C Parent's Depth
destroyCallback Callback XtCallbackList NULL
encoding Encoding UnsignedChar XawTextEncoding8bit
font Font XFontStruct XtDefaultFont
fontSet FontSet XFontSet XtDefaultFontSet
foreground Foreground Pixel XtDefaultForeground
height Height Dimension A graphic height + 2 * [1minternalHeight[0m
[1m78[0m
[1mAthena Widget Set libXaw 1.0.7[0m
-------------------------------------------------------------------------------------------------
[4mName[24m [4mClass[24m [4mType[24m [4mNotesDefault[24m [4mValue[0m
-------------------------------------------------------------------------------------------------
highlightThickness Thickness Dimension A 2 (0 if Shaped)
insensitiveBorder Insensitive Pixmap GreyPixmap
internalHeight Height Dimension 2
internalWidth Width Dimension 4
international International Boolean C False
justify Justify Justify XtJustifyCenter (center)
label Label String name of widget
leftBitmap LeftBitmap Bitmap None
mappedWhenManaged MappedWhenManaged Boolean True
pointerColor Foreground Pixel XtDefaultForeground
pointerColorBackgroundBackground Pixel XtDefaultBackground
radioData RadioData Pointer Name of widget
radioGroup Widget Widget No radio group
resize Resize Boolean True
screen Screen Screen R Parent's Screen
sensitive Sensitive Boolean True
shapeStype ShapeStyle ShapeStyle Rectangle
state State Boolean Off
translations Translations TranslationTable See below
width Width Dimension A graphic width + 2 * [1minternalWidth[0m
x Position Position 0
y Position Position 0
-------------------------------------------------------------------------------------------------
accelerators A list of event to action bindings to be exe-
cuted by this widget, even though the event
occurred in another widget. (See the [4mX[24m [4mTool-[0m
[4mkit[24m [4mIntrinsics[24m [4m--[24m [4mC[24m [4mLanguage[24m [4mInterface[24m for
details).
ancestorSensitive
The sensitivity state of the ancestors of
this widget. A widget is insensitive if
either it or any of its ancestors is insensi-
tive. This resource should not be changed
with [1mXtSetValues[22m, although it may be queried.
background A pixel value which indexes the widget's col-
ormap to derive the background color of the
widget's window.
backgroundPixmapThe background pixmap of this widget's win-
dow. If this resource is set to anything
other than [1mXtUnspecifiedPixmap[22m, the pixmap
specified will be used instead of the back-
ground color.
bitmap A bitmap to display instead of the [1mlabel[22m.
The default size of the widget will be just
large enough to contain the bitmap and the
[1m79[0m
[1mAthena Widget Set libXaw 1.0.7[0m
widget's internal width and height. The
resource converter for this resource con-
structs bitmaps from the contents of files.
(See [1mConverting Bitmaps [22mfor details.) If
this bitmap is one bit deep then the 1's will
be rendered in the foreground color, and the
0's in the background color. If [1mbitmap [22mhas a
depth greater than one, it is copied directly
into the window.
borderColor A pixel value which indexes the widget's col-
ormap to derive the border color of the wid-
get's window.
borderPixmap The border pixmap of this widget's window.
If this resource is set to anything other
than [1mXtUnspecifiedPixmap[22m, the pixmap speci-
fied will be used instead of the border
color.
borderWidth The width of this widget's window border.
callback A list of routines to be called when the
[1mnotify [22maction is invoked.
colormap The colormap that this widget will use.
cornerRoundPercent
When a [1mShapeStyle [22mof [1mroundedRectangle [22mis
used, this resource controls the radius of
the rounded corner. The radius of the
rounded corners is specified as a percentage
of the length of the shortest side of the
widget.
cursor The image that will be displayed as the
pointer cursor whenever it is in this widget.
The use of this resource is deprecated in
favor of [1mcursorName[22m.
cursorName The name of the symbol to use to represent
the pointer cursor. This resource will over-
ride the [1mcursor [22mresource if both are speci-
fied. (See 2.4.1)
depth The depth of this widget's window.
destroyCallbackAll functions on this list are called when
this widget is destroyed.
encoding The encoding method used by the value of the
[1mlabel [22mresource. The value may be [1mXawTextEn-[0m
[1mcoding8bit [22mor [1mXawTextEncodingChar2b[22m. When
[1minternational [22mis set to [1mtrue [22mthis resource is
[1m80[0m
[1mAthena Widget Set libXaw 1.0.7[0m
not used.
font The text font to use when displaying the
[1mlabel[22m, when the [1minternational [22mresource is
[1mfalse[22m.
fontSet The text font set to use when displaying the
[1mlabel[22m, when the [1minternational [22mresource is
[1mtrue[22m.
foreground A pixel value which indexes the widget's col-
ormap to derive the foreground color of the
widget's window. This color is also used to
render all 1's in a [1mbitmap [22mone plane deep.
height
width The height and width of this widget in pix-
els.
highlightThickness
The thickness of the rectangle that is used
to highlight the internal border of this wid-
get, alerting the user that it is ready to be
selected. The default value is 2 pixels if
the [1mshapeStyle [22mis [1mrectangle[22m, and 0 Pixels (no
highlighting) otherwise.
insensitiveBorder
This pixmap will be tiled into the widget's
border if the widget becomes insensitive.
internalHeight
internalWidth The minimum amount of space to leave between
the graphic and the vertical and horizontal
edges of the window.
international This is a boolean flag, only settable at wid-
get creation time. A value of [1mfalse [22msignals
the widget to use pre-R6 internationalization
(specifically, the lack thereof), such as
using fonts for displaying text, etc. A
value of [1mtrue [22mdirects the widget to act in an
internationalized manner, such as utilizing
font sets for displaying text, etc.
justify Specifies left, center, or right alignment of
graphic within the widget. This resource may
be specified with the values [1mXtJustifyLeft[22m,
[1mXtJustifyCenter[22m, or [1mXtJustifyRight[22m. A con-
verter is registered for this resource that
will convert the following strings: [1mleft,[0m
[1mright, [22mand [1mcenter[22m. This resource only has
noticeable effect when the width of the wid-
get is larger than necessary to display the
[1m81[0m
[1mAthena Widget Set libXaw 1.0.7[0m
graphic. Note that when the graphic is a
multi-line [1mlabel[22m, the longest line will obey
this justification while shorter lines will
be left-justified with the longest one.
label Specifies the text string to be displayed in
the widget's window if no bitmap is speci-
fied. The default is the name of this wid-
get. Regardless of the value of [1mencoding [22mor
[1minternational[22m, a single newline character (1
byte) will cause a line break.
leftBitmap Specifies a bitmap to display to the left of
the graphic in the widget's window.
mappedWhenManaged
If this resource is [1mTrue[22m, then the widget's
window will automatically be mapped by the
Toolkit when it is realized and managed.
pointerColor A pixel value which indexes the widget's col-
ormap to derive the foreground color of the
pointer symbol specified by the [1mcursorName[0m
resource.
pointerColorBackground
A pixel value which indexes the widget's
colormap to derive the background color of
the pointer symbol specified by the [1mcursor-[0m
[1mName [22mresource.
[1mradioData [22mSpecifies the data that will be returned by
[1mXawToggleGetCurrent [22mwhen this is the cur-
rently [4mset[24m widget in the radio group. This
value is also used to identify the Toggle
that will be set by a call to [1mXawToggle-[0m
[1mSetCurrent[22m. The value NULL will be returned
by [1mXawToggleGetCurrent [22mif no widget in a
radio group is currently set. Programmers
must not specify NULL (or Zero) as [1mradioData[22m.
[1mradioGroup [22mSpecifies another Toggle widget that is in
the radio group to which this Toggle widget
should be added. A radio group is a group of
at least two Toggle widgets, only one of
which may be [4mset[24m at a time. If this value is
NULL (the default) then the Toggle will not
be part of any radio group and can change
state without affecting any other Toggle wid-
gets. If the widget specified in this
resource is not already in a radio group then
a new radio group will be created containing
these two Toggle widgets. No Toggle widget
[1m82[0m
[1mAthena Widget Set libXaw 1.0.7[0m
can be in multiple radio groups. The behav-
ior of a radio group of one toggle is unde-
fined. A converter is registered which will
convert widget names to widgets without
caching.
resize Specifies whether the widget should attempt
to resize to its preferred dimensions when-
ever its resources are modified with [1mXtSet-[0m
[1mValues[22m. This attempt to resize may be denied
by the parent of this widget. The parent is
always free to resize the widget regardless
of the state of this resource.
screen The screen on which this widget is displayed.
This is not a settable resource.
sensitive Whether or not the toolkit should pass user
events to this widget. The widget will not
get input events if either [1mancestorSensitive[0m
or [1msensitive [22mis [1mFalse[22m.
shapeStyle Nonrectangular widgets may be created using
this resource. Nonrectangular widgets are
supported only on a server that supports the
[1mShape Extension[22m. If nonrectangular widgets
are specified for a server lacking this
extension, the shape is ignored and the wid-
gets will be rectangular. The following
shapes are currently supported: [1mXmuShapeRect-[0m
[1mangle[22m, [1mXmuShapeOval[22m, [1mXmuShapeEllipse[22m, and
[1mXmuShapeRoundedRectangle[22m. A converter is
registered for this resource that will con-
vert the following strings: [1mrectangle, oval,[0m
[1mellipse, [22mand [1mroundedRectangle[22m.
[1mstate [22mSpecifies whether the Toggle widget is set
([1mTrue[22m) or unset ([1mFalse[22m).
translations The event bindings associated with this wid-
get.
x
y The location of the upper left outside corner
of this widget in its parent.
[4m3.10.2.[24m [4mToggle[24m [4mActions[0m
The Toggle widget supports the following actions:
+o Switching the Toggle widget between the foreground and
background colors with [1mset [22mand [1munset [22mand [1mtoggle[0m
+o Processing application callbacks with [1mnotify[0m
[1m83[0m
[1mAthena Widget Set libXaw 1.0.7[0m
+o Switching the internal border between highlighted and
unhighlighted states with [1mhighlight [22mand [1munhighlight[0m
The following are the default translation bindings used by
the Toggle widget:
: highlight(Always)
: unhighlight()
,:toggle() notify()
[4m3.10.3.[24m [4mToggle[24m [4mActions[0m
The full list of actions supported by Toggle is:
[1mhighlight[22m([4mcondition[24m)
Displays the internal highlight border in the
color ([1mforeground [22mor [1mbackground [22m) that con-
trasts with the interior color of the Toggle
widget. The conditions [1mWhenUnset [22mand [1mAlways[0m
are understood by this action procedure. If
no argument is passed then [1mWhenUnset [22mis
assumed.
[1munhighlight[22m() Displays the internal highlight border in the
color ([1mforeground [22mor [1mbackground [22m) that
matches the interior color of the Toggle wid-
get.
[1mset[22m() Enters the [4mset[24m state, in which [1mnotify [22mis pos-
sible. This action causes the Toggle widget
to display its interior in the [1mforeground[0m
color. The label or bitmap is displayed in
the [1mbackground [22mcolor.
[1munset[22m() Cancels the [4mset[24m state and displays the inte-
rior of the Toggle widget in the [1mbackground[0m
color. The label or bitmap is displayed in
the [1mforeground [22mcolor.
[1mtoggle[22m() Changes the current state of the Toggle wid-
get, causing to be set if it was previously
unset, and unset if it was previously set.
If the widget is to be set, and is in a radio
group then this procedure may unset another
Toggle widget causing all routines on its
callback list to be invoked. The callback
routines for the Toggle that is to be unset
will be called before the one that is to be
set.
[1mreset[22m() Cancels any [1mset [22mor [1mhighlight [22mand displays the
[1m84[0m
[1mAthena Widget Set libXaw 1.0.7[0m
interior of the Toggle widget in the [1mback-[0m
[1mground [22mcolor, with the label displayed in the
[1mforeground [22mcolor.
[1mnotify[22m() When the Toggle widget is in the [1mset [22mstate
this action calls all functions in the call-
back list named by the [1mcallback [22mresource.
The value of the call_data argument in these
callback functions is undefined.
Note
When a bitmap of depth greater that one (1) is
specified the [4mset[24m(), [4munset[24m(), and [4mreset[24m() actions
have no effect, since there are no foreground and
background colors used in a multi-plane pixmap.
[4m3.10.4.[24m [4mRadio[24m [4mGroups[0m
There are typically two types of radio groups desired by
applications. The default translations for the Toggle wid-
get implement a "zero or one of many" radio group. This
means that there may be no more than one Toggle widget
active, but there need not be any Toggle widgets active.
The other type of radio group is "one of many" and has the
more strict policy that there will always be exactly one
radio button active. Toggle widgets can be used to provide
this interface with a slight modification to the translation
table of each Toggle in the group.
: highlight(Always)
: unhighlight()
,:set() notify()
This translation table will not allow any Toggle to be [4munset[0m
except as a result of another Toggle becoming [4mset[24m. It is
the application programmer's responsibility to choose an
initial state for the radio group by setting the [1mstate[0m
resource of one of its member widgets to [1mTrue[22m.
[4m3.10.5.[24m [4mConvenience[24m [4mRoutines[0m
The following functions allow easy access to the Toggle wid-
get's radio group functionality.
[4m3.10.5.1.[24m [4mChanging[24m [4mthe[24m [4mToggle's[24m [4mRadio[24m [4mGroup.[0m
To enable an application to change the Toggle's radio group,
add the Toggle to a radio group, or remove the Toggle from a
[1m85[0m
[1mAthena Widget Set libXaw 1.0.7[0m
radio group, use [1mXawToggleChangeRadioGroup[22m.
void XawToggleChangeRadioGroup([4mw[24m, [4mradio_group[24m)
Widget [4mw[24m, [4mradio_group[24m;
[4mw[24m Specifies the Toggle widget.
[4mradio_group[24mSpecifies any Toggle in the new radio group. If
NULL then the Toggle will be removed from any
radio group of which it is a member.
If a Toggle is already [4mset[24m in the new radio group, and the
Toggle to be added is also [4mset[24m then the previously [4mset[24m Tog-
gle in the radio group is [4munset[24m and its callback procedures
are invoked.
[4mFinding[24m [4mthe[24m [4mCurrently[24m [4mselected[24m [4mToggle[24m [4min[24m [4ma[24m [4mradio[24m [4mgroup[24m [4mof[0m
[4mToggles[0m
To find the currently selected Toggle in a radio group of
Toggle widgets use [1mXawToggleGetCurrent[22m.
XtPointer XawToggleGetCurrent([4mradio_group[24m);
Widget [4mradio_group[24m;
[4mradio_group[24mSpecifies any Toggle widget in the radio group.
The value returned by this function is the [4mradioData[24m of the
Toggle in this radio group that is currently set. The
default value for [4mradioData[24m is the name of that Toggle wid-
get. If no Toggle is set in the radio group specified then
NULL is returned.
[4mChanging[24m [4mthe[24m [4mToggle[24m [4mthat[24m [4mis[24m [4mset[24m [4min[24m [4ma[24m [4mradio[24m [4mgroup.[0m
To change the Toggle that is currently set in a radio group
use [1mXawToggleSetCurrent[22m.
void XawToggleSetCurrent([4mradio_group[24m, [4mradio_data[24m);
Widget [4mradio_group[24m;
XtPointer [4mradio_data[24m;
[4mradio_group[24mSpecifies any Toggle widget in the radio group.
[4mradio_data[24mSpecifies the [4mradioData[24m identifying the Toggle
that should be set in the radio group specified by
the [4mradio_group[24m argument.
[1mXawToggleSetCurrent [22mlocates the Toggle widget to be set by
matching [4mradio_data[24m against the [1mradioData [22mfor each Toggle in
the radio group. If none match, [1mXawToggleSetCurrent [22mreturns
[1m86[0m
[1mAthena Widget Set libXaw 1.0.7[0m
without making any changes. If more than one Toggle
matches, [1mXawToggleSetCurrent [22mwill choose a Toggle to set
arbitrarily. If this causes any Toggle widgets to change
state, all routines in their callback lists will be invoked.
The callback routines for a Toggle that is to be unset will
be called before the one that is to be set.
[4mUnsetting[24m [4mall[24m [4mToggles[24m [4min[24m [4ma[24m [4mradio[24m [4mgroup.[0m
To unset all Toggle widgets in a radio group use [1mXawToggle-[0m
[1mUnsetCurrent[22m.
void XawToggleUnsetCurrent([4mradio_group[24m);
Widget [4mradio_group[24m;
[4mradio_group[24mSpecifies any Toggle widget in the radio group.
If this causes a Toggle widget to change state, all routines
on its callback list will be invoked.
[1m87[0m
[1mAthena Widget Set libXaw 1.0.7[0m
[1mChapter 4[0m
[1mMenus[0m
The Athena widget set provides support for single paned non-
hierarchical popup and pulldown menus. Since menus are such
a common user interface tool, support for them must be pro-
vided in even the most basic widget sets. In menuing as in
other areas, the Athena Widget Set provides only basic func-
tionality.
Menus in the Athena widget set are implemented as a menu
container (the SimpleMenu widget) and a collection of
objects that comprise the menu entries. The SimpleMenu wid-
get is itself a direct subclass of the OverrideShell widget
class, so no other shell is necessary when creating a menu.
The managed children of a SimpleMenu must be subclasses of
the Sme (Simple Menu Entry) object.
The Athena widget set provides three classes of Sme objects
that may be used to build menus.
[1mSme [22mThe base class of all menu entries. It may be
used as a menu entry itself to provide blank space
in a menu. ``Sme'' means ``Simple Menu Entry.''
[1mSmeBSB [22mThis menu entry provides a selectable entry con-
taining a text string. A bitmap may also be
placed in the left and right margins. ``BSB''
means ``Bitmap String Bitmap.''
[1mSmeLine [22mThis menu entry provides an unselectable entry
containing a separator line.
The SimpleMenu widget informs the window manager that it
should ignore its window by setting the [1mOverride Redirect[0m
flag. This is the correct behavior for the press-drag-
release style of menu operation. If click-move-click or
``pinable''' menus are desired it is the responsibility of
the application programmer, using the SimpleMenu resources,
to inform the window manager of the menu.
To allow easy creation of pulldown menus, a MenuButton wid-
get is also provided as part of the Athena widget set.
[1m88[0m
[1mAthena Widget Set libXaw 1.0.7[0m
[4m4.1.[24m [4mUsing[24m [4mthe[24m [4mMenus[0m
The default configuration for the menus is press-drag-
release. The menus will typically be activated by clicking
a pointer button while the pointer is over a MenuButton,
causing the menu to appear in a fixed location relative to
that button; this is a [1mpulldown [22mmenu. Menus may also be
activated when a specific pointer and/or key sequence is
used anywhere in the application; this is a [1mpopup [22mmenu (e.g.
clicking Ctrl- in the common application
[1mxterm[22m). In this case the menu should be positioned under
the cursor. Typically menus will be placed so the pointer
cursor is on the first menu entry, or the last entry
selected by the user.
The menu remains on the screen as long as the pointer button
is held down. Moving the pointer will highlight different
menu items. If the pointer leaves the menu, or moves over
an entry that cannot be selected then no menu entry will
highlighted. When the desired menu entry has been high-
lighted, releasing the pointer button removes the menu, and
causes any mechanism associated with this entry to be
invoked.
[4m4.2.[24m [4mSimpleMenu[24m [4mWidget[0m
Application Header file
Class Header file
Class simpleMenuWidgetClass
Class Name SimpleMenu
Superclass OverrideShell
The SimpleMenu widget is a container for the menu entries.
It is a direct subclass of shell, and is should be created
with [1mXtCreatePopupShell[22m, not [1mXtCreateManagedWidget[22m. This is
the only part of the menu that actually is associated with a
window. The SimpleMenu serves as the glue to bind the indi-
vidual menu entries together into a menu.
[4m4.2.1.[24m [4mResources[0m
The resources associated with the SimpleMenu widget control
aspects that will affect the entire menu.
-------------------------------------------------------------------------------------------------------------
[4mName[24m [4mClass[24m [4mType[24m [4mNotes[24m [4mDefault[24m [4mValue[0m
-------------------------------------------------------------------------------------------------------------
accelerators Accelerators AcceleratorTable NULL
ancestorSensitive AncestorSensitive Boolean D True
[1m89[0m
[1mAthena Widget Set libXaw 1.0.7[0m
-------------------------------------------------------------------------------------------------------------
[4mName[24m [4mClass[24m [4mType[24m [4mNotes[24m [4mDefault[24m [4mValue[0m
-------------------------------------------------------------------------------------------------------------
allowShellResize AllowShellResize Boolean True
background Background Pixel XtDefaultBackground
backgroundPixmap Pixmap Pixmap XtUnspecifiedPixmap
backingStore BackingStore BackingStore see below
borderColor BorderColor Pixel XtDefaultForeground
borderPixmap Pixmap Pixmap XtUnspecifiedPixmap
borderWidth BorderWidth Dimension 1
bottomMargin VerticalMargins Dimension 0
children ReadOnly WidgetList R NULL
createPopupChildProc CreatePopupChildProc Function NULL
colormap Colormap Colormap Parent's Colormap
cursor Cursor Cursor None
depth Depth int C Parent's Depth
destroyCallback Callback XtCallbackList NULL
geometry Geometry String NULL
height Height Dimension Enough space to contain all entries
label Label String NULL
labelClass LabelClass Pointer SmeBSBObjectClass
mappedWhenManaged MappedWhenManaged Boolean True
menuOnScreen MenuOnScreen Boolean True
numChildren ReadOnly Cardinal R 0
overrideRedirect OverrideRedirect Boolean True
popdownCallback Callback XtCallbackList NULL
popupCallback Callback XtCallbackList NULL
popupOnEntry PopupOnEntry Widget A Label or first entry
rowHeight RowHeight Dimension 0
saveUnder SaveUnder Boolean False
screen Screen Screen R Parent's Screen
sensitive Sensitive Boolean True
topMargin VerticalMargins Dimension 0
translations Translations TranslationTable See below
visual Visual Visual CopyFromParent
width Width Dimension Width of widest entry
x Position Position 0
y Position Position 0
-------------------------------------------------------------------------------------------------------------
accelerators A list of event to action bindings to be exe-
cuted by this widget, even though the event
occurred in another widget. (See the [4mX[24m [4mTool-[0m
[4mkit[24m [4mIntrinsics[24m [4m--[24m [4mC[24m [4mLanguage[24m [4mInterface[24m for
details).
ancestorSensitive
The sensitivity state of the ancestors of
this widget. A widget is insensitive if
either it or any of its ancestors is insensi-
tive. This resource should not be changed
with [1mXtSetValues[22m, although it may be queried.
[1m90[0m
[1mAthena Widget Set libXaw 1.0.7[0m
[1mbackingStore [22mDetermines what type of backing store will be
used for the menu. Legal values for this
resource are [1mNotUseful[22m, [1mWhenMapped[22m, and
[1mAlways[22m. These values are the backing-store
integers defined in . A converter
is registered for this resource that will
convert the following strings: [1mnotUseful,[0m
[1mwhenMapped, always, [22mand [1mdefault[22m. If [1mdefault[0m
is specified (the default behavior) the
server will use whatever it thinks is appro-
priate.
background A pixel value which indexes the widget's col-
ormap to derive the background color of the
widget's window.
backgroundPixmapThe background pixmap of this widget's win-
dow. If this resource is set to anything
other than [1mXtUnspecifiedPixmap[22m, the pixmap
specified will be used instead of the back-
ground color.
borderColor A pixel value which indexes the widget's col-
ormap to derive the border color of the wid-
get's window.
borderPixmap The border pixmap of this widget's window.
If this resource is set to anything other
than [1mXtUnspecifiedPixmap[22m, the pixmap speci-
fied will be used instead of the border
color.
borderWidth The width of this widget's window border.
[1mbottomMargin[0m
[1mtopMargin [22mThe amount of space between the top or bottom
of the menu and the menu entry closest to
that edge.
children A list of all this composite widget's current
children.
colormap The colormap that this widget will use.
[1mcursor [22mThe shape of the mouse pointer whenever it is
in this widget.
depth The depth of this widget's window.
destroyCallbackAll functions on this list are called when
this widget is destroyed.
geometry If this resource is specified it will over-
ride the x, y, width and height of this
[1m91[0m
[1mAthena Widget Set libXaw 1.0.7[0m
widget. The format of this string is
[[4mwidth[24m>x[4mheight[24m>][{+ -} [4mxoffset[24m> {+
-}[4myoffset[24m>].
height
width The height and width of this widget in pix-
els.
[1mlabel [22mThis label will be placed at the top of the
SimpleMenu, and may not be highlighted. The
name of the label object is [1mmenuLabel[22m. Using
this name it is possible to modify the
label's attributes through the resource data-
base. When the label is created, the [1mlabel[0m
is hard coded to the value of [1mlabel[22m, and [1mjus-[0m
[1mtify [22mis hard coded as [1mXtJustifyCenter[22m.
[1mlabelClass [22mSpecifies the type of Sme object created as
the menu label.
mappedWhenManaged
If this resource is [1mTrue[22m, then the widget's
window will automatically be mapped by the
Toolkit when it is realized and managed.
[1mmenuOnScreen [22mIf the menu is automatically positioned under
the cursor with the [1mXawPositionSimpleMenu[0m
action, and this resource is [1mTrue[22m, then the
menu will always be fully visible on the
screen.
numChildren The number of children in this composite wid-
get.
overrideRedirectDetermines the value of the override_redi-
rect attribute of the SimpleMenu's window.
The override_redirect attribute of a window
determines whether or not a window manager
may interpose itself between this window and
the root window of the display. For more
information see the [4mInterclient[24m [4mCommunica-[0m
[4mtions[24m [4mConventions[24m [4mManual[24m.
popdownCallback
popupCallback These callback functions are called by the Xt
Intrinsics whenever the shell is popped up or
down (See [4mX[24m [4mToolkit[24m [4mIntrinsics[24m [4m--[24m [4mC[24m [4mLanguage[0m
[4mInterface[24m for details).
[1mpopupOnEntry [22mThe [1mXawPositionSimpleMenu [22maction will, by
default, popup the SimpleMenu with its label
(or first entry) directly under the pointer.
To popup the menu under another entry, set
this resource to the menu entry that should
[1m92[0m
[1mAthena Widget Set libXaw 1.0.7[0m
be under the pointer, when the menu is popped
up. This allows the application to offer the
user a default menu entry that can be
selected with out moving the pointer.
[1mrowHeight [22mIf this resources is zero (the default) then
each menu entry will be given its desired
height. If this resource has any other value
then all menu entries will be forced to be
[1mrowHeight [22mpixels high.
saveUnder If this is [1mTrue [22mthen save unders will be
active on the menu's window.
screen The screen on which this widget is displayed.
This is not a settable resource.
sensitive Whether or not the toolkit should pass user
events to this widget. The widget will not
get input events if either [1mancestorSensitive[0m
or [1msensitive [22mis [1mFalse[22m.
translations The event bindings associated with this wid-
get.
x
y The location of the upper left outside corner
of this widget in its parent.
[4m4.2.2.[24m [4mSimpleMenu[24m [4mActions[0m
The SimpleMenu widget supports the following actions:
+o Switching the entry under the mouse pointer between the
foreground and background colors with [1mhighlight [22mand
[1munhighlight[0m
+o Processing menu entry callbacks with [1mnotify[0m
The following are the default translation bindings used by
the SimpleMenu widget:
: highlight()
: unhighlight()
: highlight()
: MenuPopdown() notify() unhighlight()
The user can pop down the menu without activating any of the
callback functions by releasing the pointer button when no
[1m93[0m
[1mAthena Widget Set libXaw 1.0.7[0m
menu item is highlighted.
The full list of actions supported by SimpleMenu is:
[1mhighlight[22m() Highlight the menu entry that is currently
under the pointer. Only a item that is high-
lighted will be notified when the [1mnotify[0m
action is invoked. The look of a highlighted
entry is determined by the menu entry.
[1munhighlight[22m() Unhighlights the currently highlighted menu
item, and returns it to its normal look.
[1mnotify[22m() Notifies the menu entry that is currently
highlighted that is has been selected. It is
the responsibility of the menu entry to take
the appropriate action.
[1mMenuPopdown[22m([4mmenu[24m)
This action is defined in [4mX[24m [4mToolkit[24m [4mIntrin-[0m
[4msics[24m [4m--[24m [4mC[24m [4mLanguage[24m [4mInterface[24m.
[4m4.2.3.[24m [4mPositioning[24m [4mthe[24m [4mSimpleMenu[0m
If the SimpleMenu widget is to be used as a pulldown menu
then the MenuButton widget, or some other outside means
should be used to place the menu when it is popped up.
If popup menus are desired it will be necessary to add the
[1mXawPositionSimpleMenu [22mand [1mMenuPopup [22mactions to the transla-
tion table of the widget that will be popping up the menu.
The [1mMenuPopup [22maction is described in [4mX[24m [4mToolkit[24m [4mIntrinsics[24m [4m--[0m
[4mC[24m [4mLanguage[24m [4mInterface[24m. [1mXawPositionSimpleMenu [22mis a global
action procedure registered by the SimpleMenu widget when
the first one is created or the convenience routine [1mXawSim-[0m
[1mpleMenuAddGlobalActions [22mis called.
Translation writers should be aware that Xt does not regis-
ter grabs on ``don't care'' modifiers, and therefore the
left hand side of the production should be written to
exclude unspecified modifiers. For example these are the
translations needed to popup some of [1mxterm's [22mmenus:
!Ctrl: XawPositionSimpleMenu(xterm) MenuPopup(xterm)
!Ctrl: XawPositionSimpleMenu(modes) MenuPopup(modes)
[1mXawPositionSimpleMenu[22m([4mmenu[24m)
The [1mXawPositionSimpleMenu [22mroutine will
[1m94[0m
[1mAthena Widget Set libXaw 1.0.7[0m
search for the menu name passed to it
using [1mXtNameToWidget [22mstarting with the
widget invoking the action as the ref-
erence widget. If it is unsuccessful
it will continue up the widget tree
using each of the invoking widget's
ancestors as the reference widget. If
it is still unsuccessful it will print
a warning message and give up. [1mXawPo-[0m
[1msitionSimpleMenu [22mwill position the
menu directly under the pointer cur-
sor. The menu will be placed so that
the pointer cursor is centered on the
entry named by the [1mpopupOnEntry[0m
resource. If the [1mmenuOnScreen[0m
resource is [1mTrue [22mthen the menu will
always be fully visible on the screen.
[4m4.2.4.[24m [4mConvenience[24m [4mRoutines[0m
[4m4.2.4.1.[24m [4mRegistering[24m [4mthe[24m [4mGlobal[24m [4mAction[24m [4mRoutines[0m
The [1mXawPositionSimpleMenu [22maction routine may often be
invoked before any menus have been created. This can occur
when an application uses dynamic menu creation. In these
cases an application will need to register this global
action routine by calling [1mXawSimpleMenuAddGlobalActions[22m:
void XawSimpleMenuAddGlobalActions([4mapp_con[24m)
XtAppContext [4mapp_con[24m;
[4mapp_con[24m Specifies the application context in which this
action should be registered.
This function need only be called once per application and
must be called before any widget that uses [1mXawPositionSim-[0m
[1mpleMenu [22maction is realized.
[4m4.2.4.2.[24m [4mGetting[24m [4mand[24m [4mClearing[24m [4mthe[24m [4mCurrent[24m [4mMenu[24m [4mEntry[0m
To get the currently highlighted menu entry use [1mXawSimple-[0m
[1mMenuGetActiveEntry[22m:
Widget XawSimpleMenuGetActiveEntry([4mw[24m)
Widget [4mw[24m;
[4mw[24m Specifies the SimpleMenu widget.
This function returns the menu entry that is currently high-
lighted, or NULL if no entry is highlighted.
[1m95[0m
[1mAthena Widget Set libXaw 1.0.7[0m
To clear the SimpleMenu widget's internal information about
the currently highlighted menu entry use [1mXawSimpleMenuClear-[0m
[1mActiveEntry[22m:
Widget XawSimpleMenuClearActiveEntry([4mw[24m)
Widget [4mw[24m;
[4mw[24m Specifies the SimpleMenu widget.
This function unsets all internal references to the cur-
rently highlighted menu entry. It does not [4munhighlight[24m or
otherwise alter the appearance of the active entry. This
function is primarily for use by implementors of menu
entries.
[4m4.3.[24m [4mSmeBSB[24m [4mObject[0m
Application Header file
Class Header file
Class smeBSBObjectClass
Class Name SmeBSB
Superclass Sme
The SmeBSB object is used to create a menu entry that con-
tains a string, and optional bitmaps in its left and right
margins. Since each menu entry is an independent object,
the application is able to change the font, color, height,
and other attributes of the menu entries, on an entry by
entry basis. The format of the string may either be the
encoding of the 8 bit [1mfont [22mutilized, or in a multi-byte
encoding for use with a [1mfontSet[22m.
[4m4.3.1.[24m [4mResources[0m
The resources associated with the SmeBSB object are defined
in this section, and affect only the single menu entry spec-
ified by this object.
-----------------------------------------------------------------------------------------
[4mName[24m [4mClass[24m [4mType[24m [4mNotes[24m [4mDefault[24m [4mValue[0m
-----------------------------------------------------------------------------------------
ancestorSensitive AncestorSensitive Boolean D True
callback Callback Callback NULL
destroyCallback Callback XtCallbackList NULL
font Font FontStruct XtDefaultFont
fontSet FontSet XFontSet XtDefaultFontSet
foreground Foreground Pixel XtDefaultForeground
height Height Dimension A Font height + [1mvertSpace[0m
[1m96[0m
[1mAthena Widget Set libXaw 1.0.7[0m
-----------------------------------------------------------------------------------------
[4mName[24m [4mClass[24m [4mType[24m [4mNotes[24m [4mDefault[24m [4mValue[0m
-----------------------------------------------------------------------------------------
international International Boolean C False
justify Justify Justify XtjustifyLeft
label Label String NULL
leftBitmap LeftBitmap Pixmap XtUnspecifiedPixmap
leftMargin leftMargin Dimension 4
rightBitmap RightBitmap Pixmap XtUnspecifiedPixmap
rightMargin rightMargin Dimension 4
sensitive Sensitive Boolean True
vertSpace VertSpace int 25
width Width Dimension A TextWidth + margins
-----------------------------------------------------------------------------------------
ancestorSensitive
The sensitivity state of the ancestors of
this widget. A widget is insensitive if
either it or any of its ancestors is insensi-
tive. This resource should not be changed
with [1mXtSetValues[22m, although it may be queried.
[1mcallback [22mAll callback functions on this list are
called when the SimpleMenu [4mnotifies[24m this
entry that the user has selected it.
destroyCallbackAll functions on this list are called when
this widget is destroyed.
[1mfont [22mThe text font to use when displaying the
[1mlabel[22m, when the [1minternational [22mresource is
[1mfalse[22m.
[1mfontSet [22mThe text font set to use when displaying the
[1mlabel[22m, when the [1minternational [22mresource is
[1mtrue[22m.
[1mforeground [22mA pixel value which indexes the SimpleMenu's
colormap to derive the foreground color of
the menu entry's window. This color is also
used to render all 1's in the left and right
[1mbitmaps[22m.
height
width The height and width of this widget in pix-
els. Keep in mind that the SimpleMenu widget
will force the width of all menu entries to
be the width of the longest entry.
international This is a boolean flag, only settable at wid-
get creation time. A value of [1mfalse [22msignals
the widget to use pre-R6 internationalization
(specifically, the lack thereof), such as
[1m97[0m
[1mAthena Widget Set libXaw 1.0.7[0m
using fonts for displaying text, etc. A
value of [1mtrue [22mdirects the widget to act in an
internationalized manner, such as utilizing
font sets for displaying text, etc.
[1mjustify [22mHow the label is to be rendered between the
left and right margins when the space is
wider than the actual text. This resource
may be specified with the values [1mXtJusti-[0m
[1mfyLeft[22m, [1mXtJustifyCenter[22m, or [1mXtJustifyRight[22m.
When specifying the justification from a
resource file the values [1mleft[22m, [1mcenter[22m, or
[1mright [22mmay be used.
[1mlabel [22mThis is a the string that will be displayed
in the menu entry. The exact location of
this string within the bounds of the menu
entry is controlled by the [1mleftMargin[22m, [1mright-[0m
[1mMargin[22m, [1mvertSpace[22m, and [1mjustify [22mresources.
[1mleftBitmap[0m
[1mrightBitmap [22mThis is a name of a bitmap to display in the
left or right margin of the menu entry. All
1's in the bitmap will be rendered in the
foreground color, and all 0's will be drawn
in the background color of the SimpleMenu
widget. It is the programmers' responsibil-
ity to make sure that the menu entry is tall
enough, and the appropriate margin wide
enough to accept the bitmap. If care is not
taken the bitmap may extend into another menu
entry, or into this entry's label.
[1mleftMargin[0m
[1mrightMargin [22mThis is the amount of space (in pixels) that
will be left between the edge of the menu
entry and the label string.
sensitive Whether or not the toolkit should pass user
events to this widget. The widget will not
get input events if either [1mancestorSensitive[0m
or [1msensitive [22mis [1mFalse[22m.
[1mvertSpace [22mThis is the amount of vertical padding,
expressed as a percentage of the height of
the font, that is to be placed around the
label of a menu entry.. The label and bitmaps
are always centered vertically within the
menu. The default value for this resource
(25) causes the default height to be 125% of
the height of the font.
[1m98[0m
[1mAthena Widget Set libXaw 1.0.7[0m
[4m4.4.[24m [4mSmeLine[24m [4mObject[0m
Application Header file
Class Header file
Class smeLineObjectClass
Class Name SmeLine
Superclass Sme
The SmeLine object is used to add a horizontal line or menu
separator to a menu. Since each SmeLine is an independent
object, the application is able to change the color, height,
and other attributes of the SmeLine objects on an entry by
entry basis. This object is not selectable, and will not
highlight when the pointer cursor is over it.
[4m4.4.1.[24m [4mResources[0m
The resources associated with the SmeLine object are defined
in this section, and affect only the single menu entry spec-
ified by this object.
--------------------------------------------------------------------------------
[4mName[24m [4mClass[24m [4mType[24m [4mNotes[24m [4mDefault[24m [4mValue[0m
--------------------------------------------------------------------------------
destroyCallback Callback XtCallbackList NULL
foreground Foreground Pixel XtDefaultForeground
height Height Dimension [1mlineWidth[0m
international International Boolean C False
lineWidth LineWidth Dimension 1
stipple Stipple Pixmap XtUnspecifiedPixmap
width Width Dimension 1
--------------------------------------------------------------------------------
destroyCallbackAll functions on this list are called when
this widget is destroyed.
[1mforeground [22mA pixel value which indexes the SimpleMenu's
colormap to derive the foreground color used
to draw the separator line.
height
width The height and width of this widget in pix-
els. Keep in mind that the SimpleMenu widget
will force all menu items to be the width of
the widest entry. Thus, setting the width is
generally not very important.
international This is a boolean flag, only settable at wid-
get creation time. While not utilized in
[1m99[0m
[1mAthena Widget Set libXaw 1.0.7[0m
this widget, it can and should be checked by
any subclasses that have behavior that should
vary with locale.
[1mlineWidth [22mThe width of the horizontal line that is to
be displayed.
[1mstipple [22mIf a bitmap is specified for this resource,
the line will be stippled through it. This
allows the menu separator to be rendered as
something more exciting than just a line.
For instance, if you define a stipple that is
a chain link, then your menu separators will
look like chains.
[4m4.5.[24m [4mSme[24m [4mObject[0m
Application Header file
Class Header file
Class smeObjectClass
Class Name Sme
Superclass RectObj
The Sme object is the base class for all menu entries.
While this object is mainly intended to be subclassed, it
may be used in a menu to add blank space between menu
entries.
[4m4.5.1.[24m [4mResources[0m
The resources associated with the SmeLine object are defined
in this section, and affect only the single menu entry spec-
ified by this object. There are no new resources added for
this class, as it picks up all its resources from the Rec-
tObj class.
--------------------------------------------------------------------------------------
[4mName[24m [4mClass[24m [4mType[24m [4mNotes[24m [4mDefault[24m [4mValue[0m
--------------------------------------------------------------------------------------
ancestorSensitive AncestorSensitive Boolean True
callback Callback XtCallbackList NULL
destroyCallback Callback XtCallbackList NULL
height Height Dimension 0
international International Boolean C False
sensitive Sensitive Boolean True
width Width Dimension 1
--------------------------------------------------------------------------------------
ancestorSensitive
[1m100[0m
[1mAthena Widget Set libXaw 1.0.7[0m
The sensitivity state of the ancestors of
this widget. A widget is insensitive if
either it or any of its ancestors is insensi-
tive. This resource should not be changed
with [1mXtSetValues[22m, although it may be queried.
destroyCallbackAll functions on this list are called when
this widget is destroyed.
height
width The height and width of this widget in pix-
els. Keep in mind that the SimpleMenu widget
will force all menu items to be the width of
the widest entry.
[1minternational [22mThis is a boolean flag, only settable at wid-
get creation time. While not utilized in
this widget, it can and should be checked by
any subclasses that have behavior that should
vary with locale.
sensitive Whether or not the toolkit should pass user
events to this widget. The widget will not
get input events if either [1mancestorSensitive[0m
or [1msensitive [22mis [1mFalse[22m.
[4m4.5.2.[24m [4mSubclassing[24m [4mthe[24m [4mSme[24m [4mObject[0m
To Create a new Sme object [4mclass[24m you will need to define
three class methods. These methods allow the SimpleMenu to
highlight and unhighlight the menu entry as the pointer cur-
sor moves over it, as well as notify the entry when the user
has selected it. All of these methods may be inherited from
the Sme object, although the default semantics are not very
interesting.
[1mHighlight[22m()Called to put the menu entry into the highlighted
state.
[1mUnhighlight[22m()
Called to return the widget to its normal (unhigh-
lighted) state.
[1mNotify[22m() Called when the user selects this menu entry.
Other then these methods, creating a new object is straight
forward. Here is some information that may help you avoid
some common mistakes.
1) Objects can be zero pixels high.
2) Objects draw on their parent's window, therefore the
[1m101[0m
[1mAthena Widget Set libXaw 1.0.7[0m
Drawing dimensions are different from those of widgets.
For instance, y locations vary from [1my [22mto [1my + height[22m, not
[1m0 [22mto [1mheight[22m.
3) XtSetValues calls may come from the application while the
Sme is highlighted, and if the SetValues method returns
True, will result in an expose event. The SimpleMenu may
later call the menu entry's [1munhighlight [22mprocedure. How-
ever, due to the asynchronous nature of X, the expose
event generated by [1mXtSetValues [22mwill come [4mafter[24m this
unhighlight.
4) Remember that your subclass of the Sme does not own the
window. Share the space with other menu entries, and
refrain from drawing outside the subclass's own section
of the menu.
[4m4.6.[24m [4mMenuButton[24m [4mWidget[0m
Application Header file
Class Header file
Class menuButtonWidgetClass
Class Name MenuButton
Superclass Command
The MenuButton widget is an area, often rectangular, that
displays a graphic. The graphic may be a text string con-
taining multiple lines of characters in an 8 bit or 16 bit
character set (to be displayed with a [4mfont[24m), or in a multi-
byte encoding (for use with a [4mfontset[24m). The graphic may
also be a bitmap or pixmap.
When the pointer cursor is on a MenuButton widget, the
MenuButton becomes highlighted by drawing a rectangle around
its perimeter. This highlighting indicates that the
MenuButton is ready for selection. When a pointer button is
pressed, the MenuButton widget will pop up the menu named in
the [1mmenuName [22mresource.
[4m4.6.1.[24m [4mResources[0m
When creating a MenuButton widget instance, the following
resources are retrieved from the argument list or from the
resource database:
-------------------------------------------------------------------------------------------------
[4mName[24m [4mClass[24m [4mType[24m [4mNotesDefault[24m [4mValue[0m
-------------------------------------------------------------------------------------------------
[1m102[0m
[1mAthena Widget Set libXaw 1.0.7[0m
-------------------------------------------------------------------------------------------------
[4mName[24m [4mClass[24m [4mType[24m [4mNotesDefault[24m [4mValue[0m
-------------------------------------------------------------------------------------------------
accelerators Accelerators AcceleratorTable NULL
ancestorSensitive AncestorSensitive Boolean D True
background Background Pixel XtDefaultBackground
backgroundPixmap Pixmap Pixmap XtUnspecifiedPixmap
bitmap Bitmap Pixmap None
borderColor BorderColor Pixel XtDefaultForeground
borderPixmap Pixmap Pixmap XtUnspecifiedPixmap
borderWidth BorderWidth Dimension 1
callback Callback XtCallbackList NULL
colormap Colormap Colormap Parent's Colormap
cornerRoundPercent CornerRoundPercentDimension 25
cursor Cursor Cursor None
cursorName Cursor String None
depth Depth int C Parent's Depth
destroyCallback Callback XtCallbackList NULL
encoding Encoding UnsignedChar XawTextEncoding8bit
font Font XFontStruct XtDefaultFont
fontSet FontSet XFontSet XtDefaultFontSet
foreground Foreground Pixel XtDefaultForeground
height Height Dimension A graphic height + 2 * [1minternalHeight[0m
highlightThickness Thickness Dimension A 2 (0 if Shaped)
insensitiveBorder Insensitive Pixmap GreyPixmap
internalHeight Height Dimension 2
internalWidth Width Dimension 4
international International Boolean C False
justify Justify Justify XtJustifyCenter (center)
label Label String name of widget
leftBitmap LeftBitmap Bitmap None
mappedWhenManaged MappedWhenManaged Boolean True
menuName MenuName String "menu"
pointerColor Foreground Pixel XtDefaultForeground
pointerColorBackgroundBackground Pixel XtDefaultBackground
resize Resize Boolean True
screen Screen Screen R Parent's Screen
sensitive Sensitive Boolean True
shapeStype ShapeStyle ShapeStyle Rectangle
translations Translations TranslationTable See below
width Width Dimension A graphic width + 2 * [1minternalWidth[0m
x Position Position 0
y Position Position 0
-------------------------------------------------------------------------------------------------
accelerators A list of event to action bindings to be exe-
cuted by this widget, even though the event
occurred in another widget. (See the [4mX[24m [4mTool-[0m
[4mkit[24m [4mIntrinsics[24m [4m--[24m [4mC[24m [4mLanguage[24m [4mInterface[24m for
details).
ancestorSensitive
The sensitivity state of the ancestors of
[1m103[0m
[1mAthena Widget Set libXaw 1.0.7[0m
this widget. A widget is insensitive if
either it or any of its ancestors is insensi-
tive. This resource should not be changed
with [1mXtSetValues[22m, although it may be queried.
background A pixel value which indexes the widget's col-
ormap to derive the background color of the
widget's window.
backgroundPixmapThe background pixmap of this widget's win-
dow. If this resource is set to anything
other than [1mXtUnspecifiedPixmap[22m, the pixmap
specified will be used instead of the back-
ground color.
bitmap A bitmap to display instead of the [1mlabel[22m.
The default size of the widget will be just
large enough to contain the bitmap and the
widget's internal width and height. The
resource converter for this resource con-
structs bitmaps from the contents of files.
(See [1mConverting Bitmaps [22mfor details.) If
this bitmap is one bit deep then the 1's will
be rendered in the foreground color, and the
0's in the background color. If [1mbitmap [22mhas a
depth greater than one, it is copied directly
into the window.
borderColor A pixel value which indexes the widget's col-
ormap to derive the border color of the wid-
get's window.
borderPixmap The border pixmap of this widget's window.
If this resource is set to anything other
than [1mXtUnspecifiedPixmap[22m, the pixmap speci-
fied will be used instead of the border
color.
borderWidth The width of this widget's window border.
callback A list of routines to be called when the
[1mnotify [22maction is invoked.
colormap The colormap that this widget will use.
cornerRoundPercent
When a [1mShapeStyle [22mof [1mroundedRectangle [22mis
used, this resource controls the radius of
the rounded corner. The radius of the
rounded corners is specified as a percentage
of the length of the shortest side of the
widget.
cursor The image that will be displayed as the
[1m104[0m
[1mAthena Widget Set libXaw 1.0.7[0m
pointer cursor whenever it is in this widget.
The use of this resource is deprecated in
favor of [1mcursorName[22m.
cursorName The name of the symbol to use to represent
the pointer cursor. This resource will over-
ride the [1mcursor [22mresource if both are speci-
fied. (See 2.4.1)
depth The depth of this widget's window.
destroyCallbackAll functions on this list are called when
this widget is destroyed.
font The text font to use when displaying the
[1mlabel[22m, when the [1minternational [22mresource is
[1mfalse[22m.
fontSet The text font set to use when displaying the
[1mlabel[22m, when the [1minternational [22mresource is
[1mtrue[22m.
foreground A pixel value which indexes the widget's col-
ormap to derive the foreground color of the
widget's window. This color is also used to
render all 1's in a [1mbitmap [22mone plane deep.
height
width The height and width of this widget in pix-
els.
highlightThickness
The thickness of the rectangle that is used
to highlight the internal border of this wid-
get, alerting the user that it is ready to be
selected. The default value is 2 pixels if
the [1mshapeStyle [22mis [1mrectangle[22m, and 0 Pixels (no
highlighting) otherwise.
insensitiveBorder
This pixmap will be tiled into the widget's
border if the widget becomes insensitive.
internalHeight
internalWidth The minimum amount of space to leave between
the graphic and the vertical and horizontal
edges of the window.
international This is a boolean flag, only settable at wid-
get creation time. A value of [1mfalse [22msignals
the widget to use pre-R6 internationalization
(specifically, the lack thereof), such as
using fonts for displaying text, etc. A
value of [1mtrue [22mdirects the widget to act in an
[1m105[0m
[1mAthena Widget Set libXaw 1.0.7[0m
internationalized manner, such as utilizing
font sets for displaying text, etc.
justify Specifies left, center, or right alignment of
graphic within the widget. This resource may
be specified with the values [1mXtJustifyLeft[22m,
[1mXtJustifyCenter[22m, or [1mXtJustifyRight[22m. A con-
verter is registered for this resource that
will convert the following strings: [1mleft,[0m
[1mright, [22mand [1mcenter[22m. This resource only has
noticeable effect when the width of the wid-
get is larger than necessary to display the
graphic. Note that when the graphic is a
multi-line [1mlabel[22m, the longest line will obey
this justification while shorter lines will
be left-justified with the longest one.
label Specifies the text string to be displayed in
the widget's window if no bitmap is speci-
fied. The default is the name of this wid-
get. Regardless of the value of [1mencoding [22mor
[1minternational[22m, a single newline character (1
byte) will cause a line break.
mappedWhenManaged
If this resource is [1mTrue[22m, then the widget's
window will automatically be mapped by the
Toolkit when it is realized and managed.
[1mmenuName [22mThe name of a popup shell to popup as a menu.
The MenuButton will search for this name
using [1mXtNameToWidget [22mstarting with itself as
the reference widget. If the search is
unsuccessful the widget will continue up the
widget tree using each of its ancestors as
the reference widget passed to [1mXtNameToWid-[0m
[1mget[22m. If no widget of called [1mmenuName [22mis
found by this algorithm, the widget will
print a warning message and give up. When
the menu is found it will be popped up exclu-
sive and spring_loaded. The MenuButton wid-
get does not copy the value of this resource
into newly allocated memory. The application
programmer must pass the resource value in
nonvolatile memory.
pointerColor A pixel value which indexes the widget's col-
ormap to derive the foreground color of the
pointer symbol specified by the [1mcursorName[0m
resource.
pointerColorBackground
A pixel value which indexes the widget's
[1m106[0m
[1mAthena Widget Set libXaw 1.0.7[0m
colormap to derive the background color of
the pointer symbol specified by the [1mcursor-[0m
[1mName [22mresource.
resize Specifies whether the widget should attempt
to resize to its preferred dimensions when-
ever its resources are modified with [1mXtSet-[0m
[1mValues[22m. This attempt to resize may be denied
by the parent of this widget. The parent is
always free to resize the widget regardless
of the state of this resource.
screen The screen on which this widget is displayed.
This is not a settable resource.
sensitive Whether or not the toolkit should pass user
events to this widget. The widget will not
get input events if either [1mancestorSensitive[0m
or [1msensitive [22mis [1mFalse[22m.
shapeStyle Nonrectangular widgets may be created using
this resource. Nonrectangular widgets are
supported only on a server that supports the
[1mShape Extension[22m. If nonrectangular widgets
are specified for a server lacking this
extension, the shape is ignored and the wid-
gets will be rectangular. The following
shapes are currently supported: [1mXmuShapeRect-[0m
[1mangle[22m, [1mXmuShapeOval[22m, [1mXmuShapeEllipse[22m, and
[1mXmuShapeRoundedRectangle[22m. A converter is
registered for this resource that will con-
vert the following strings: [1mrectangle, oval,[0m
[1mellipse, [22mand [1mroundedRectangle[22m.
translations The event bindings associated with this wid-
get.
x
y The location of the upper left outside corner
of this widget in its parent.
[4m4.6.2.[24m [4mMenuButton[24m [4mActions[0m
The MenuButton widget supports the following actions:
+o Switching the button between the foreground and back-
ground colors with [1mset [22mand [1munset[0m
+o Processing application callbacks with [1mnotify[0m
+o Switching the internal border between highlighted and
unhighlighted states with [1mhighlight [22mand [1munhighlight[0m
+o Popping up a menu with [1mPopupMenu[0m
[1m107[0m
[1mAthena Widget Set libXaw 1.0.7[0m
The following are the default translation bindings used by
the MenuButton widget:
: highlight()
: reset()
: reset() PopupMenu(
[4m4.6.3.[24m [4mMenuButton[24m [4mActions[0m
The full list of actions supported by MenuButton is:
[1mhighlight[22m([4mcondition[24m)
Displays the internal highlight border in the
color ([1mforeground [22mor [1mbackground [22m) that con-
trasts with the interior color of the Command
widget. The conditions [1mWhenUnset [22mand [1mAlways[0m
are understood by this action procedure. If
no argument is passed, [1mWhenUnset [22mis assumed.
[1munhighlight[22m() Displays the internal highlight border in the
color ([1mXtNforeground [22mor [1mbackground [22m) that
matches the interior color of the MenuButton
widget.
[1mset[22m() Enters the [4mset[24m state, in which [1mnotify [22mis pos-
sible. This action causes the button to dis-
play its interior in the [1mforeground [22mcolor.
The label or bitmap is displayed in the [1mback-[0m
[1mground [22mcolor.
[1munset[22m() Cancels the [4mset[24m state and displays the inte-
rior of the button in the [1mbackground [22mcolor.
The label or bitmap is displayed in the [1mfore-[0m
[1mground [22mcolor.
[1mreset[22m() Cancels any [1mset [22mor [1mhighlight [22mand displays the
interior of the button in the [1mbackground[0m
color, with the label displayed in the [1mfore-[0m
[1mground [22mcolor.
[1mnotify[22m() When the button is in the [1mset [22mstate this
action calls all functions in the callback
list named by the [1mcallback [22mresource. The
value of the call_data argument in these
callback functions is undefined.
[1mPopupMenu[22m() Pops up the menu specified by the [1mmenuName[0m
resource.
The MenuButton widget does not place a server grab on
itself. Instead, PopupMenu is registered as a grab action.
[1m108[0m
[1mAthena Widget Set libXaw 1.0.7[0m
As a result, clients which popup menus without using
XtMenuPopup or MenuPopup or PopupMenu in translations will
fail to have a grab active. They should make a call to
XtRegisterGrabAction on the appropriate action in the appli-
cation initialization routine, or use a different transla-
tion.
[1m109[0m
[1mAthena Widget Set libXaw 1.0.7[0m
[1mChapter 5[0m
[1mText Widgets[0m
The Text widget provides a window that will allow an appli-
cation to display and edit one or more lines of text.
Options are provided to allow the user to add Scrollbars to
its window, search for a specific string, and modify the
text in the buffer.
The Text widget is made up of a number of pieces; it was
modularized to ease customization. The AsciiText widget
class (actually not limited to ASCII but so named for com-
patibility) is be general enough to most needs. If more
flexibility, special features, or extra functionality is
needed, they can be added by implementing a new TextSource
or TextSink, or by subclassing the Text Widget (See Section
5.8 for customization details.)
The words [4minsertion[24m [4mpoint[24m are used in this chapter to refer
to the text caret. This is the symbol that is displayed
between two characters in the file. The insertion point
marks the location where any new characters will be added to
the file. To avoid confusion the pointer cursor will always
be referred to as the [4mpointer[24m.
The text widget supports three edit modes, controlling the
types of modifications a user is allowed to make:
+o Append-only
+o Editable
+o Read-only
Read-only mode does not allow the user or the programmer to
modify the text in the widget. While the entire string may
be reset in read-only mode with [1mXtSetValues[22m, it cannot be
modified via with [1mXawTextReplace[22m. Append-only and editable
modes allow the text at the insertion point to be modified.
The only difference is that text may only be added to or
removed from the end of a buffer in append-only mode.
[4m5.1.[24m [4mText[24m [4mWidget[24m [4mfor[24m [4mUsers[0m
The Text widget provides many of the common keyboard editing
commands. These commands allow users to move around and
edit the buffer. If an illegal operation is attempted,
[1m110[0m
[1mAthena Widget Set libXaw 1.0.7[0m
(such as deleting characters in a read-only text widget),
the X server will beep.
[4m5.1.1.[24m [4mDefault[24m [4mKey[24m [4mBindings[0m
The default key bindings are patterned after those in the
EMACS text editor:
Ctrl-a Beginning Of Line Meta-b Backward Word
Ctrl-b Backward Character Meta-f Forward Word
Ctrl-d Delete Next Character Meta-iInsert File
Ctrl-e End Of Line Meta-k Kill To End Of Paragraph
Ctrl-f Forward Character Meta-q Form Paragraph
Ctrl-g Multiply Reset Meta-v Previous Page
Ctrl-h Delete Previous Character Meta-yInsert Current Selection
Ctrl-j Newline And Indent Meta-z Scroll One Line Down
Ctrl-k Kill To End Of Line Meta-d Delete Next Word
Ctrl-l Redraw Display Meta-D Kill Word
Ctrl-m Newline Meta-h Delete Previous Word
Ctrl-n Next Line Meta-H Backward Kill Word
Ctrl-o Newline And Backup Meta-< Beginning Of File
Ctrl-p Previous Line Meta-> End Of File
Ctrl-r Search/Replace Backward Meta-]Forward Paragraph
Ctrl-s Search/Replace Forward Meta-[Backward Paragraph
Ctrl-t Transpose Characters
Ctrl-u Multiply by 4 Meta-Delete Delete Previous Word
Ctrl-v Next Page Meta-Shift DeleteKill Previous Word
Ctrl-w Kill Selection Meta-Backspace Delete Previous Word
Ctrl-y Unkill Meta-Shift BackspaceKill Previous Word
Ctrl-z Scroll One Line Up
Ctrl-\ Reconnect to input method
Kanji Reconnect to input method
In addition, the pointer may be used to cut and paste text:
Button 1 Down Start Selection
Button 1 MotionAdjust Selection
Button 1 Up End Selection (cut)
Button 2 Down Insert Current Selection (paste)
Button 3 Down Extend Current Selection
Button 3 MotionAdjust Selection
Button 3 Up End Selection (cut)
Since all of these key and pointer bindings are set through
the translations and resource manager, the user and the
application programmer can modify them by changing the Text
[1m111[0m
[1mAthena Widget Set libXaw 1.0.7[0m
widget's [1mtranslations [22mresource.
[4m5.1.2.[24m [4mSearch[24m [4mand[24m [4mReplace[0m
The Text widget provides a search popup that can be used to
search for a string within the current Text widget. The
popup can be activated by typing either [4mControl-r[24m or [4mCon-[0m
[4mtrol-s[24m. If [4mControl-s[24m is used the search will be forward in
the file from the current location of the insertion point;
if [4mControl-r[24m is used the search will be backward. The acti-
vated popup is placed under the pointer. It has a number of
buttons that allow both text searches and text replacements
to be performed.
At the top of the search popup are two toggle buttons
labeled [4mbackward[24m and [4mforward[24m. One of these buttons will
always be highlighted; this is the direction in which the
search will be performed. The user can change the direction
at any time by clicking on the appropriate button.
Directly under the buttons there are two text areas, one
labeled [4mSearch[24m [4mfor:[24m and the other labeled [4mReplace[24m [4mwith:[24m. If
this is a read-only Text widget the [4mReplace[24m [4mwith:[24m field will
be insensitive and no replacements will be allowed. After
each of these labels will be a text field. This field will
allow the user to enter a string to search for and the
string to replace it with. Only one of these text fields
will have a window border around it; this is the active text
field. Any key presses that occur when the focus in in the
search popup will be directed to the active text field.
There are also a few special key sequences:
[1mCarriage Return[22m: Execute the action, and pop down the search widget.
[1mTab[22m: Execute the action, then move to the next field.
[1mShift Carriage Return[22m:Execute the action, then move to the next field.
[1mControl-q Tab[22m: Enter a Tab into a text field.
[1mControl-c[22m: Pop down the search popup.
Using these special key sequences should allow simple
searches without ever removing one's hands from the key-
board.
Near the bottom of the search popup is a row of buttons.
These buttons allow the same actions to to be performed as
the key sequences, but the buttons will leave the popup
active. This can be quite useful if many searches are being
performed, as the popup will be left on the display. Since
the search popup is a transient window, it may be picked up
with the window manager and pulled off to the side for use
at a later time.
[1mSearch [22mSearch for the specified string.
[1m112[0m
[1mAthena Widget Set libXaw 1.0.7[0m
[1mReplace [22mReplace the currently highlighted string with
the string in the [4mReplace[24m [4mwith[24m text field,
and move onto the next occurrence of the
[4mSearch[24m [4mfor[24m text field. The functionality is
commonly referred to as query-replace.
[1mReplace-All [22mReplace all occurrences of the search string
with the replace string from the current
insertion point position to the end (or
beginning) of the file. There is no key
sequence to perform this action.
[1mCancel [22mRemove the search popup from the screen.
Finally, when [1minternational [22mresource is [1mtrue[22m, there may be a
pre-edit buffer below the button row, for composing input.
Its presence is determined by the X locale in use and the
VendorShell's [1mpreeditType [22mresource.
The widget hierarchy for the search popup is show below, all
widgets are listed by class and instance name.
Text
TransientShell search
Form form
Label label1
Label label2
Toggle backwards
Toggle forwards
Label searchLabel
Text searchText
Label replaceLabel
Text replaceText
Command search
Command replaceOne
Command replaceAll
Command cancel
[4m5.1.3.[24m [4mFile[24m [4mInsertion[0m
To insert a file into a text widget, type the key sequence
[4mMeta-i[24m, which will activate the file insert popup. This
popup will appear under the pointer, and any text typed
while the focus is in this popup will be redirected to the
text field used for the filename. When the desired filename
has been entered, click on [4mInsert[24m [4mFile[24m, or type [4mCarriage[0m
[4mReturn[24m. The named file will then be inserted in the text
widget beginning at the insertion point position. If an
error occurs when opening the file, an error message will be
printed, prompting the user to enter the filename again.
The file insert may be aborted by clicking on [4mCancel[24m. If
[4mMeta-i[24m is typed at a text widget that is read-only, it will
beep, as no file insertion is allowed.
[1m113[0m
[1mAthena Widget Set libXaw 1.0.7[0m
The widget hierarchy for the file insert popup is show
below; all widgets are listed by class and instance name.
Text
TransientShell insertFile
Form form
Label label
Text text
Command insert
Command cancel
[4m5.1.4.[24m [4mText[24m [4mSelections[24m [4mfor[24m [4mUsers[0m
The text widgets have a text selection mechanism that allows
the user to copy pieces of the text into the [1mPRIMARY [22mselec-
tion, and paste into the text widget some text that another
application (or text widget) has put in the [1mPRIMARY [22mselec-
tion.
One method of selecting text is to press pointer button 1 on
the beginning of the text to be selected, drag the pointer
until all of the desired text is highlighted, and then
release the button to activate the selection. Another
method is to click pointer button 1 at one end of the text
to be selected, then click pointer button 3 at the other
end.
To modify a currently active selection, press pointer button
3 near either the end of the selection that you want to
adjust. This end of the selection may be moved while hold-
ing down pointer button 3. When the proper area has been
highlighted release the pointer button to activate the
selection.
The selected text may now be pasted into another applica-
tion, and will remain active until some other client makes a
selection. To paste text that some other application has
put into the [1mPRIMARY [22mselection use pointer button 2. First
place the insertion point where you would like the text to
be inserted, then click and release pointer button 2.
Rapidly clicking pointer button 1 the following number of
times will adjust the selection as described.
[1mTwo [22mSelect the word under the pointer. A word bound-
ary is defined by the Text widget to be a Space,
Tab, or Carriage Return.
[1mThree [22mSelect the line under the pointer.
[1mFour [22mSelect the paragraph under the pointer. A para-
graph boundary is defined by the text widget as
two Carriage Returns in a row with only Spaces or
Tabs between them.
[1m114[0m
[1mAthena Widget Set libXaw 1.0.7[0m
[1mFive [22mSelect the entire text buffer.
To unset the text selection, click pointer button 1 without
moving it.
[4m5.2.[24m [4mText[24m [4mWidget[24m [4mActions[0m
All editing functions are performed by translation manager
actions that may be specified through the [1mtranslations[0m
resource in the Text widget.
Insert Point Movement Delete
forward-character delete-next-character
backward-character delete-previous-character
forward-word delete-next-word
backward-word delete-previous-word
forward-paragraph delete-selection
backward-paragraph
beginning-of-line
end-of-line Selection
next-line select-word
previous-line select-all
next-page select-start
previous-page select-adjust
beginning-of-file select-end
end-of-file extend-start
scroll-one-line-up extend-adjust
scroll-one-line-down extend-end
insert-selection
Miscellaneous New Line
redraw-display newline-and-indent
insert-file newline-and-backup
insert-char newline
insert-string
display-caret
focus-in Kill
focus-in kill-word
search backward-kill-word
multiply kill-selection
form-paragraph kill-to-end-of-line
transpose-characters kill-paragraph
no-op kill-to-end-of-paragraph
XawWMProtocols
reconnect-im
Most of the actions take no arguments, and unless otherwise
noted you may assume this to be the case.
[1m115[0m
[1mAthena Widget Set libXaw 1.0.7[0m
[4m5.2.1.[24m [4mCursor[24m [4mMovement[24m [4mActions[0m
forward-character()
backward-character()These actions move the insert point for-
ward or backward one character in the
buffer. If the insert point is at the
end or beginning of a line this action
will move the insert point to the next
(or previous) line.
forward-word()
backward-word() These actions move the insert point to
the next or previous word boundary. A
word boundary is defined as a Space, Tab
or Carriage Return.
forward-paragraph()
backward-paragraph()These actions move the insert point to
the next or previous paragraph boundary.
A paragraph boundary is defined as two
Carriage Returns in a row with only Spa-
ces or Tabs between them.
beginning-of-line()
end-of-line() These actions move to the beginning or
end of the current line. If the insert
point is already at the end or beginning
of the line then no action is taken.
next-line()
previous-line() These actions move the insert point up
or down one line. If the insert point
is currently N characters from the
beginning of the line then it will be N
characters from the beginning of the
next or previous line. If N is past the
end of the line, the insert point is
placed at the end of the line.
next-page()
previous-page() These actions move the insert point up
or down one page in the file. One page
is defined as the current height of the
text widget. The insert point is always
placed at the first character of the top
line by this action.
beginning-of-file()
end-of-file() These actions place the insert point at
the beginning or end of the current text
buffer. The text widget is then
scrolled the minimum amount necessary to
[1m116[0m
[1mAthena Widget Set libXaw 1.0.7[0m
make the new insert point location visi-
ble.
scroll-one-line-up()
scroll-one-line-down()
These actions scroll the current text
field up or down by one line. They do
not move the insert point. Other than
the scrollbars this is the only way that
the insert point may be moved off of the
visible text area. The widget will be
scrolled so that the insert point is
back on the screen as soon as some other
action is executed.
[4m5.2.2.[24m [4mDelete[24m [4mActions[0m
delete-next-character()
delete-previous-character()
These actions remove the character imme-
diately before or after the insert
point. If a Carriage Return is removed
then the next line is appended to the
end of the current line.
delete-next-word()
delete-previous-word()
These actions remove all characters
between the insert point location and
the next word boundary. A word boundary
is defined as a Space, Tab or Carriage
Return.
delete-selection() This action removes all characters in
the current selection. The selection
can be set with the selection actions.
[4m5.2.3.[24m [4mSelection[24m [4mActions[0m
select-word() This action selects the word in which
the insert point is currently located.
If the insert point is between words
then it will select the previous word.
select-all() This action selects the entire text buf-
fer.
select-start() This action sets the insert point to the
current pointer location (if triggered
by a button event) or text cursor
[1m117[0m
[1mAthena Widget Set libXaw 1.0.7[0m
location (if triggered by a key event).
It will then begin a selection at this
location. If many of these selection
actions occur quickly in succession then
the selection count mechanism will be
invoked (see the section titled [1mText[0m
[1mSelections for Application Programmers[0m
for details).
select-adjust() This action allows a selection started
with the [4mselect-start[24m action to be modi-
fied, as described above.
select-end([4mname[24m[,[4mname[24m,...])
This action ends a text selection that
began with the [4mselect-start[24m action, and
asserts ownership of the selection or
selections specified. A [4mname[24m can be a
selection (e.g., [1mPRIMARY[22m) or a cut buf-
fer (e.g., [1mCUT_BUFFER0[22m). Note that case
is important. If no [4mnames[24m are speci-
fied, [1mPRIMARY [22mis asserted.
extend-start() This action finds the nearest end of the
current selection, and moves it to the
current pointer location (if triggered
by a button event) or text cursor loca-
tion (if triggered by a key event).
extend-adjust() This action allows a selection started
with an [4mextend-start[24m action to be modi-
fied.
extend-end([4mname[24m[,[4mname[24m,...])
This action ends a text selection that
began with the [4mextend-start[24m action, and
asserts ownership of the selection or
selections specified. A [4mname[24m can be a
selection (e.g. [1mPRIMARY[22m) or a cut buffer
(e.g [1mCUT_BUFFER0[22m). Note that case is
important. If no names are given, [1mPRI-[0m
[1mMARY [22mis asserted.
insert-selection([4mname[24m[,[4mname[24m,...])
This action retrieves the value of the
first (left-most) named selection that
exists or the cut buffer that is not
empty and inserts it into the Text wid-
get at the current insert point loca-
tion. A [4mname[24m can be a selection (e.g.
[1mPRIMARY[22m) or a cut buffer (e.g [1mCUT_BUF-[0m
[1mFER0[22m). Note that case is important.
[1m118[0m
[1mAthena Widget Set libXaw 1.0.7[0m
[4m5.2.4.[24m [4mThe[24m [4mNew[24m [4mLine[24m [4mActions[0m
newline-and-indent()This action inserts a newline into the
text and adds spaces to that line to
indent it to match the previous line.
newline-and-backup()This action inserts a newline into the
text [4mafter[24m the insert point.
newline() This action inserts a newline into the
text [4mbefore[24m the insert point.
[4m5.2.5.[24m [4mKill[24m [4mand[24m [4mActions[0m
kill-word()
backward-kill-word()These actions act exactly like the
[4mdelete-next-word[24m and [4mdelete-previous-[0m
[4mword[24m actions, but they stuff the word
that was killed into the kill buffer
([1mCUT_BUFFER_1[22m).
kill-selection() This action deletes the current selec-
tion and stuffs the deleted text into
the kill buffer ([1mCUT_BUFFER_1[22m).
kill-to-end-of-line()This action deletes the entire line to
the right of the insert point position,
and stuffs the deleted text into the
kill buffer ([1mCUT_BUFFER_1[22m).
kill-paragraph() This action deletes the current para-
graph, if between paragraphs it deletes
the paragraph above the insert point,
and stuffs the deleted text into the
kill buffer ([1mCUT_BUFFER_1[22m).
kill-to-end-of-paragraph()
This action deletes everything between
the current insert point location and
the next paragraph boundary, and stuffs
the deleted text into the kill buffer
([1mCUT_BUFFER_1[22m).
[4m5.2.6.[24m [4mMiscellaneous[24m [4mActions[0m
redraw-display() This action recomputes the location of
all the text lines on the display,
scrolls the text to vertically center
[1m119[0m
[1mAthena Widget Set libXaw 1.0.7[0m
the line containing the insert point on
the screen, clears the entire screen,
and redisplays it.
insert-file([[4mfilename[24m])
This action activates the insert file
popup. The [4mfilename[24m option specifies
the default filename to put in the file-
name buffer of the popup. If no [4mfile-[0m
[4mname[24m is specified the buffer is empty at
startup.
insert-char() This action may only be attached to a
key event. When the [1minternational[0m
resource is [1mfalse[22m, this action calls
XLookupString to translate the event
into a (rebindable) Latin-1 character
(sequence) and inserts it into the text
at the insert point. When the [1minterna-[0m
[1mtional [22mresource is [1mtrue[22m, characters are
passed to the input method via
XwcLookupString, and any committed
string returned is inserted into the
text at the insert point.
insert-string([4mstring[24m[,[4mstring[24m,...])
This action inserts each [4mstring[24m into the
text at the insert point location. Any
[4mstring[24m beginning with the characters
"0x" followed by an even number of hexa-
decimal digits is interpreted as a hexa-
decimal constant and the corresponding
string is inserted instead. This hexa-
decimal string may represent up to 50
8-bit characters.
When the[1minternational [22mresource is [1mtrue[22m,
a hexadecimal string is intrepeted as
being in a multi-byte encoding, and a
hexadecimal or regular string will
result in an error message if it is not
legal in the current locale.
display-caret([4mstate[24m,[4mwhen[24m)
This action allows the insert point to
be turned on and off. The [4mstate[24m argu-
ment specifies the desired state of the
insert point. This value may be any of
the string values accepted for Boolean
resources (e.g. [1mon[22m, [1mTrue[22m, [1moff[22m, [1mFalse[22m,
etc.). If no arguments are specified,
the default value is [1mTrue[22m. The [4mwhen[0m
argument specifies, for [1mEnterNotify [22mor
[1mLeaveNotify [22mevents whether or not the
focus field in the event is to be
[1m120[0m
[1mAthena Widget Set libXaw 1.0.7[0m
examined. If the second argument is not
specified, or specified as something
other than [1malways [22mthen if the action is
bound to an [1mEnterNotify [22mor [1mLeaveNotify[0m
event, the action will be taken only if
the focus field is [1mTrue[22m. An augmented
binding that might be useful is:
*Text.Translations: #override \
: display-caret(on) \n\
: display-caret(off)
focus-in()
focus-out() These actions do not currently do any-
thing.
search([4mdirection[24m,[[4mstring[24m])
This action activates the search popup.
The [4mdirection[24m must be specified as
either [1mforward [22mor [1mbackward[22m. The string
is optional and is used as an initial
value for the [4mSearch[24m [4mfor[24m: string. For
further explanation of the search widget
see the section on [1mText Searches[22m.
multiply([4mvalue[24m) The multiply action allows the user to
multiply the effects of many of the text
actions. Thus the following action
sequence [4mmultiply(10)[24m [4mdelete-next-word()[0m
will delete 10 words. It does not mat-
ter whether these actions take place in
one event or many events. Using the
default translations the key sequence
[4mControl-u,[24m [4mControl-d[24m will delete 4 char-
acters. Multiply actions can be
chained, thus [4mmultiply(5)[24m [4mmultiply(5)[24m is
the same as [4mmultiply(25)[24m. If the string
[1mreset [22mis passed to the multiply action
the effects of all previous multiplies
are removed and a beep is sent to the
display.
form-paragraph() This action removes all the Carriage
Returns from the current paragraph and
reinserts them so that each line is as
long as possible, while still fitting on
the current screen. Lines are broken at
word boundaries if at all possible.
This action currently works only on Text
widgets that use ASCII text.
transpose-characters()
[1m121[0m
[1mAthena Widget Set libXaw 1.0.7[0m
This action will swap the position of
the character to the left of the insert
point with the character to the right of
the insert point. The insert point will
then be advanced one character.
no-op([[4maction[24m]) The no-op action makes no change to the
text widget, and is mainly used to over-
ride translations. This action takes
one optional argument. If this argument
is [4mRingBell[24m then a beep is sent to the
display.
XawWMProtocols([[4mwm_protocol_name[24m])
This action is written specifically for
the file insertion and the search and
replace dialog boxes. This action is
attached to those shells by the Text
widget, in order to handle ClientMessage
events with the WM_PROTOCOLS atom in the
detail field. This action supports
WM_DELETE_WINDOW on the Text widget pop-
ups, and may support other window man-
ager protocols if necessary in the
future. The popup will be dismissed if
the window manager sends a
WM_DELETE_WINDOW request and there are
no parameters in the action call, which
is the default. The popup will also be
dismissed if the parameters include the
string ``wm_delete_window,'' and the
event is a ClientMessage event request-
ing dismissal or is not a ClientMessage
event. This action is not sensitive to
the case of the strings passed as param-
eters.
reconnect-im() When the [1minternational [22mresource is [1mtrue[22m,
input is usually passed to an input
method, a separate process, for compos-
ing. Sometimes the connection to this
process gets severed; this action will
attempt to reconnect it. Causes for
severage include network trouble, and
the user explicitly killing one input
method and starting a new one. This
action may also establish first connec-
tion when the application is started
before the input method.
[4m5.2.7.[24m [4mText[24m [4mSelections[24m [4mfor[24m [4mApplication[24m [4mProgrammers[0m
The default behavior of the text selection array is
[1m122[0m
[1mAthena Widget Set libXaw 1.0.7[0m
described in the section called [1mText Selections for Users[22m.
To modify the selections a programmer must construct a [1mXaw-[0m
[1mTextSelectType [22marray (called the selection array), contain-
ing the selections desired, and pass this as the new value
for the [1mselectionTypes [22mresource. The selection array may
also be modified using the [1mXawTextSetSelectionArray [22mfunc-
tion. All selection arrays must end with the value [1mXawse-[0m
[1mlectNull[22m. The [1mselectionTypes [22mresource has no converter reg-
istered and cannot be modified through the resource manager.
The array contains a list of entries that will be called
when the user attempts to select text in rapid succession
with the [4mselect-start[24m action (usually by clicking a pointer
button). The first entry in the selection array will be
used when the [4mselect-start[24m action is initially called. The
next entry will be used when [4mselect-start[24m is called again,
and so on. If a timeout value (1/10 of a second) is
exceeded, the the next [4mselect-start[24m action will begin at the
top of the selection array. When [1mXawselectNull [22mis reached
the array is recycled beginning with the first element.
[1mXawselectAll [22mSelects the contents of the entire buffer.
[1mXawse- [22mSelects text characters as the pointer
[1mlectChar [22mmoves over them.
[1mXawselect- [22mSelects the entire line.
[1mLine[0m
[1mXawselect- [22mIndicates the end of the selection array.
[1mNull[0m
[1mXawselect- [22mSelects the entire paragraph.
[1mParagraph[0m
[1mXawselectPo- [22mSelects the current pointer position.
[1msition[0m
[1mXawselect- [22mSelects whole words as the pointer moves
[1mWord [22monto them.
The default selectType array is:
{XawselectPosition, XawselectWord, XawselectLine, XawselectParagraph, XawselectAll, XawselectNull}
The selection array is not copied by the text widgets. The
application must allocate space for the array and cannot
deallocate or change it until the text widget is destroyed
or until a new selection array is set.
[4m5.3.[24m [4mDefault[24m [4mTranslation[24m [4mBindings[0m
The following translations are defaults built into every
Text widget. They can be overridden, or replaced by speci-
fying a new value for the Text widget's [1mtranslations[0m
[1m123[0m
[1mAthena Widget Set libXaw 1.0.7[0m
resource.
CtrlA: beginning-of-line() \n\
CtrlB: backward-character() \n\
CtrlD: delete-next-character() \n\
CtrlE: end-of-line() \n\
CtrlF: forward-character() \n\
CtrlG: multiply(Reset) \n\
CtrlH: delete-previous-character() \n\
CtrlJ: newline-and-indent() \n\
CtrlK: kill-to-end-of-line() \n\
CtrlL: redraw-display() \n\
CtrlM: newline() \n\
CtrlN: next-line() \n\
CtrlO: newline-and-backup() \n\
CtrlP: previous-line() \n\
CtrlR: search(backward) \n\
CtrlS: search(forward) \n\
CtrlT: transpose-characters() \n\
CtrlU: multiply(4) \n\
CtrlV: next-page() \n\
CtrlW: kill-selection() \n\
CtrlY: insert-selection(CUT_BUFFER1) \n\
CtrlZ: scroll-one-line-up() \n\
Ctrl\: reconnect-im() \n\
MetaB: backward-word() \n\
MetaF: forward-word() \n\
MetaI: insert-file() \n\
MetaK: kill-to-end-of-paragraph() \n\
MetaQ: form-paragraph() \n\
MetaV: previous-page() \n\
MetaY: insert-selection(PRIMARY, CUT_BUFFER0) \n\
MetaZ: scroll-one-line-down() \n\
:Metad: delete-next-word() \n\
:MetaD: kill-word() \n\
:Metah: delete-previous-word() \n\
:MetaH: backward-kill-word() \n\
:Meta\\>: end-of-file() \n\
:Meta]: forward-paragraph() \n\
:Meta[: backward-paragraph() \n\
~Shift MetaDelete:delete-previous-word() \n\
Shift MetaDelete:backward-kill-word() \n\
~Shift MetaBackspace:delete-previous-word() \n\
Shift MetaBackspace:backward-kill-word() \n\
Right: forward-character() \n\
Left: backward-character() \n\
Down: next-line() \n\
Up: previous-line() \n\
Delete: delete-previous-character() \n\
BackSpace: delete-previous-character() \n\
Linefeed: newline-and-indent() \n\
[1m124[0m
[1mAthena Widget Set libXaw 1.0.7[0m
Return: newline() \n\
: insert-char() \n\
Kanji: reconnect-im() \n\
: focus-in() \n\
: focus-out() \n\
: select-start() \n\
: extend-adjust() \n\
: extend-end(PRIMARY, CUT_BUFFER0) \n\
: insert-selection(PRIMARY, CUT_BUFFER0) \n\
: extend-start() \n\
: extend-adjust() \n\
: extend-end(PRIMARY, CUT_BUFFER0) \n
[4m5.4.[24m [4mText[24m [4mFunctions[0m
The following functions are provided as convenience routines
for use with the Text widget. Although many of these
actions can be performed by modifying resources, these
interfaces are frequently more efficient.
These data structures are defined in the Text widget's pub-
lic header file, .
typedef long XawTextPosition;
Character positions in the Text widget begin at 0 and end at
n, where n is the number of characters in the Text source
widget.
typedef struct {
int [4mfirstPos[24m;
int [4mlength[24m;
char *[4mptr[24m;
unsigned long [4mformat[24m;
} XawTextBlock, *XawTextBlockPtr;
[4mfirstPos[24m The first position, or index, to use within the
[4mptr[24m field. The value is commonly zero.
[4mlength[24m The number of characters to be used from the [4mptr[0m
field. The number of characters used is commonly
the number of characters in [4mptr[24m, and must not be
greater than the length of the string in [4mptr[24m.
[4mptr[24m Contains the string to be referenced by the Text
widget.
[4mformat[24m This flag indicates whether the data pointed to by
[1mptr [22mis char or wchar_t. When the associated
[1m125[0m
[1mAthena Widget Set libXaw 1.0.7[0m
widget has [1minternational [22mset to [1mfalse [22mthis field
must be XawFmt8Bit. When the associated widget
has [1minternational [22mset to [1mtrue [22mthis field must be
either XawFmt8Bit or XawFmtWide.
Note: Previous versions of Xaw used [4mFMT8BIT[24m, which has been
retained for backwards compatibility. [1mFMT8BIT [22mis deprecated
and will eventually be removed from the implementation.
[4m5.4.1.[24m [4mSelecting[24m [4mText[0m
To select a piece of text, use [4mXawTextSetSelection[24m:
void XawTextSetSelection([4mw[24m, [4mleft[24m, [4mright[24m)
Widget [4mw[24m;
XawTextPosition [4mleft[24m, [4mright[24m;
[4mw[24m Specifies the Text widget.
[4mleft[24m Specifies the character position at which the
selection begins.
[4mright[24m Specifies the character position at which the
selection ends.
See section 5.4 for a description of [1mXawTextPosition[22m. If
redisplay is enabled, this function highlights the text and
makes it the [1mPRIMARY [22mselection. This function does not have
any effect on [1mCUT_BUFFER0[22m.
[4m5.4.2.[24m [4mUnhighlighting[24m [4mText[0m
To unhighlight previously highlighted text in a widget, use
[1mXawTextUnsetSelection[22m:
void XawTextUnsetSelection([4mw[24m)
Widget [4mw[24m;
[4mw[24m Specifies the Text widget.
[4m5.4.3.[24m [4mGetting[24m [4mCurrent[24m [4mText[24m [4mSelection[0m
To retrieve the text that has been selected by this text
widget use [1mXawTextGetSelectionPos[22m:
void XawTextGetSelectionPos([4mw[24m, [4mbegin_return[24m, [4mend_return[24m)
Widget [4mw[24m;
XawTextPosition *[4mbegin_return[24m, *[4mend_return[24m;
[4mw[24m Specifies the Text widget.
[1m126[0m
[1mAthena Widget Set libXaw 1.0.7[0m
[4mbegin_return[0m
Returns the beginning of the text selection.
[4mend_return[24mReturns the end of the text selection.
See section 5.4 for a description of [1mXawTextPosition[22m. If
the returned values are equal, no text is currently
selected.
[4m5.4.4.[24m [4mReplacing[24m [4mText[0m
To modify the text in an editable Text widget use [1mXawTextRe-[0m
[1mplace[22m:
int XawTextReplace([4mw[24m, [4mstart[24m, [4mend[24m, [4mtext[24m)
Widget [4mw[24m;
XawTextPosition [4mstart[24m, [4mend[24m;
XawTextBlock *[4mtext[24m;
[4mw[24m Specifies the Text widget.
[4mstart[24m Specifies the starting character position of the
text replacement.
[4mend[24m Specifies the ending character position of the
text replacement.
[4mtext[24m Specifies the text to be inserted into the file.
This function will not be able to replace text in read-only
text widgets. It will also only be able to append text to
an append-only text widget.
See section 5.4 for a description of [1mXawTextPosition [22mand
[1mXawTextBlock[22m.
This function may return the following values:
[1mXawEditDone [22mThe text replacement was successful.
[1mXawPositionError[0m
The edit mode is [1mXawtextAppend [22mand [4mstart[24m is not
the position of the last character of the
source.
[1mXawEditError[22mEither the Source was read-only or the range to
be deleted is larger than the length of the
Source.
The [1mXawTextReplace [22marguments [4mstart[24m and [4mend[24m represent the
text source character positions for the existing text that
is to be replaced by the text in the text block. The
[1m127[0m
[1mAthena Widget Set libXaw 1.0.7[0m
characters from [4mstart[24m up to but not including [4mend[24m are
deleted, and the characters specified on the text block are
inserted in their place. If [4mstart[24m and [4mend[24m are equal, no
text is deleted and the new text is inserted after [4mstart[24m.
[4m5.4.5.[24m [4mSearching[24m [4mfor[24m [4mText[0m
To search for a string in the Text widget, use [1mXaw-[0m
[1mTextSearch[22m:
XawTextPosition XawTextSearch([4mw[24m, [4mdir[24m, [4mtext[24m)
Widget [4mw[24m;
XawTextScanDirection [4mdir[24m;
XawTextBlock * [4mtext[24m;
[4mw[24m Specifies the Text widget.
[4mdir[24m Specifies the direction to search in. Legal val-
ues are [1mXawsdLeft [22mand [1mXawsdRight[22m.
[4mtext[24m Specifies a text block structure that contains the
text to search for.
See section 5.4 for a description of [1mXawTextPosition [22mand
[1mXawTextBlock[22m. The [1mXawTextSearch [22mfunction will begin at the
insertion point and search in the direction specified for a
string that matches the one passed in [4mtext[24m. If the string
is found the location of the first character in the string
is returned. If the string could not be found then the
value [1mXawTextSearchError [22mis returned.
[4m5.4.6.[24m [4mRedisplaying[24m [4mText[0m
To redisplay a range of characters, use [1mXawTextInvalidate[22m:
void XawTextInvalidate([4mw[24m, [4mfrom[24m, [4mto[24m)
Widget [4mw[24m;
XawTextPosition [4mfrom[24m, [4mto[24m;
[4mw[24m Specifies the Text widget.
[4mfrom[24m Specifies the start of the text to redisplay.
[4mto[24m Specifies the end of the text to redisplay.
See section 5.4 for a description of [1mXawTextPosition[22m. The
[1mXawTextInvalidate [22mfunction causes the specified range of
characters to be redisplayed immediately if redisplay is
enabled or the next time that redisplay is enabled.
To enable redisplay, use [1mXawTextEnableRedisplay[22m:
[1m128[0m
[1mAthena Widget Set libXaw 1.0.7[0m
void XawTextEnableRedisplay([4mw[24m)
Widget [4mw[24m;
[4mw[24m Specifies the Text widget.
The [1mXawTextEnableRedisplay [22mfunction flushes any changes due
to batched updates when [1mXawTextDisableRedisplay [22mwas called
and allows future changes to be reflected immediately.
To disable redisplay while making several changes, use [1mXaw-[0m
[1mTextDisableRedisplay[22m.
void XawTextDisableRedisplay([4mw[24m)
Widget [4mw[24m;
[4mw[24m Specifies the Text widget.
The [1mXawTextDisableRedisplay [22mfunction causes all changes to
be batched until either [1mXawTextDisplay [22mor [1mXawTextEnableRe-[0m
[1mdisplay [22mis called.
To display batched updates, use [1mXawTextDisplay[22m:
void XawTextDisplay([4mw[24m)
Widget [4mw[24m;
[4mw[24m Specifies the Text widget.
The [1mXawTextDisplay [22mfunction forces any accumulated updates
to be displayed.
[4m5.4.7.[24m [4mResources[24m [4mConvenience[24m [4mRoutines[0m
To obtain the character position of the left-most character
on the first line displayed in the widget (the value of the
[1mdisplayPosition [22mresource), use [1mXawTextTopPosition[22m.
XawTextPosition XawTextTopPosition([4mw[24m)
Widget [4mw[24m;
[4mw[24m Specifies the Text widget.
To assign a new selection array to a text widget use [1mXaw-[0m
[1mTextSetSelectionArray[22m:
[1m129[0m
[1mAthena Widget Set libXaw 1.0.7[0m
void XawTextSetSelectionArray([4mw[24m, [4msarray[24m)
Widget [4mw[24m;
XawTextSelectType * [4msarray[24m;
[4mw[24m Specifies the Text widget.
[4msarray[24m Specifies a selection array as defined in the sec-
tion called [1mText Selections for Application Pro-[0m
[1mgrammers[22m.
Calling this function is equivalent to setting the value of
the [1mselectionTypes [22mresource.
To move the insertion point to the specified source posi-
tion, use [1mXawTextSetInsertionPoint[22m:
void XawTextSetInsertionPoint([4mw[24m, [4mposition[24m)
Widget [4mw[24m;
XawTextPosition [4mposition[24m;
[4mw[24m Specifies the Text widget.
[4mposition[24m Specifies the new position for the insertion
point.
See section 5.4 for a description of [1mXawTextPosition[22m. The
text will be scrolled vertically if necessary to make the
line containing the insertion point visible. Calling this
function is equivalent to setting the [1minsertPosition[0m
resource.
To obtain the current position of the insertion point, use
[1mXawTextGetInsertionPoint[22m:
XawTextPosition XawTextGetInsertionPoint([4mw[24m)
Widget [4mw[24m;
[4mw[24m Specifies the Text widget.
See section 5.4 for a description of [1mXawTextPosition[22m. The
result is equivalent to retrieving the value of the [1minsert-[0m
[1mPosition [22mresource.
To replace the text source in the specified widget, use [1mXaw-[0m
[1mTextSetSource[22m:
[1m130[0m
[1mAthena Widget Set libXaw 1.0.7[0m
void XawTextSetSource([4mw[24m, [4msource[24m, [4mposition[24m)
Widget [4mw[24m;
Widget [4msource[24m;
XawTextPosition [4mposition[24m;
[4mw[24m Specifies the Text widget.
[4msource[24m Specifies the text source object.
[4mposition[24m Specifies character position that will become the
upper left hand corner of the displayed text.
This is usually set to zero.
See section 5.4 for a description of [1mXawTextPosition[22m. A
display update will be performed if redisplay is enabled.
To obtain the current text source for the specified widget,
use [1mXawTextGetSource[22m:
Widget XawTextGetSource([4mw[24m)
Widget [4mw[24m;
[4mw[24m Specifies the Text widget.
This function returns the text source that this Text widget
is currently using.
To enable and disable the insertion point, use [1mXawTextDis-[0m
[1mplayCaret[22m:
void XawTextDisplayCaret([4mw[24m, [4mvisible[24m)
Widget [4mw[24m;
Boolean [4mvisible[24m;
[4mw[24m Specifies the Text widget.
[4mvisible[24m Specifies whether or not the caret should be dis-
played.
If [4mvisible[24m is [1mFalse [22mthe insertion point will be disabled.
The marker is re-enabled either by setting [4mvisible[24m to [1mTrue[22m,
by calling [1mXtSetValues[22m, or by executing the [4mdisplay-caret[0m
action routine.
[4m5.5.[24m [4mAscii[24m [4mText[24m [4mWidget[0m
Application Header file
[1m131[0m
[1mAthena Widget Set libXaw 1.0.7[0m
ClassHeader file
Class asciiTextWidgetClass
Class Name Text
Superclass Text
Sink Name textSink
Source Name textSource
For the ease of internationalization, the AsciiText widget
class name has not been changed, although it is actually
able to support non-ASCII locales. The AsciiText widget is
really a collection of smaller parts. It includes the Text
widget itself, a ``Source'' (which supports memory manage-
ment), and a ``Sink'' (which handles the display). There
are currently two supported sources, the AsciiSrc and Multi-
Src, and two supported sinks, the AsciiSink and MultiSink.
Some of the resources listed below are not actually
resources of the AsciiText, but belong to the associated
source or sink. This is is noted in the explanation of each
resource where it applies. When specifying these resources
in a resource file it is necessary to use [4m*Asci-[0m
[4miText*resource_name[24m instead of [4m*AsciiText.resource_name[24m,
since they actually belong to the children of the AsciiText
widget, and not the AsciiText widget itself. However, these
resources may be set directly on the AsciiText widget at
widget creation time, or via [1mXtSetValues[22m.
[4m5.5.1.[24m [4mResources[0m
When creating an AsciiText widget instance, the following
resources are retrieved from the argument list or from the
resource database:
------------------------------------------------------------------------------------
[4mName[24m [4mClass[24m [4mType[24m [4mNotesDefault[24m [4mValue[0m
------------------------------------------------------------------------------------
accelerators Accelerators AcceleratorTable NULL
ancestorSensitive AncestorSensitiveBoolean D True
autoFill AutoFill Boolean False
background Background Pixel XtDefaultBackground
backgroundPixmap Pixmap Pixmap XtUnspecifiedPixmap
borderColor BorderColor Pixel XtDefaultForeground
borderPixmap Pixmap Pixmap XtUnspecifiedPixmap
borderWidth BorderWidth Dimension 1
bottomMargin Margin Position 2
callback Callback XtCallbackList NULL
colormap Colormap Colormap Parent's Colormap
cursor Cursor Cursor XC_xterm
cursorName Cursor String NULL
dataCompression DataCompression Boolean True
depth Depth int C Parent's Depth
[1m132[0m
[1mAthena Widget Set libXaw 1.0.7[0m
------------------------------------------------------------------------------------
[4mName[24m [4mClass[24m [4mType[24m [4mNotesDefault[24m [4mValue[0m
------------------------------------------------------------------------------------
destroyCallback Callback XtCallbackList NULL
displayCaret Output Boolean True
displayNonprinting Output Boolean True
displayPosition TextPosition XawTextPosition 0
echo Output Boolean True
editType EditType XawTextEditType XawtextRead
font Font XFontStruct* XtDefaultFont
fontSet FontSet XFontSet XtDefaultFontSet
foreground Foreground Pixel XtDefaultForeground
height Height Dimension A Font height + margins
insensitiveBorder Insensitive Pixmap GreyPixmap
insertPosition TextPosition int 0
international International Boolean C False
leftMargin Margin Dimension 2
length Length int A length of [1mstring[0m
mappedWhenManaged MappedWhenManagedBoolean True
pieceSize PieceSize XawTextPosition BUFSIZ
pointerColor Foreground Pixel XtDefaultForeground
pointerColorBackgroundBackground Pixel XtDefaultBackground
resize Resize XawTextResizeMode XawtextResizeNever
rightMargin Margin Position 2
screen Screen Screen R Parent's Screen
scrollHorizontal Scroll XawTextScrollMode XawtextScrollNever
scrollVertical Scroll XawTextScrollMode XawtextScrollNever
selectTypes SelectTypes XawTextSelectType* See above
sensitive Sensitive Boolean True
string String String NULL
textSink TextSink Widget An AsciiSink
textSource TextSource Widget An AsciiSrc
topMargin Margin Position 2
translations Translations TranslationTable See above
type Type XawAsciiType XawAsciiString
useStringInPlace UseStringInPlace Boolean False
width Width Dimension 100
wrap Wrap WrapMode XawtextWrapNever
x Position Position 0
y Position Position 0
------------------------------------------------------------------------------------
accelerators A list of event to action bindings to be exe-
cuted by this widget, even though the event
occurred in another widget. (See the [4mX[24m [4mTool-[0m
[4mkit[24m [4mIntrinsics[24m [4m--[24m [4mC[24m [4mLanguage[24m [4mInterface[24m for
details).
ancestorSensitive
The sensitivity state of the ancestors of
this widget. A widget is insensitive if
either it or any of its ancestors is insensi-
tive. This resource should not be changed
[1m133[0m
[1mAthena Widget Set libXaw 1.0.7[0m
with [1mXtSetValues[22m, although it may be queried.
autoFill If this resource is [1mTrue [22mthe text widget will
automatically break a line when the user
attempts to type into the right margin. The
attribute has no effect on files or text
inserted into the text widget. It only
checks to see if the action should be taken
when a user enters a new character via the
[4minsert-character[24m action.
background A pixel value which indexes the widget's col-
ormap to derive the background color of the
widget's window.
backgroundPixmapThe background pixmap of this widget's win-
dow. If this resource is set to anything
other than [1mXtUnspecifiedPixmap[22m, the pixmap
specified will be used instead of the back-
ground color.
borderColor A pixel value which indexes the widget's col-
ormap to derive the border color of the wid-
get's window.
borderPixmap The border pixmap of this widget's window.
If this resource is set to anything other
than [1mXtUnspecifiedPixmap[22m, the pixmap speci-
fied will be used instead of the border
color.
borderWidth The width of this widget's window border.
bottomMargin
leftMargin
rightMargin
topMargin The amount of space, in pixels, between the
edge of the window and the corresponding edge
of the text within the window. If there is a
scrollbar active on this edge, then this is
the space between the text and the scrollbar.
callback The callbacks registered on this resource
will be called every time the text buffer
changes, after the text has been updated.
This is a resource of the associated source.
colormap The colormap that this widget will use.
cursor The image that will be displayed as the
pointer cursor whenever it is in this widget.
The use of this resource is deprecated in
favor of [1mcursorName[22m.
[1m134[0m
[1mAthena Widget Set libXaw 1.0.7[0m
cursorName The name of the symbol to use to represent
the pointer cursor. This resource will over-
ride the [1mcursor [22mresource if both are speci-
fied. (See 2.4.1)
dataCompressionThe AsciiSrc uses an algorithm that may cause
the text buffer to grow to about twice the
size of the actual text over time, as the
text is edited. On systems where CPU cycles
are cheaper than memory, it is helpful to
spend some extra time to compress this buffer
back to its minimum size. If this resource
is [1mTrue[22m, the AsciiSrc will compress its data
to the minimum size required every time the
text string is saved, or the value of the
string is queried. This is a resource of the
associated source.
depth The depth of this widget's window.
destroyCallbackAll functions on this list are called when
this widget is destroyed.
displayCaret Whether or not to display the text insert
point.
displayNonprinting
If this resource is [1mTrue[22m, the Text widget
will display all non-printable characters as
the string [4m^@[24m. If [1mFalse[22m, the Text widget
will just leave a blank space where a non-
printable character exists in the text buf-
fer. This is a resource of the associated
sink.
displayPositionThe position in the text buffer of the char-
acter that is currently displayed in the
upper left hand corner of the text display.
editType This is the type of editing that will be
allowed in this text widget. Legal values
are [1mXawtextRead[22m, [1mXawtextEdit[22m, and [1mXawtextAp-[0m
[1mpend[22m. A converter is registered for this
resource that will convert the following
strings: [1mread, edit, [22mand [1mappend[22m. This is a
resource of the associated source.
echo Whether or not to echo characters to the
screen. The buffer can still be edited, but
nothing is displayed. This mode can be use-
ful for entering passwords and other sensi-
tive information. This is a resource of the
associated sink.
[1m135[0m
[1mAthena Widget Set libXaw 1.0.7[0m
font The text font to use when displaying the
[1mstring[22m, when the [1minternational [22mresource is
[1mfalse[22m. This is a resource of the associated
sink.
font The text font set to use when displaying the
[1mstring[22m, when the [1minternational [22mresource is
[1mtrue[22m. This is a resource of the associated
sink.
foreground A pixel value which indexes the Text widget's
colormap to derive the foreground color used
by the text sink. This is a resource of the
associated sink.
height
width The height and width of this widget in pix-
els.
insensitiveBorder
This pixmap will be tiled into the widget's
border if the widget becomes insensitive.
insertPosition This is the location of the insert point. It
is expressed in characters from the beginning
of the file. The cursor will always be
forced to be on the screen. This resource
may therefore be used to scroll the text dis-
play to a certain character position.
length If the [1museStringInPlace [22mresource is [1mFalse[0m
this attribute has no effect. If that
resource is [1mTrue[22m, however, then the [1mlength[0m
resource specifies the length of the buffer
passed to the text widget in the [1mstring[0m
resource. This is a resource of the associ-
ated source.
mappedWhenManaged
If this resource is [1mTrue[22m, then the widget's
window will automatically be mapped by the
Toolkit when it is realized and managed.
pointerColor A pixel value which indexes the widget's col-
ormap to derive the foreground color of the
pointer symbol specified by the [1mcursorName[0m
resource.
pointerColorBackground
A pixel value which indexes the widget's
colormap to derive the background color of
the pointer symbol specified by the [1mcursor-[0m
[1mName [22mresource.
[1m136[0m
[1mAthena Widget Set libXaw 1.0.7[0m
pieceSize This is the size of the internal chunks into
which the text buffer is broken down for mem-
ory management. The larger this value the
less segmented your memory will be, but the
slower your editing will be. The text wid-
gets will always allocate a chunk of memory
this size to stuff the [1mstring [22minto, so when
using small strings, having this buffer large
can waste memory. This resource has no
effect if [1museStringInPlace [22mis [1mTrue[22m. This is
a resource of the associated source.
resize Controls whether or not the Text widget
attempts to resize itself when it is no
longer able to display the full text buffer
in the associated window. Any attempt by the
Text widget to resize itself is always sub-
ject to the constraints imposed by its par-
ent. The values [1mXawtextResizeNever[22m, [1mXawtex-[0m
[1mtResizeWidth[22m, [1mXawtextResizeHeight[22m, and [1mXaw-[0m
[1mtextResizeBoth [22mare all acceptable for this
resource. A converter is registered for this
resource that will convert the following
strings: [1mnever, height, width, [22mand [1mboth[22m.
screen The screen on which this widget is displayed.
This is not a settable resource.
scrollHorizontal
scrollVertical These resources control the placement of
scrollbars on the left and bottom edge of the
text widget. These resources accept the val-
ues [1mXawtextScrollAlways[22m, [1mXawtextScrollWhen-[0m
[1mNeeded[22m, and [1mXawtextScrollNever[22m. A converter
is registered for this resource that will
convert the following strings: [1malways, never,[0m
and [1mwhenNeeded[22m. If [1mXawtextScrollWhenNeeded[0m
is specified, the appropriate scrollbar will
only appear when there is text in the buffer
that is not able to fit within the bounds of
the current window. The scrollbar will dis-
appear when the text once again fits within
the window.
selectTypes Specifies the selection type array that is
used when multi-click is activated (see [1mText[0m
[1mSelections for Application Programmers [22mfor
details). This resource is used in place,
and must not be freed until the widget is
destroyed. There is no type converter regis-
tered for this resource, so it may not be set
from the resource manager.
sensitive Whether or not the toolkit should pass user
[1m137[0m
[1mAthena Widget Set libXaw 1.0.7[0m
events to this widget. The widget will not
get input events if either [1mancestorSensitive[0m
or [1msensitive [22mis [1mFalse[22m.
string If [1mtype [22mis [1mXawAsciiString [22mthen this string
contains the buffer to be displayed in the
widget. If [1mtype [22mis [1mXawAsciiFile [22mthen the
string contains the name of the file to be
displayed. This string is normally copied by
the text widget into internal memory, but may
be used in place by setting the [1museStringIn-[0m
[1mPlace [22mresource. As of X11R4 this is a set-
table resource. This is a resource of the
associated source. When the [1mstring [22mresource
is queried, using [1mXtGetValues[22m, and [1museString-[0m
[1mInPlace [22mis false, the value returned is valid
until the next time the [1mstring [22mresource is
queried, or until the application writer
calls [1mXawAsciiSourceFreeString[22m. If [1museS-[0m
[1mtringInPlace [22mis true, a pointer to the actual
string is returned. See also section 5.6.
textSink
textSource These are the TextSink or TextSource objects
used by this widget. When [1minternational [22mis
set to [1mtrue [22mthe AsciiText widget initializes
these resources to point to an MultiSink and
MultiSrc respectively. When [1minternational [22mis
set to [1mfalse [22mthe AsciiText widget initializes
these resources to point to an AsciiSink and
AsciiSrc respectively.
translations The event bindings associated with this wid-
get.
type This resource may be either [1mXawAsciiString [22mor
[1mXawAsciiFile[22m. The value of this resource
determines whether the [1mstring [22mresource con-
tains the name of a file to be opened or a
buffer to be displayed by the text widget. A
converter has been registered for this
resource and accepts the values [1mstring [22mand
[1mfile[22m. This is a resource of the associated
source.
useStringInPlaceSetting this resource to [1mTrue [22mwill disable
the memory management provided by the Text
widget, updating the [1mstring [22mresource in
place. Using the string in place can be much
more efficient for text widgets that display
static data, or where the programmer wishes
to impose strict constraints on the contents
of the [1mstring[22m. When using the string in
place be sure that: the length of the string
[1m138[0m
[1mAthena Widget Set libXaw 1.0.7[0m
is specified by setting the [1mlength [22mresource,
the [1mtype [22mof the Text widget is [1mXawAsci-[0m
[1miString[22m, and that the [1mstring [22mexists for the
lifetime of the text widget, or until it has
been reset. [4mNote:[24m [4mSince[24m [4mthe[24m [4mMultiSrc[24m [4mand[0m
[4mAsciiSrc[24m [4mhave[24m [4mdifferent[24m [4mdata[24m [4mformats,[24m [4muse[24m [4mof[0m
[4mthis[24m [4mresource[24m [4mforces[24m [4mapplication[24m [4mcode[24m [4mto[24m [4mbe[0m
[4mcognisant[24m [4mas[24m [4mto[24m [4mwhich[24m [4mof[24m [4mthe[24m [4mtwo[24m [4mis[24m [4mbeing[0m
[4mused.[24m [4mApplication[24m [4mprogramming[24m [4mis[24m [4msimplified[0m
[4mwhen[24m [4muse[24m [4mof[24m [4mthis[24m [4mresource[24m [4mis[24m [4mavoided.[24m This
is a resource of the associated source.
wrap When the text in any one line is wider than
the window there are several possible
actions. This resource allows the user to
decide what will happen. The accepted values
for this resource are [1mXawtextWrapNever[22m, [1mXaw-[0m
[1mtextWrapLine[22m, and [1mXawtextWrapWord[22m. With [1mXaw-[0m
[1mtextWrapLine [22mall text that is beyond the
right edge of the window will be displayed on
the next line. With [1mXawtextWrapWord [22mthe same
action occurs but the text is broken at a
word boundary if possible. If no wrapping is
enabled then the text will extend off the
edge of the window, and a small rectangle
will be painted in the right margin to alert
the user that this line is too long. A con-
verter is registered for this resource that
will convert the following strings: [1mnever,[0m
[1mword, [22mand [1mline[22m.
x
y The location of the upper left outside corner
of this widget in its parent.
[4m5.6.[24m [4mAscii[24m [4mSource[24m [4mObject[24m [4mand[24m [4mMulti[24m [4mSource[24m [4mObject[0m
Application Header file or
Class Header file or
Class asciiSrcObjectClass or multiSrcObjectClass
Class Name AsciiSrc or MultiSrc
Superclass TextSource
The AsciiSrc or MultiSrc object is used by a text widget to
read the text from a file or string in memory. Depending on
its [1minternational [22mresource, an AsciiText widget will create
one or the other of these when the AsciiText itself is cre-
ated. Both types are nearly identical; the following dis-
cussion applies to both, with MultiSrc differences noted
[1m139[0m
[1mAthena Widget Set libXaw 1.0.7[0m
only as they occur.
The AsciiSrc understands all Latin1 characters plus Tab and
Carriage Return. [4mThe[24m [4mMultiSrc[24m [4munderstands[24m [4many[24m [4mset[24m [4mof[24m [4mchar-[0m
[4macter[24m [4msets[24m [4mthat[24m [4mthe[24m [4munderlying[24m [4mX[24m [4mimplementation's[24m [4minterna-[0m
[4mtionalization[24m [4mhandles.[0m
The AsciiSrc can be either of two types: [1mXawAsciiFile [22mor
[1mXawAsciiString[22m.
AsciiSrc objects of type [1mXawAsciiFile [22mread the text from a
file and store it into an internal buffer. This buffer may
then be modified, provided the text widget is in the correct
edit mode, just as if it were a source of type [1mXawAsci-[0m
[1miString[22m. Unlike R3 and earlier versions of the AsciiSrc, it
is now possible to specify an editable disk source. The
file is not updated, however, until a call to [1mXawAsciiSave[0m
is made. When the source is in this mode the [1museStringIn-[0m
[1mPlace [22mresource is ignored.
AsciiSrc objects of type [1mXawAsciiString [22mhave the text buffer
implemented as a string. [4mMultiSrc[24m [4mobjects[24m [4mof[24m [4mtype[24m [1mXawAsci-[0m
[1miString [4m[22mhave[24m [4mthe[24m [4mtext[24m [4mbuffer[24m [4mimplemented[24m [4mas[24m [4ma[24m [4mwide[24m [4mcharacter[0m
[4mstring.[24m [1mThe string owner is responsible for allocating and[0m
[1mmanaging storage for the string.[0m
In the default case for AsciiSrc objects of type [1mXawAsci-[0m
[1miString[22m, the resource [1museStringInPlace [22mis false, and the
widget owns the string. The initial value of the string
resource, and any update made by the application programmer
to the string resource with [1mXtSetValues[22m, is copied into mem-
ory private to the widget, and managed internally by the
widget. The application writer does not need to worry about
running out of buffer space (subject to the total memory
available to the application). The performance does not
decay linearly as the buffer grows large, as is necessarily
the case when the text buffer is used in place. The appli-
cation writer must use [1mXtGetValues [22mto determine the contents
of the text buffer, which will return a copy of the widget's
text buffer as it existed at the time of the [1mXtGetValues[0m
call. This copy is not affected by subsequent updates to
the text buffer, i.e., it is not updated as the user types
input into the text buffer. This copy is freed upon the
next call to XtGetValues to retrieve the string resource;
however, to conserve memory, there is a convenience routine,
[1mXawAsciiSourceFreeString[22m, allowing the application program-
mer to direct the widget to free the copy.
When the resource [1museStringInPlace [22mis true and the AsciiSrc
object is of type [1mXawAsciiString[22m, the application is the
string owner. The widget will take the value of the string
resource as its own text buffer, and the [1mlength [22mresource
indicates the buffer size. In this case the buffer con-
tents change as the user types at the widget; it is not
[1m140[0m
[1mAthena Widget Set libXaw 1.0.7[0m
necessary to call [1mXtGetValues [22mon the string resource to
determine the contents of the buffer--it will simply return
the address of the application's implementation of the text
buffer.
[4m5.6.1.[24m [4mResources[0m
When creating an AsciiSrc object instance, the following
resources are retrieved from the argument list or from the
resource database:
------------------------------------------------------------------------------------
[4mName[24m [4mClass[24m [4mType[24m [4mNotes[24m [4mDefault[24m [4mValue[0m
------------------------------------------------------------------------------------
callback Callback XtCallbackList NULL
dataCompression DataCompression Boolean True
destroyCallback Callback Callback NULL
editType EditType EditMode XawtextRead
length Length Int A length of [1mstring[0m
pieceSize PieceSize Int BUFSIZ
string String String NULL
type Type AsciiType XawAsciiString
useStringInPlace UseStringInPlace Boolean False
------------------------------------------------------------------------------------
[1mcallback [22mThe callbacks registered on this resource
will be called every time the text buffer
changes, after the text has been updated.
destroyCallbackAll functions on this list are called when
this widget is destroyed.
[1mdataCompression[22mThe AsciiSrc uses an algorithm that may cause
the text buffer to grow to about twice the
size of the actual text over time, as the
text is edited. On systems where CPU cycles
are cheaper than memory, it is helpful to
spend some extra time to compress this buffer
back to its minimum size. If this resource
is [1mTrue[22m, the AsciiSrc will compress its data
to the minimum size required every time the
text string is saved, or the value of the
string is queried.
editType This is the type of editing that will be
allowed in this text widget. Legal values
are [1mXawtextRead[22m, [1mXawtextEdit[22m, and [1mXawtextAp-[0m
[1mpend[22m. A converter is registered for this
resource that will convert the following
strings: [1mread, edit, [22mand [1mappend[22m.
[1mlength [22mIf the [1museStringInPlace [22mresource is [1mFalse[0m
[1m141[0m
[1mAthena Widget Set libXaw 1.0.7[0m
this attribute has no effect. If that
resource is [1mTrue[22m, however, then the [1mlength[0m
resource specifies the length of the buffer
passed to the text widget in the [1mstring[0m
resource.
[1mpieceSize [22mThis is the size of the internal chunks into
which the text buffer is broken down for mem-
ory management. The larger this value the
less segmented your memory will be, but the
slower your editing will be. The text wid-
gets will always allocate a chunk of memory
this size to stuff the [1mstring [22minto, so when
using small strings, having this buffer large
can waste memory. This resource has no
effect if [1museStringInPlace [22mis [1mTrue[22m.
[1mstring [22mIf [1mtype [22mis [1mXawAsciiString [22mthen this string
contains the buffer to be displayed in the
widget. If [1mtype [22mis [1mXawAsciiFile [22mthen the
string contains the name of the file to be
displayed. This string is normally copied by
the text widget into internal memory, but may
be used in place by setting the [1museStringIn-[0m
[1mPlace [22mresource. As of X11R4 this is a set-
table resource. When the [1mstring [22mresource is
queried, using [1mXtGetValues[22m, and [1museStringIn-[0m
[1mPlace [22mis false, the value returned is valid
until the next time the [1mstring [22mresource is
queried, or until the application writer
calls [1mXawAsciiSourceFreeString[22m. If [1museS-[0m
[1mtringInPlace [22mis true, a pointer to the actual
string is returned. See also section 5.6.
[1mtype [22mThis resource may be either [1mXawAsciiString [22mor
[1mXawAsciiFile[22m. The value of this resource
determines whether the [1mstring [22mresource con-
tains the name of a file to be opened or a
buffer to be displayed by the text widget. A
converter has been registered for this
resource and accepts the values [1mstring [22mand
[1mfile[22m.
[1museStringInPlace[22mSetting this resource to [1mTrue [22mwill disable
the memory management provided by the Text
widget, updating the [1mstring [22mresource in
place. Using the string in place can be much
more efficient for text widgets that display
static data, or where the programmer wishes
to impose strict constraints on the contents
of the [1mstring[22m. When using the string in
place be sure that: the length of the string
is specified by setting the [1mlength [22mresource,
the [1mtype [22mof the Text widget is
[1m142[0m
[1mAthena Widget Set libXaw 1.0.7[0m
[1mXawAsciiString[22m, and that the [1mstring [22mexists
for the lifetime of the text widget, or until
it has been reset. [4mNote:[24m [4mSince[24m [4mthe[24m [4mMultiSrc[0m
[4mand[24m [4mAsciiSrc[24m [4mhave[24m [4mdifferent[24m [4mdata[24m [4mformats,[24m [4muse[0m
[4mof[24m [4mthis[24m [4mresource[24m [4mforces[24m [4mapplication[24m [4mcode[24m [4mto[0m
[4mbe[24m [4mcognisant[24m [4mas[24m [4mto[24m [4mwhich[24m [4mof[24m [4mthe[24m [4mtwo[24m [4mis[24m [4mbeing[0m
[4mused.[24m [4mApplication[24m [4mprogramming[24m [4mis[24m [4msimplified[0m
[4mwhen[24m [4muse[24m [4mof[24m [4mthis[24m [4mresource[24m [4mis[24m [4mavoided.[0m
[4m5.6.2.[24m [4mConvenience[24m [4mRoutines[0m
The AsciiSrc has a few convenience routines that allow the
application programmer quicker or easier access to some of
the commonly used functionality of the AsciiSrc.
[4m5.6.2.1.[24m [4mConserving[24m [4mMemory[0m
When the AsciiSrc widget is not in [1museStringInPlace [22mmode
space must be allocated whenever the file is saved, or the
string is requested with a call to [1mXtGetValues[22m. This memory
is allocated on the fly, and remains valid until the next
time a string needs to be allocated. You may save memory by
freeing this string as soon as you are done with it by call-
ing [1mXawAsciiSourceFreeString[22m.
void XawAsciiSourceFreeString([4mw[24m)
Widget [4mw[24m;
[4mw[24m Specifies the AsciiSrc object.
This function will free the memory that contains the string
pointer returned by [1mXtGetValues[22m. This will normally happen
automatically when the next call to [1mXtGetValues [22moccurs, or
when the widget is destroyed.
[4m5.6.2.2.[24m [4mSaving[24m [4mFiles[0m
To save the changes made in the current text source into a
file use [1mXawAsciiSave[22m.
Boolean XawAsciiSave([4mw[24m)
Widget [4mw[24m;
[4mw[24m Specifies the AsciiSrc object.
[1mXawAsciiSave [22mreturns [1mTrue [22mif the save was successful. It
will update the file named in the [1mstring [22mresource. If the
buffer has not been changed, no action will be taken. This
function only works on an AsciiSrc of type [1mXawAsciiFile[22m.
To save the contents of the current text buffer into a named
[1m143[0m
[1mAthena Widget Set libXaw 1.0.7[0m
file use [1mXawAsciiSaveAsFile[22m.
Boolean XawAsciiSaveAsFile([4mw[24m, [4mname[24m)
Widget [4mw[24m;
String [4mname[24m;
[4mw[24m Specifies the AsciiSrc object.
[4mname[24m The name of the file to save the current buffer
into.
This function returns [1mTrue [22mif the save was successful.
[1mXawAsciiSaveAsFile [22mwill work with a buffer of either type
[1mXawAsciiString [22mor type [1mXawAsciiFile[22m.
[4m5.6.2.3.[24m [4mSeeing[24m [4mif[24m [4mthe[24m [4mSource[24m [4mhas[24m [4mChanged[0m
To find out if the text buffer in an AsciiSrc object has
changed since the last time it was saved with [1mXawAsciiSave[0m
or queried use [1mXawAsciiSourceChanged[22m.
Boolean XawAsciiSourceChanged([4mw[24m)
Widget [4mw[24m;
[4mw[24m Specifies the AsciiSrc object.
This function will return [1mTrue [22mif the source has changed
since the last time it was saved or queried. The internal
change flag is reset whenever the string is queried via
[1mXtGetValues [22mor the buffer is saved via [1mXawAsciiSave[22m.
[4m5.7.[24m [4mAscii[24m [4mSink[24m [4mObject[24m [4mand[24m [4mMulti[24m [4mSink[24m [4mObject[0m
Application Header file
Class Header file
Class asciiSinkObjectClass
Class Name AsciiSink
Superclass TextSink
The AsciiSink or MultiSink object is used by a text widget
to render the text. Depending on its [1minternational[0m
resource, a AsciiText widget will create one or the other of
these when the AsciiText itself is created. Both types are
nearly identical; the following discussion applies to both,
with MultiSink differences noted only as they occur. The
AsciiSink will display all printing characters in an 8 bit
font, along with handling Tab and Carriage Return. The name
has been left as ``AsciiSink'' for compatibility. [4mThe[0m
[1m144[0m
[1mAthena Widget Set libXaw 1.0.7[0m
[4mMultiSink[24m [4mwill[24m [4mdisplay[24m [4mall[24m [4mprinting[24m [4mcharacters[24m [4min[24m [4ma[24m [4mfont[0m
[4mset,[24m [4malong[24m [4mwith[24m [4mhandling[24m [4mTab[24m [4mand[24m [4mCarriage[24m [4mReturn.[24m The
source object also reports the text window metrics to the
text widgets.
[4m5.7.1.[24m [4mResources[0m
When creating an AsciiSink object instance, the following
resources are retrieved from the argument list or from the
resource database:
--------------------------------------------------------------------------------
[4mName[24m [4mClass[24m [4mType[24m [4mNotes[24m [4mDefault[24m [4mValue[0m
--------------------------------------------------------------------------------
background Background Pixel XtDefaultBackground
destroyCallback Callback XtCallbackList NULL
displayNonprinting Output Boolean True
echo Output Boolean True
font Font XFontStruct* XtDefaultFont
fontSet FontSet XFontSet XtDefaultFontSet
foreground Foreground Pixel XtDefaultForeground
--------------------------------------------------------------------------------
[1mbackground [22mA pixel value which indexes the widget's col-
ormap to derive the background color of the
widget's window. This resource is retrieved
by the AsciiSink instead of being copied from
the Text widget.
destroyCallbackAll functions on this list are called when
this widget is destroyed.
[1mdisplayNonprinting[0m
If this resource is [1mTrue[22m, the Text widget
will display all non-printable characters as
the string [4m^@[24m. If [1mFalse[22m, the Text widget
will just leave a blank space where a non-
printable character exists in the text buf-
fer.
[1mecho [22mWhether or not to echo characters to the
screen. The buffer can still be edited, but
nothing is displayed. This mode can be use-
ful for entering passwords and other sensi-
tive information.
[1mfont [22mThe text font to use when displaying the
[1mstring[22m. (This resource is present in the
AsciiSink, but not the MultiSink.)
[1mfontSet [22mThe text font set to use when displaying the
[1mstring[22m. (This resource is present in the
[1m145[0m
[1mAthena Widget Set libXaw 1.0.7[0m
MultiSink, but not the AsciiSink.)
[4m5.8.[24m [4mCustomizing[24m [4mthe[24m [4mText[24m [4mWidget[0m
The remainder of this chapter will describe customizing the
Text widget. The Text widget may be customized by subclass-
ing, or by creating new sources and sinks. Subclassing is
described in detail in Chapter 7; this section will describe
only those things that are specific to the Text widget.
Attributes of the Text widget base class and creating new
sources and sinks will be discussed.
The Text widget is made up of a number of different pieces,
with the Text widget as the base widget class. It and the
AsciiText widget are the only true "widgets" in the Text
widget family. The other pieces (sources and sinks) are X
Toolkit objects and have no window associated with them. No
source or sink is useful unless assigned to a Text widget.
Each of the following pieces of the Text widget has a spe-
cific purpose, and will be, or has been, discussed in detail
in this chapter:
[1mText [22mThis is the glue that binds everything else
together. This widget reads the text data
from the source, and displays the information
in the sink. All translations and actions
are handled in the Text widget itself.
[1mTextSink [22mThis object is responsible for displaying and
clearing the drawing area. It also reports
the configuration of the window that contains
the drawing area. The TextSink does not have
its own window; instead it does its drawing
on the Text widget's window.
[1mTextSrc [22mThis object is responsible for reading, edit-
ing and searching through the text buffer.
[1mAsciiSink [22mThis object is a subclass of the TextSink and
knows how to display ASCII text. Support has
been added to display any 8-bit character
set, given the font.
[1mMultiSink [22mThis object is a subclass of the TextSink and
knows how to display font sets.
[1mAsciiSrc [22mThis object is a subclass of the TextSrc and
knows how to read strings and files.
[1mMultiSrc [22mThis object is a subclass of the TextSrc and
knows how to read strings and multibyte
[1m146[0m
[1mAthena Widget Set libXaw 1.0.7[0m
files, converting them to wide characters
based on locale.
[1mAsciiText [22mThis widget is a subclass of the Text widget.
When created, the AsciiText automatically
creates and attaches either an AsciiSrc and
AsciiSink, or a MultiSrc and MultiSink, to
itself. The AsciiText provides the simplest
interface to the Athena Text widgets.
[4m5.9.[24m [4mText[24m [4mWidget[0m
Application Header file
Class Header file
Class textWidgetClass
Class Name Text
Superclass Simple
The Text widget is the glue that binds all the other pieces
together, it maintains the internal state of the displayed
text, and acts as a mediator between the source and sink.
This section lists the resources that are actually part of
the Text widget, and explains the functionality provided by
each.
[4m5.9.1.[24m [4mResources[0m
When creating a Text widget instance, the following
resources are retrieved from the argument list or from the
resource database:
------------------------------------------------------------------------------------
[4mName[24m [4mClass[24m [4mType[24m [4mNotesDefault[24m [4mValue[0m
------------------------------------------------------------------------------------
accelerators Accelerators AcceleratorTable NULL
ancestorSensitive AncestorSensitiveBoolean D True
autoFill AutoFill Boolean False
background Background Pixel XtDefaultBackground
backgroundPixmap Pixmap Pixmap XtUnspecifiedPixmap
borderColor BorderColor Pixel XtDefaultForeground
borderPixmap Pixmap Pixmap XtUnspecifiedPixmap
borderWidth BorderWidth Dimension 1
bottomMargin Margin Position 2
colormap Colormap Colormap Parent's Colormap
cursor Cursor Cursor XC_xterm
cursorName Cursor String NULL
[1m147[0m
[1mAthena Widget Set libXaw 1.0.7[0m
------------------------------------------------------------------------------------
[4mName[24m [4mClass[24m [4mType[24m [4mNotesDefault[24m [4mValue[0m
------------------------------------------------------------------------------------
depth Depth int C Parent's Depth
destroyCallback Callback XtCallbackList NULL
displayCaret Output Boolean True
displayPosition TextPosition XawTextPosition 0
height Height Dimension A Font height + margins
insensitiveBorder Insensitive Pixmap GreyPixmap
insertPosition TextPosition int 0
leftMargin Margin Position 2
mappedWhenManaged MappedWhenManagedBoolean True
pointerColor Foreground Pixel XtDefaultForeground
pointerColorBackgroundBackground Pixel XtDefaultBackground
resize Resize XawTextResizeMode XawtextResizeNever
rightMargin Margin Position 4
screen Screen Pointer R Parent's Screen
scrollHorizontal Scroll ScrollMode XawtextScrollNever
scrollVertical Scroll XawTextScrollMode XawtextScrollNever
selectTypes SelectTypes XawTextSelectType* See above
sensitive Sensitive Boolean True
textSink TextSink Widget NULL
textSource TextSource Widget NULL
topMargin Margin Position 2
translations Translations TranslationTable See above
unrealizeCallback Callback XtCallbackList NULL
width Width Dimension 100
wrap Wrap WrapMode XawtextWrapNever
x Position Position 0
y Position Position 0
------------------------------------------------------------------------------------
accelerators A list of event to action bindings to be exe-
cuted by this widget, even though the event
occurred in another widget. (See the [4mX[24m [4mTool-[0m
[4mkit[24m [4mIntrinsics[24m [4m--[24m [4mC[24m [4mLanguage[24m [4mInterface[24m for
details).
ancestorSensitive
The sensitivity state of the ancestors of
this widget. A widget is insensitive if
either it or any of its ancestors is insensi-
tive. This resource should not be changed
with [1mXtSetValues[22m, although it may be queried.
[1mautoFill [22mIf this resource is [1mTrue [22mthe text widget will
automatically break a line when the user
attempts to type into the right margin. The
attribute has no effect on files or text
inserted into the text widget. It only
checks to see if the action should be taken
when a user enters a new character via the
[4minsert-character[24m action.
[1m148[0m
[1mAthena Widget Set libXaw 1.0.7[0m
background A pixel value which indexes the widget's col-
ormap to derive the background color of the
widget's window.
backgroundPixmapThe background pixmap of this widget's win-
dow. If this resource is set to anything
other than [1mXtUnspecifiedPixmap[22m, the pixmap
specified will be used instead of the back-
ground color.
borderColor A pixel value which indexes the widget's col-
ormap to derive the border color of the wid-
get's window.
borderPixmap The border pixmap of this widget's window.
If this resource is set to anything other
than [1mXtUnspecifiedPixmap[22m, the pixmap speci-
fied will be used instead of the border
color.
borderWidth The width of this widget's window border.
[1mbottomMargin[0m
[1mleftMargin[0m
[1mrightMargin[0m
[1mtopMargin [22mThe amount of space, in pixels, between the
edge of the window and the corresponding edge
of the text within the window. If there is a
scrollbar active on this edge, then this is
the space between the text and the scrollbar.
colormap The colormap that this widget will use.
cursor The image that will be displayed as the
pointer cursor whenever it is in this widget.
The use of this resource is deprecated in
favor of [1mcursorName[22m.
cursorName The name of the symbol to use to represent
the pointer cursor. This resource will over-
ride the [1mcursor [22mresource if both are speci-
fied. (See 2.4.1)
depth The depth of this widget's window.
destroyCallbackAll functions on this list are called when
this widget is destroyed.
[1mdisplayCaret [22mWhether or not to display the text insert
point.
[1mdisplayPosition[22mThe position in the text buffer of the char-
acter that is currently displayed in the
upper left hand corner of the text display.
[1m149[0m
[1mAthena Widget Set libXaw 1.0.7[0m
height
width The height and width of this widget in pix-
els.
insensitiveBorder
This pixmap will be tiled into the widget's
border if the widget becomes insensitive.
[1minsertPosition [22mThis is the location of the insert point. It
is expressed in characters from the beginning
of the file. The cursor will always be
forced to be on the screen. This resource
may therefore be used to scroll the text dis-
play to a certain character position.
mappedWhenManaged
If this resource is [1mTrue[22m, then the widget's
window will automatically be mapped by the
Toolkit when it is realized and managed.
pointerColor A pixel value which indexes the widget's col-
ormap to derive the foreground color of the
pointer symbol specified by the [1mcursorName[0m
resource.
pointerColorBackground
A pixel value which indexes the widget's
colormap to derive the background color of
the pointer symbol specified by the [1mcursor-[0m
[1mName [22mresource.
[1mresize [22mControls whether or not the Text widget
attempts to resize itself when it is no
longer able to display the full text buffer
in the associated window. Any attempt by the
Text widget to resize itself is always sub-
ject to the constraints imposed by its par-
ent. The values [1mXawtextResizeNever[22m, [1mXawtex-[0m
[1mtResizeWidth[22m, [1mXawtextResizeHeight[22m, and [1mXaw-[0m
[1mtextResizeBoth [22mare all acceptable for this
resource. A converter is registered for this
resource that will convert the following
strings: [1mnever, height, width, [22mand [1mboth[22m.
screen The screen on which this widget is displayed.
This is not a settable resource.
[1mscrollHorizontal[0m
[1mscrollVertical [22mThese resources control the placement of
scrollbars on the left and bottom edge of the
text widget. These resources accept the val-
ues [1mXawtextScrollAlways[22m, [1mXawtextScrollWhen-[0m
[1mNeeded[22m, and [1mXawtextScrollNever[22m. A converter
is registered for this resource that will
[1m150[0m
[1mAthena Widget Set libXaw 1.0.7[0m
convert the following strings: [1malways, never,[0m
and [1mwhenNeeded[22m. If [1mXawtextScrollWhenNeeded[0m
is specified, the appropriate scrollbar will
only appear when there is text in the buffer
that is not able to fit within the bounds of
the current window. The scrollbar will dis-
appear when the text once again fits within
the window.
[1mselectTypes [22mSpecifies the selection type array that is
used when multi-click is activated (see [1mText[0m
[1mSelections for Application Programmers [22mfor
details). This resource is used in place,
and must not be freed until the widget is
destroyed. There is no type converter regis-
tered for this resource, so it may not be set
from the resource manager.
sensitive Whether or not the toolkit should pass user
events to this widget. The widget will not
get input events if either [1mancestorSensitive[0m
or [1msensitive [22mis [1mFalse[22m.
[1mtextSink[0m
[1mtextSource [22mThese are the TextSink or TextSource objects
used by this widget. When using the Text
widget these MUST be set by the application
programmer.
translations The event bindings associated with this wid-
get.
[1mwrap [22mWhen the text in any one line is wider than
the window there are several possible
actions. This resource allows the user to
decide what will happen. The accepted values
for this resource are [1mXawtextWrapNever[22m, [1mXaw-[0m
[1mtextWrapLine[22m, and [1mXawtextWrapWord[22m. With [1mXaw-[0m
[1mtextWrapLine [22mall text that is beyond the
right edge of the window will be displayed on
the next line. With [1mXawtextWrapWord [22mthe same
action occurs but the text is broken at a
word boundary if possible. If no wrapping is
enabled then the text will extend off the
edge of the window, and a small rectangle
will be painted in the right margin to alert
the user that this line is too long. A con-
verter is registered for this resource that
will convert the following strings: [1mnever,[0m
[1mword, [22mand [1mline[22m.
[1munrealizeCallback[0m
A list of callback functions which will be
executed when the Text widget is unrealized.
[1m151[0m
[1mAthena Widget Set libXaw 1.0.7[0m
x
y The location of the upper left outside corner
of this widget in its parent.
[4m5.10.[24m [4mTextSrc[24m [4mObject[0m
Application Header file
Class Header file
Class textSrcObjectClass
Class Name TextSrc
Superclass Object
The TextSrc object is the root object for all text sources.
Any new text source objects should be subclasses of the
TextSrc Object. The TextSrc Class contains all methods the
Text widget expects a text source to export.
Since all text sources will have some resources in common
the TextSrc defines a few new resources.
[4m5.10.1.[24m [4mResources[0m
When creating an TextSrc object instance, the following
resources are retrieved from the argument list or from the
resource database:
-----------------------------------------------------------------------------
[4mName[24m [4mClass[24m [4mType[24m [4mNotes[24m [4mDefault[24m [4mValue[0m
-----------------------------------------------------------------------------
destroyCallback Callback XtCallbackList NULL
editType EditType EditMode NULL
-----------------------------------------------------------------------------
destroyCallbackAll functions on this list are called when
this widget is destroyed.
[1meditType [22mThis is the type of editing that will be
allowed in this text widget. Legal values
are [1mXawtextRead[22m, [1mXawtextEdit[22m, and [1mXawtextAp-[0m
[1mpend[22m. A converter is registered for this
resource that will convert the following
strings: [1mread, edit, [22mand [1mappend[22m.
[4m5.10.2.[24m [4mSubclassing[24m [4mthe[24m [4mTextSrc[0m
The only purpose of the TextSrc Object is to be subclassed.
It contains the minimum set of class methods that all text
sources must have. All class methods of the TextSrc must be
defined, as the Text widget uses them all. While all may be
[1m152[0m
[1mAthena Widget Set libXaw 1.0.7[0m
inherited, the direct descendant of TextSrc [1mmust [22mspecify
some of them as TextSrc does not contain enough information
to be a valid text source by itself. Do not try to use the
TextSrc as a valid source for the Text widget; it is not
intended to be used as a source by itself and bad things
will probably happen.
--------------------------------------------------------------------------------------------
[4mFunction[24m [4mInherit[24m [4mwith[24m [4mPublic[24m [4mInterface[24m [4mmust[24m [4mspecify[0m
--------------------------------------------------------------------------------------------
Read XtInheritRead XawTextSourceRead yes
Replace XtInheritReplace XawTextSourceReplace no
Scan XtInheritScan XawTextSourceScan yes
Search XtInheritSearch XawTextSourceSearch no
SetSelection XtInheritSetSelection XawTextSourceSetSelection no
ConvertSelection XtInheritConvertSelection XawTextSourceConvertSelection no
--------------------------------------------------------------------------------------------
[4m5.10.2.1.[24m [4mReading[24m [4mText.[0m
To read the text in a text source use the [1mRead [22mfunction:
XawTextPosition Read([4mw[24m, [4mpos[24m, [4mtext_return[24m, [4mlength[24m)
Widget [4mw[24m;
XawTextPosition [4mpos[24m;
XawTextBlock [4m*text_return[24m;
int [4mlength[24m;
[4mw[24m Specifies the TextSrc object.
[4mpos[24m Specifies the position of the first character to
be read from the text buffer.
[4mtext[24m Returns the text read from the source.
[4mlength[24m Specifies the maximum number of characters the
TextSrc should return to the application in
[4mtext_return[24m.
This function returns the text position immediately after
the characters read from the text buffer. The function is
not required to read [4mlength[24m characters if that many charac-
ters are in the file, it may break at any point that is con-
venient to the internal structure of the source. It may
take several calls to [1mRead [22mbefore the desired portion of the
text buffer is fully retrieved.
[4m5.10.2.2.[24m [4mReplacing[24m [4mText.[0m
To replace or edit the text in a text buffer use the [1mReplace[0m
function:
[1m153[0m
[1mAthena Widget Set libXaw 1.0.7[0m
XawTextPosition Replace([4mw[24m, [4mstart[24m, [4mend[24m, [4mtext[24m)
Widget [4mw[24m;
XawTextPosition [4mstart[24m, [4mend[24m;
XawTextBlock [4m*text[24m;
[4mw[24m Specifies the TextSrc object.
[4mstart[24m Specifies the position of the first character to
be removed from the text buffer. This is also the
location to begin inserting the new text.
[4mend[24m Specifies the position immediately after the last
character to be removed from the text buffer.
[4mtext[24m Specifies the text to be added to the text source.
This function can return any of the following values:
[1mXawEditDone [22mThe text replacement was successful.
[1mXawPositionError[0m
The edit mode is [1mXawtextAppend [22mand [4mstart[24m is not
the last character of the source.
[1mXawEditError[22mEither the Source was read-only or the range to
be deleted is larger than the length of the
Source.
The [1mReplace [22marguments [4mstart[24m and [4mend[24m represent the text
source character positions for the existing text that is to
be replaced by the text in the text block. The characters
from [4mstart[24m up to but not including [4mend[24m are deleted, and the
buffer specified by the text block is inserted in their
place. If [4mstart[24m and [4mend[24m are equal, no text is deleted and
the new text is inserted after [4mstart[24m.
[4m5.10.2.3.[24m [4mScanning[24m [4mthe[24m [4mTextSrc[0m
To search the text source for one of the predefined boundary
types use the [1mScan [22mfunction:
XawTextPosition Scan([4mw[24m, [4mposition[24m, [4mtype[24m, [4mdir[24m, [4mcount[24m, [4minclude[24m)
Widget [4mw[24m;
XawTextPosition [4mposition[24m;
XawTextScanType [4mtype[24m;
XawTextScanDirection [4mdir[24m;
int [4mcount[24m;
Boolean [4minclude[24m;
[4mw[24m Specifies the TextSrc object.
[4mposition[24m Specifies the position to begin scanning the
[1m154[0m
[1mAthena Widget Set libXaw 1.0.7[0m
source.
[4mtype[24m Specifies the type of boundary to scan for, may be
one of: [1mXawstPosition[22m, [1mXawstWhiteSpace[22m, [1mXawstEOL[22m,
[1mXawstParagraph[22m, [1mXawstAll[22m. The exact meaning of
these boundaries is left up to the individual text
source.
[4mdir[24m Specifies the direction to scan, may be either
[1mXawsdLeft [22mto search backward, or [1mXawsdRight [22mto
search forward.
[4mcount[24m Specifies the number of boundaries to scan for.
[4minclude[24m Specifies whether the boundary itself should be
included in the scan.
The [1mScan [22mfunction returns the position in the text source of
the desired boundary. It is expected to return a valid
address for all calls made to it, thus if a particular
request is made that would take the text widget beyond the
end of the source it must return the position of that end.
[4m5.10.2.4.[24m [4mSearching[24m [4mthrough[24m [4ma[24m [4mTextSrc[0m
To search for a particular string use the [1mSearch [22mfunction.
XawTextPosition Search([4mw[24m, [4mposition[24m, [4mdir[24m, [4mtext[24m)
Widget [4mw[24m;
XawTextPosition [4mposition[24m;
XawTextScanDirection [4mdir[24m;
XawTextBlock [4m*text[24m;
[4mw[24m Specifies the TextSrc object.
[4mposition[24m Specifies the position to begin the search.
[4mdir[24m Specifies the direction to search, may be either
[1mXawsdLeft [22mto search backward, or [1mXawsdRight [22mto
search forward.
[4mtext[24m Specifies a text block containing the text to
search for.
This function will search through the text buffer attempting
to find a match for the string in the text block. If a
match is found in the direction specified, then the charac-
ter location of the first character in the string is
returned. If no text was found then [1mXawTextSearchError [22mis
returned.
[1m155[0m
[1mAthena Widget Set libXaw 1.0.7[0m
[4m5.10.2.5.[24m [4mText[24m [4mSelections[0m
While many selection types are handled by the Text widget,
text sources may have selection types unknown to the Text
widget. When a selection conversion is requested by the X
server the Text widget will first call the [1mConvertSelection[0m
function, to attempt the selection conversion.
Boolean ConvertSelections([4mw[24m, [4mselection[24m, [4mtarget[24m, [4mtype[24m, [4mvalue_return[24m, [4mlength_return[24m, [4mformat_return[24m)
Widget [4mw[24m;
Atom [4m*selection[24m, [4m*target[24m, [4m*type[24m;
caddr_t [4m*value_return[24m;
unsigned long [4m*length_return[24m;
int [4m*format_return[24m;
[4mw[24m Specifies the TextSrc object.
[4mselection[24m Specifies the type of selection that was requested
(e.g. [1mPRIMARY[22m).
[4mtarget[24m Specifies the type of the selection that has been
requested, which indicates the desired information
about the selection (e.g. Filename, Text, Window).
[4mtype[24m Specifies a pointer to the atom into which the
property type of the converted value of the selec-
tion is to be stored. For instance, either file
name or text might have property type [1mXA_STRING[22m.
[4mvalue_return[0m
Returns a pointer into which a pointer to the con-
verted value of the selection is to be stored.
The selection owner is responsible for allocating
this storage. The memory is considered owned by
the toolkit, and is freed by XtFree when the
Intrinsics selection mechanism is done with it.
[4mlength_return[0m
Returns a pointer into which the number of ele-
ments in value is to be stored. The size of each
element is determined by [4mformat[24m.
[4mformat_return[0m
Returns a pointer into which the size in bits of
the data elements of the selection value is to be
stored.
If this function returns [1mTrue [22mthen the Text widget will
assume that the source has taken care of converting the
selection, Otherwise the Text widget will attempt to convert
the selection itself.
[1m156[0m
[1mAthena Widget Set libXaw 1.0.7[0m
If the source needs to know when the text selection is modi-
fied it should define a [1mSetSelection [22mprocedure:
void SetSelection([4mw[24m, [4mstart[24m, [4mend[24m, [4mselection[24m)
Widget [4mw[24m;
XawTextPosition [4mstart[24m, [4mend[24m;
Atom [4mselection[24m;
[4mw[24m Specifies the TextSrc object.
[4mstart[24m Specifies the character position of the beginning
of the new text selection.
[4mend[24m Specifies the character position of the end of the
new text selection.
[4mselection[24m Specifies the type of selection that was requested
(e.g. [1mPRIMARY[22m).
[4m5.11.[24m [4mTextSink[24m [4mObject[0m
Application Header file
Class Header file
Class textSinkObjectClass
Class Name TextSink
Superclass Object
The TextSink object is the root object for all text sinks.
Any new text sink objects should be subclasses of the
TextSink Object. The TextSink Class contains all methods
that the Text widget expects a text sink to export.
Since all text sinks will have some resources in common, the
TextSink defines a few new resources.
[4m5.11.1.[24m [4mResources[0m
When creating an TextSink object instance, the following
resources are retrieved from the argument list or from the
resource database:
-----------------------------------------------------------------------------
[4mName[24m [4mClass[24m [4mType[24m [4mNotes[24m [4mDefault[24m [4mValue[0m
-----------------------------------------------------------------------------
background Background Pixel XtDefaultBackground
destroyCallback Callback XtCallbackList NULL
foreground Foreground Pixel XtDefaultForeground
-----------------------------------------------------------------------------
[1m157[0m
[1mAthena Widget Set libXaw 1.0.7[0m
[1mbackground [22mA pixel value which indexes the widget's col-
ormap to derive the background color of the
widget's window.
destroyCallbackAll functions on this list are called when
this widget is destroyed.
[1mforeground [22mA pixel value which indexes the Text widget's
colormap to derive the foreground color used
by the text sink.
[4m5.11.2.[24m [4mSubclassing[24m [4mthe[24m [4mTextSink[0m
The only purpose of the TextSink Object is to be subclassed.
It contains the minimum set of class methods that all text
sinks must have. While all may be inherited, the direct
descendant of TextSink [1mmust specify [22msome of them as TextSink
does contain enough information to be a valid text sink by
itself. Do not try to use the TextSink as a valid sink for
the Text widget; it is not intended to be used as a sink by
itself.
---------------------------------------------------------------------------------------------
[4mFunction[24m [4mInherit[24m [4mwith[24m [4mPublic[24m [4mInterface[24m [4mmust[24m [4mspecify[0m
---------------------------------------------------------------------------------------------
DisplayText XtInheritDisplayText XawTextSinkDisplayText yes
InsertCursor XtInheritInsertCursor XawTextSinkInsertCursor yes
ClearToBackground XtInheritClearToBackground XawTextSinkClearToBackground no
FindPosition XtInheritFindPosition XawTextSinkFindPosition yes
FindDistance XtInheritFindDistance XawTextSinkFindDistance yes
Resolve XtInheritResolve XawTextSinkResolve yes
MaxLines XtInheritMaxLines XawTextSinkMaxLines no
MaxHeight XtInheritMaxHeight XawTextSinkMaxHeight no
SetTabs XtInheritSetTabs XawTextSinkSetTabs no
GetCursorBounds XtInheritGetCursorBounds XawTextSinkGetCursorBounds yes
---------------------------------------------------------------------------------------------
[4m5.11.2.1.[24m [4mDisplaying[24m [4mText[0m
To display a section of the text buffer contained in the
text source use the function [1mDisplayText[22m:
void DisplayText([4mw[24m, [4mx[24m, [4my[24m, [4mpos1[24m, [4mpos2[24m, [4mhighlight[24m)
Widget [4mw[24m;
Position [4mx[24m, [4my[24m;
XawTextPosition [4mpos1[24m, [4mpos2[24m;
Boolean [4mhighlight[24m;
[4mw[24m Specifies the TextSink object.
[4mx[24m Specifies the x location to start drawing the
text.
[1m158[0m
[1mAthena Widget Set libXaw 1.0.7[0m
[4my[24m Specifies the y location to start drawing text.
[4mpos1[24m Specifies the location within the text source of
the first character to be printed.
[4mpos2[24m Specifies the location within the text source of
the last character to be printed.
[4mhighlight[24m Specifies whether or not to paint the text region
highlighted.
The Text widget will only pass one line at a time to the
text sink, so this function does not need to know how to
line feed the text. It is acceptable for this function to
just ignore Carriage Returns. [4mx[24m and [4my[24m denote the upper left
hand corner of the first character to be displayed.
[4m5.11.2.2.[24m [4mDisplaying[24m [4mthe[24m [4mInsert[24m [4mPoint[0m
The function that controls the display of the text cursor is
[1mInsertCursor[22m. This function will be called whenever the
text widget desires to change the state of, or move the
insert point.
void InsertCursor([4mw[24m, [4mx[24m, [4my[24m, [4mstate[24m)
Widget [4mw[24m;
Position [4mx[24m, [4my[24m;
XawTextInsertState [4mstate[24m;
[4mw[24m Specifies the TextSink object.
[4mx[24m Specifies the x location of the cursor in Pixels.
[4my[24m Specifies the y location of the cursor in Pixels.
[4mstate[24m Specifies the state of the cursor, may be one of
[1mXawisOn [22mor [1mXawisOff[22m.
[4mX[24m and [4my[24m denote the upper left hand corner of the insert
point.
[4m5.11.2.3.[24m [4mClearing[24m [4mPortions[24m [4mof[24m [4mthe[24m [4mText[24m [4mwindow[0m
To clear a portion of the Text window to its background
color, the Text widget will call [1mClearToBackground[22m. The
TextSink object already defines this function as calling
[1mXClearArea [22mon the region passed. This behavior will be used
if you specify [1mXtInheritClearToBackground [22mfor this method.
void ClearToBackground([4mw[24m, [4mx[24m, [4my[24m, [4mwidth[24m, [4mheight[24m)
Widget [4mw[24m;
Position [4mx[24m, [4my[24m;
Dimension [4mwidth[24m, [4mheight[24m;
[1m159[0m
[1mAthena Widget Set libXaw 1.0.7[0m
[4mw[24m Specifies the TextSink object.
[4mx[24m Specifies the x location, in pixels, of the Region
to clear.
[4my[24m Specifies the y location, in pixels, of the Region
to clear.
[4mwidth[24m Specifies the width, in pixels, of the Region to
clear.
[4mheight[24m Specifies the height, in pixels, of the Region to
clear.
[4mX[24m and [4my[24m denote the upper left hand corner of region to
clear.
[4m5.11.2.4.[24m [4mFinding[24m [4ma[24m [4mText[24m [4mPosition[24m [4mGiven[24m [4mPixel[24m [4mValues[0m
To find the text character position that will be rendered at
a given x location the Text widget uses the function [1mFindPo-[0m
[1msition[22m:
void FindPosition([4mw[24m, [4mfromPos[24m, [4mfromX[24m, [4mwidth[24m, [4mstopAtWordBreak[24m, [4mpos_return[24m, [4mwidth_return[24m, [4mheight_return[24m)
Widget [4mw[24m;
XawTextPosition [4mfromPos[24m;
int [4mfromX[24m, [4mwidth[24m;
Boolean [4mstopAtWordBreak[24m;
XawTextPosition [4m*pos_return[24m;
int [4m*width_return[24m, [4m*height_return[24m;
[4mw[24m Specifies the TextSink object.
[4mfromPos[24m Specifies a reference position, usually the
first character in this line. This character is
always to the left of the desired character
location.
[4mfromX[24m Specifies the distance that the left edge of
[4mfromPos[24m is from the left edge of the window.
This is the reference x location for the refer-
ence position.
[4mwidth[24m Specifies the distance, in pixels, from the ref-
erence position to the desired character posi-
tion.
[4mstopAtWordBreak[0m
Specifies whether or not the position that is
returned should be forced to be on a word bound-
ary.
[4mpos_return[24m Returns the character position that corresponds
[1m160[0m
[1mAthena Widget Set libXaw 1.0.7[0m
to the location that has been specified, or the
work break immediately to the left of the posi-
tion if [4mstopAtWordBreak[24m is [1mTrue[22m.
[4mwidth_return[24mReturns the actual distance between [4mfromPos[24m and
[4mpos_return.[0m
[4mheight_return[24mReturns the maximum height of the text between
[4mfromPos[24m and [4mpos_return.[0m
This function need make no attempt to deal with line feeds.
The text widget will only call it one line at a time.
Another means of finding a text position is provided by the
[1mResolve [22mfunction:
void Resolve([4mw[24m, [4mfromPos[24m, [4mfromX[24m, [4mwidth[24m, [4mpos_return[24m)
Widget [4mw[24m;
XawTextPosition [4mfromPos[24m;
int [4mfromX[24m, [4mwidth[24m;
XawTextPosition [4m*pos_return[24m;
[4mw[24m Specifies the TextSink object.
[4mfromPos[24m Specifies a reference position, usually the first
character in this line. This character is always
to the left of the desired character location.
[4mfromX[24m Specifies the distance that the left edge of
[4mfromPos[24m is from the left edge of the window. This
is the reference x location for the reference
position.
[4mwidth[24m Specifies the distance, in pixels, from the refer-
ence position to the desired character position.
[4mpos_return[24mReturns the character position that corresponds to
the location that has been specified, or the word
break immediately to the left if [4mstopAtWordBreak[0m
is [1mTrue[22m.
This function need make no attempt to deal with line feeds.
The text widget will only call it one line at a time. This
is a more convenient interface to the [1mFindPosition [22mfunction,
and provides a subset of its functionality.
[4m5.11.2.5.[24m [4mFinding[24m [4mthe[24m [4mDistance[24m [4mBetween[24m [4mtwo[24m [4mText[24m [4mPositions[0m
To find the distance in pixels between two text positions on
the same line use the function [1mFindDistance[22m.
[1m161[0m
[1mAthena Widget Set libXaw 1.0.7[0m
void FindDistance([4mw[24m, [4mfromPos[24m, [4mfromX[24m, [4mtoPos[24m, [4mwidth_return[24m, [4mpos_return[24m, [4mheight_return[24m)
Widget [4mw[24m;
XawTextPosition [4mfromPos[24m, [4mtoPos[24m;
int [4mfromX[24m;
XawTextPosition [4m*pos_return[24m;
int [4m*width_return[24m, [4m*height_return[24m;
[4mw[24m Specifies the TextSink object.
[4mfromPos[24m Specifies the text buffer position, in characters,
of the first position.
[4mfromX[24m Specifies the distance that the left edge of
[4mfromPos[24m is from the left edge of the window. This
is the reference x location for the reference
position.
[4mtoPos[24m Specifies the text buffer position, in characters,
of the second position.
[4mresWidth[24m Return the actual distance between [4mfromPos[24m and
[4mpos_return.[0m
[4mresPos[24m Returns the character position that corresponds to
the actual character position used for [4mtoPos[24m in
the calculations. This may be different than
[4mtoPos[24m, for example if [4mfromPos[24m and [4mtoPos[24m are on
different lines in the file.
[4mheight_return[0m
Returns the maximum height of the text between
[4mfromPos[24m and [4mpos_return[24m.
This function need make no attempt to deal with line feeds.
The Text widget will only call it one line at a time.
[4m5.11.2.6.[24m [4mFinding[24m [4mthe[24m [4mSize[24m [4mof[24m [4mthe[24m [4mDrawing[24m [4marea[0m
To find the maximum number of lines that will fit into the
current Text widget, use the function [1mMaxLines[22m. The
TextSink already defines this function to compute the maxi-
mum number of lines by using the height of [1mfont[22m.
int MaxLines([4mw[24m, [4mheight[24m)
Widget [4mw[24m;
Dimension [4mheight[24m;
[4mw[24m Specifies the TextSink object.
[4mheight[24m Specifies the height of the current drawing area.
Returns the maximum number of lines that will fit in [4mheight[24m.
[1m162[0m
[1mAthena Widget Set libXaw 1.0.7[0m
To find the height required for a given number of text
lines, use the function [1mMaxHeight[22m. The TextSink already
defines this function to compute the maximum height of the
window by using the height of [1mfont[22m.
int MaxHeight([4mw[24m, [4mlines[24m)
Widget [4mw[24m;
int [4mlines[24m;
[4mw[24m Specifies the TextSink object.
[4mheight[24m Specifies the height of the current drawing area.
Returns the height that will be taken up by the number of
lines passed.
[4m5.11.2.7.[24m [4mSetting[24m [4mthe[24m [4mTab[24m [4mStops[0m
To set the tab stops for a text sink use the [1mSetTabs [22mfunc-
tion. The TextSink already defines this function to set the
tab x location in pixels to be the number of characters
times the figure width of [1mfont[22m.
void SetTabs([4mw[24m, [4mtab_count[24m, [4mtabs[24m)
Widget [4mw[24m;
int [4mtab_count[24m, [4m*tabs[24m;
[4mw[24m Specifies the TextSink object.
[4mtab_count[24m Specifies the number of tabs passed in [4mtabs[24m.
[4mtabs[24m Specifies the position, in characters, of the tab
stops.
This function is responsible for the converting character
positions passed to it into whatever internal positions the
TextSink uses for tab placement.
[4m5.11.2.8.[24m [4mGetting[24m [4mthe[24m [4mInsert[24m [4mPoint's[24m [4mSize[24m [4mand[24m [4mLocation[0m
To get the size and location of the insert point use the
[1mGetCursorBounds [22mfunction.
void GetCursorBounds([4mw[24m, [4mrect_return[24m)
Widget [4mw[24m;
XRectangle [4m*rect_return[24m;
[4mw[24m Specifies the TextSinkObject.
[4mrect_return[24mReturns the location and size of the insert
point.
[1m163[0m
[1mAthena Widget Set libXaw 1.0.7[0m
[4mRect[24m will be filled with the current size and location of
the insert point.
[1m164[0m
[1mAthena Widget Set libXaw 1.0.7[0m
[1mChapter 6[0m
[1mComposite and Constraint Widgets[0m
These widgets may contain arbitrary widget children. They
implement a policy for the size and location of their chil-
dren.
[1mBox [22mThis widget will pack its children as tightly as
possible in non-overlapping rows.
[1mDialog [22mAn implementation of a commonly used interaction
semantic to prompt for auxiliary input from the
user, such as a filename.
[1mForm [22mA more sophisticated layout widget that allows the
children to specify their positions relative to
the other children, or to the edges of the Form.
[1mPaned [22mAllows children to be tiled vertically or horizon-
tally. Controls are also provided to allow the
user to dynamically resize the individual panes.
[1mPorthole [22mAllows viewing of a managed child which is as
large as, or larger than its parent, typically
under control of a Panner widget.
[1mTree [22mProvides geometry management of widgets arranged
in a directed, acyclic graph.
[1mViewport [22mConsists of a frame, one or two scrollbars, and an
inner window. The inner window can contain all
the data that is to be displayed. This inner win-
dow will be clipped by the frame with the scroll-
bars controlling which section of the inner window
is currently visible.
[4m6.0.1.[24m [4mA[24m [4mBrief[24m [4mNote[24m [4mon[24m [4mGeometry[24m [4mManagement[0m
The geometry management semantics provided by the X Toolkit
give full control of the size and position of a widget to
the parent of that widget. While the children are allowed
to request a certain size or location, it is the parent who
makes the final decision. Many of the composite widgets
here will deny any geometry request from their children by
default. If a child widget is not getting the expected size
or location, it is most likely the parent disallowing a
request, or implementing semantics slightly different than
[1m165[0m
[1mAthena Widget Set libXaw 1.0.7[0m
those expected by the application programmer.
If the application wishes to change the size or location of
any widget it should make a call to [1mXtSetValues[22m. This will
allow the widget to ask its parent for the new size or loca-
tion. As noted above the parent is allowed to refuse this
request, and the child must live with the result. If the
application is unable to achieve the desired semantics, then
perhaps it should use a different composite widget. Under
no circumstances should an application programmer resort to
[1mXtMoveWidget [22mor [1mXtResizeWidget[22m; these functions are exclu-
sively for the use of Composite widget implementors.
For more information on geometry management consult the [4mX[0m
[4mToolkit[24m [4mIntrinsics[24m [4m--[24m [4mC[24m [4mLanguage[24m [4mInterface[24m.
[4m6.1.[24m [4mBox[24m [4mWidget[0m
Application Header file
Class Header file
Class boxWidgetClass
Class Name Box
Superclass Composite
The Box widget provides geometry management of arbitrary
widgets in a box of a specified dimension. The children are
rearranged when resizing events occur either on the Box or
its children, or when children are managed or unmanaged.
The Box widget always attempts to pack its children as
tightly as possible within the geometry allowed by its par-
ent.
Box widgets are commonly used to manage a related set of
buttons and are often called ButtonBox widgets, but the
children are not limited to buttons. The Box's children are
arranged on a background that has its own specified dimen-
sions and color.
[4m6.1.1.[24m [4mResources[0m
When creating a Box widget instance, the following resources
are retrieved from the argument list or from the resource
database:
----------------------------------------------------------------------------
[4mName[24m [4mClass[24m [4mType[24m [4mNotesDefault[24m [4mValue[0m
----------------------------------------------------------------------------
[1m166[0m
[1mAthena Widget Set libXaw 1.0.7[0m
----------------------------------------------------------------------------
[4mName[24m [4mClass[24m [4mType[24m [4mNotesDefault[24m [4mValue[0m
----------------------------------------------------------------------------
accelerators Accelerators AcceleratorTable NULL
ancestorSensitiveAncestorSensitiveBoolean D True
background Background Pixel XtDefaultBackground
backgroundPixmap Pixmap Pixmap XtUnspecifiedPixmap
borderColor BorderColor Pixel XtDefaultForeground
borderPixmap Pixmap Pixmap XtUnspecifiedPixmap
borderWidth BorderWidth Dimension 1
children ReadOnly WidgetList R NULL
colormap Colormap Colormap Parent's Colormap
depth Depth int C Parent's Depth
destroyCallback Callback XtCallbackList NULL
height Height Dimension A see [1mLayout Semantics[0m
hSpace HSpace Dimension 4
mappedWhenManagedMappedWhenManagedBoolean True
numChildren ReadOnly Cardinal R 0
orientation Orientation Orientation XtorientVertical
screen Screen Screen R Parent's Screen
sensitive Sensitive Boolean True
vSpace VSpace Dimension 4
translations Translations TranslationTable NULL
width Width Dimension A see [1mLayout Semantics[0m
x Position Position 0
y Position Position 0
----------------------------------------------------------------------------
accelerators A list of event to action bindings to be exe-
cuted by this widget, even though the event
occurred in another widget. (See the [4mX[24m [4mTool-[0m
[4mkit[24m [4mIntrinsics[24m [4m--[24m [4mC[24m [4mLanguage[24m [4mInterface[24m for
details).
ancestorSensitive
The sensitivity state of the ancestors of
this widget. A widget is insensitive if
either it or any of its ancestors is insensi-
tive. This resource should not be changed
with [1mXtSetValues[22m, although it may be queried.
background A pixel value which indexes the widget's col-
ormap to derive the background color of the
widget's window.
backgroundPixmapThe background pixmap of this widget's win-
dow. If this resource is set to anything
other than [1mXtUnspecifiedPixmap[22m, the pixmap
specified will be used instead of the back-
ground color.
borderColor A pixel value which indexes the widget's col-
ormap to derive the border color of the
[1m167[0m
[1mAthena Widget Set libXaw 1.0.7[0m
widget's window.
borderPixmap The border pixmap of this widget's window.
If this resource is set to anything other
than [1mXtUnspecifiedPixmap[22m, the pixmap speci-
fied will be used instead of the border
color.
borderWidth The width of this widget's window border.
children A list of all this composite widget's current
children.
colormap The colormap that this widget will use.
depth The depth of this widget's window.
destroyCallbackAll functions on this list are called when
this widget is destroyed.
height
width The height and width of this widget in pix-
els.
[1mhSpace[0m
[1mvSpace [22mThe amount of space, in pixels, to leave
between the children. This resource speci-
fies the amount of space left between the
outermost children and the edge of the box.
mappedWhenManaged
If this resource is [1mTrue[22m, then the widget's
window will automatically be mapped by the
Toolkit when it is realized and managed.
numChildren The number of children in this composite wid-
get.
[1morientation [22mSpecifies whether the preferred shape of the
box (i.e. the result returned by the
query_geometry class method) is tall and nar-
row [1mXtorientVertical [22mor short and wide [1mXtori-[0m
[1mentHorizontal[22m. When the Box is a child of a
parent which enforces width constraints, it
is usually better to specify [1mXtorientVertical[0m
(the default). When the parent enforces
height constraints, it is usually better to
specify [1mXtorientHorizontal[22m. A converter is
registered for this resource that will con-
vert the following strings: [1mhorizontal [22mand
[1mvertical[22m.
screen The screen on which this widget is displayed.
This is not a settable resource.
[1m168[0m
[1mAthena Widget Set libXaw 1.0.7[0m
sensitive Whether or not the toolkit should pass user
events to this widget. The widget will not
get input events if either [1mancestorSensitive[0m
or [1msensitive [22mis [1mFalse[22m.
translations The event bindings associated with this wid-
get.
x
y The location of the upper left outside corner
of this widget in its parent.
[4m6.1.2.[24m [4mLayout[24m [4mSemantics[0m
Each time a child is managed or unmanaged, the Box widget
will attempt to reposition the remaining children to compact
the box. Children are positioned in order left to right,
top to bottom. The packing algorithm used depends on the
[1morientation [22mof the Box.
[1mXtorientVertical[22mWhen the next child does not fit on the cur-
rent row, a new row is started. If a child
is wider than the width of the box, the box
will request a larger width from its parent
and will begin the layout process from the
beginning if a new width is granted.
[1mXtorientHorizontal[0m
When the next child does not fit on the cur-
rent row, the Box widens if possible (so as
to keep children on a single row); otherwise
a new row is started.
After positioning all children, the Box widget attempts to
shrink its own size to the minimum dimensions required for
the layout.
[4m6.2.[24m [4mDialog[24m [4mWidget[0m
Application Header file
Class Header file
Class dialogWidgetClass
Class Name Dialog
Superclass Form
The Dialog widget implements a commonly used interaction
semantic to prompt for auxiliary input from a user. For
example, you can use a Dialog widget when an application
requires a small piece of information, such as a filename,
from the user. A Dialog widget, which is simply a special
[1m169[0m
[1mAthena Widget Set libXaw 1.0.7[0m
case of the Form widget, provides a convenient way to create
a preconfigured form.
The typical Dialog widget contains three areas. The first
line contains a description of the function of the Dialog
widget, for example, the string [4mFilename:[24m. The second line
contains an area into which the user types input. The third
line can contain buttons that let the user confirm or cancel
the Dialog input. Any of these areas may be omitted by the
application.
[4m6.2.1.[24m [4mResources[0m
When creating a Dialog widget instance, the following
resources are retrieved from the argument list or the
resource database:
--------------------------------------------------------------------------------------------
[4mName[24m [4mClass[24m [4mType[24m [4mNotesDefault[24m [4mValue[0m
--------------------------------------------------------------------------------------------
accelerators Accelerators AcceleratorTable NULL
ancestorSensitiveAncestorSensitiveBoolean D True
background Background Pixel XtDefaultBackground
backgroundPixmap Pixmap Pixmap XtUnspecifiedPixmap
borderColor BorderColor Pixel XtDefaultForeground
borderPixmap Pixmap Pixmap XtUnspecifiedPixmap
borderWidth BorderWidth Dimension 1
children ReadOnly WidgetList R NULL
colormap Colormap Colormap Parent's Colormap
defaultDistance Thickness int 4
depth Depth int C Parent's Depth
destroyCallback Callback XtCallbackList NULL
height Height Dimension A Enough space to contain all children
icon Icon Bitmap None
label Label String "label"
mappedWhenManagedMappedWhenManagedBoolean True
numChildren ReadOnly Cardinal R 0
screen Screen Screen R Parent's Screen
sensitive Sensitive Boolean True
translations Translations TranslationTable NULL
value Value String no value widget
width Width Dimension A Enough space to contain all children
x Position Position 0
y Position Position 0
--------------------------------------------------------------------------------------------
accelerators A list of event to action bindings to be exe-
cuted by this widget, even though the event
occurred in another widget. (See the [4mX[24m [4mTool-[0m
[4mkit[24m [4mIntrinsics[24m [4m--[24m [4mC[24m [4mLanguage[24m [4mInterface[24m for
details).
ancestorSensitive
[1m170[0m
[1mAthena Widget Set libXaw 1.0.7[0m
The sensitivity state of the ancestors of
this widget. A widget is insensitive if
either it or any of its ancestors is insensi-
tive. This resource should not be changed
with [1mXtSetValues[22m, although it may be queried.
background A pixel value which indexes the widget's col-
ormap to derive the background color of the
widget's window.
backgroundPixmapThe background pixmap of this widget's win-
dow. If this resource is set to anything
other than [1mXtUnspecifiedPixmap[22m, the pixmap
specified will be used instead of the back-
ground color.
borderColor A pixel value which indexes the widget's col-
ormap to derive the border color of the wid-
get's window.
borderPixmap The border pixmap of this widget's window.
If this resource is set to anything other
than [1mXtUnspecifiedPixmap[22m, the pixmap speci-
fied will be used instead of the border
color.
borderWidth The width of this widget's window border.
children A list of all this composite widget's current
children.
colormap The colormap that this widget will use.
defaultDistanceThe default internal spacing for the chil-
dren. This is the default value for the con-
straint resources [1mhorizDistance [22mand [1mvertDis-[0m
[1mtance[22m.
depth The depth of this widget's window.
destroyCallbackAll functions on this list are called when
this widget is destroyed.
height
width The height and width of this widget in pix-
els.
[1micon [22mA pixmap image to be displayed immediately to
the left of the Dialog widget's label.
[1mlabel [22mA string to be displayed at the top of the
Dialog widget.
mappedWhenManaged
[1m171[0m
[1mAthena Widget Set libXaw 1.0.7[0m
If this resource is [1mTrue[22m, then the widget's
window will automatically be mapped by the
Toolkit when it is realized and managed.
numChildren The number of children in this composite wid-
get.
screen The screen on which this widget is displayed.
This is not a settable resource.
sensitive Whether or not the toolkit should pass user
events to this widget. The widget will not
get input events if either [1mancestorSensitive[0m
or [1msensitive [22mis [1mFalse[22m.
translations The event bindings associated with this wid-
get.
[1mvalue [22mAn initial value for the string field that
the user will enter text into. By default,
no text entry field is available to the user.
Specifying an initial value for [1mvalue [22macti-
vates the text entry field. If string input
is desired, but no initial value is to be
specified then set this resource to "" (empty
string).
x
y The location of the upper left outside corner
of this widget in its parent.
[4m6.2.2.[24m [4mConstraint[24m [4mResources[0m
Each child of the Dialog widget may request special layout
resources be applied to it. These [4mconstraint[24m resources
allow the Dialog widget's children to specify individual
layout requirements.
------------------------------------------------------------------------------
[4mName[24m [4mClass[24m [4mType[24m [4mNotes[24m [4mDefault[24m [4mValue[0m
------------------------------------------------------------------------------
bottom Edge XawEdgeType XawRubber
fromHoriz Widget Widget NULL (left edge of Dialog)
fromVert Widget Widget NULL (top edge of Dialog)
horizDistance Thickness int [1mdefaultDistance [22mresource
left Edge XawEdgeType XawRubber
resizable Boolean Boolean FALSE
right Edge XawEdgeType XawRubber
top Edge XawEdgeType XawRubber
vertDistance Thickness int [1mdefaultDistance [22mresource
------------------------------------------------------------------------------
[1m172[0m
[1mAthena Widget Set libXaw 1.0.7[0m
bottom
left
right
top What to do with this edge of the child when
the parent is resized. This resource may be
any [1medgeType[22m. See [1mLayout Semantics [22mfor
details.
fromHoriz
fromVert Which widget this child should be placed
underneath (or to the right of). If a value
of NULL is specified then this widget will be
positioned relative to the edge of the par-
ent.
horizDistance
vertDistance The amount of space, in pixels, between this
child and its left or upper neighbor.
resizable If this resource is [1mFalse [22mthen the parent
widget will ignore all geometry request made
by this child. The parent may still resize
this child itself, however.
[4m6.2.3.[24m [4mLayout[24m [4mSemantics[0m
The Dialog widget uses two different sets of layout seman-
tics. One is used when initially laying out the children.
The other is used when the Dialog is resized.
The first layout method uses the [1mfromVert [22mand [1mfromHoriz[0m
resources to place the children of the Dialog. A single
pass is made through the Dialog widget's children in the
order that they were created. Each child is then placed in
the Dialog widget below or to the right of the widget speci-
fied by the [1mfromVert [22mand [1mfromHoriz [22mresources. The distance
the new child is placed from its left or upper neighbor is
determined by the [1mhorizDistance [22mand [1mvertDistance [22mresources.
This implies some things about how the order of creation
affects the possible placement of the children. The Form
widget registers a string to widget converter which does not
postpone conversion and does not cache conversion results.
The second layout method is used when the Dialog is resized.
It does not matter what causes this resize, and it is possi-
ble for a resize to happen before the widget becomes visible
(due to constraints imposed by the parent of the Dialog).
This layout method uses the [1mbottom[22m, [1mtop[22m, [1mleft[22m, and [1mright[0m
resources. These resources are used to determine what will
happen to each edge of the child when the Dialog is resized.
If a value of [1mXawChain[4m[22m[24m is specified, the the edge
of the child will remain a fixed distance from the [4mchain[0m
edge of the Dialog. For example if [1mXawChainLeft [22mis speci-
fied for the [1mright [22mresource of a child then the right edge
[1m173[0m
[1mAthena Widget Set libXaw 1.0.7[0m
of that child will remain a fixed distance from the left
edge of the Dialog widget. If a value of [1mXawRubber [22mis spec-
ified, that edge will grow by the same percentage that the
Dialog grew. For instance if the Dialog grows by 50% the
left edge of the child (if specified as [1mXawRubber [22mwill be
50% farther from the left edge of the Dialog). One must be
very careful when specifying these resources, for when they
are specified incorrectly children may overlap or completely
occlude other children when the Dialog widget is resized.
--------------------------------------------------------------------------------------
[4mEdge[24m [4mType[24m [4mResource[24m [4mName[24m [4mDescription[0m
--------------------------------------------------------------------------------------
XawChainBottom ChainBottom Edge remains a fixed distance from bottom of Dialog
XawChainLeft ChainLeft Edge remains a fixed distance from left of Dialog
XawChainRight ChainRight Edge remains a fixed distance from right of Dialog
XawChainTop ChainTop Edge remains a fixed distance from top of Dialog
XawRubber Rubber Edges will move a proportional distance
--------------------------------------------------------------------------------------
[4m6.2.3.1.[24m [4mExample[0m
If you wish to force the Dialog to never resize one or more
of its children then set [1mleft [22mand [1mright [22mto [1mXawChainLeft [22mand
[1mtop [22mand [1mbottom [22mto [1mXawChainTop[22m. This will cause the child to
remain a fixed distance from the top and left edges of the
Dialog, and to never resize.
[4m6.2.3.2.[24m [4mSpecial[24m [4mConsiderations[0m
The Dialog widget automatically sets the [1mtop [22mand [1mbottom[0m
resources for all Children that are subclasses of the Com-
mand widget, as well as the widget children that are used to
contain the [1mlabel[22m, [1mvalue[22m, and [1micon[22m. This policy allows the
buttons at the bottom of the Dialog to interact correctly
with the predefined children, and makes it possible for a
client to simply create and manage a new Command button
without having to specify its constraints.
The Dialog will also set [1mfromLeft [22mto the last button in the
Dialog for each new button added to the Dialog widget.
The automatically added constraints cannot be overridden, as
they are policy decisions of the Dialog widget. If a more
flexible Dialog is desired, the application is free to use
the Form widget to create its own Dialog policy.
[4m6.2.4.[24m [4mAutomatically[24m [4mCreated[24m [4mChildren.[0m
The Dialog uses Label widgets to contain the [1mlabel [22mand [1micon[22m.
These widgets are named [4mlabel[24m and [4micon[24m respectively. The
Dialog [1mvalue [22mis contained in an AsciiText widget whose name
[1m174[0m
[1mAthena Widget Set libXaw 1.0.7[0m
is [4mvalue[24m. Using [1mXtNameToWidget [22mthe application can change
those resources associated with each of these widgets that
are not available through the Dialog widget itself.
[4m6.2.5.[24m [4mConvenience[24m [4mRoutines[0m
To return the character string in the text field, use [4mXawDi-[0m
[4malogGetValueString[24m.
String XawDialogGetValueString([4mw[24m)
Widget [4mw[24m;
[4mw[24m Specifies the Dialog widget.
This function returns a copy of the value string of the Dia-
log widget. This string is allocated by the AsciiText wid-
get and will remain valid and unchanged until another call
to [1mXawDialogGetValueString [22mor an [1mXtGetValues [22mcall on the
[1mvalue [22mwidget, when the string will be automatically freed,
and a new string is returned. This string may be freed ear-
lier by calling the function [1mXawAsciiSourceFreeString[22m.
To add a new button to the Dialog widget use [1mXawDialogAd-[0m
[1mdButton[22m.
void XawDialogAddButton([4mw[24m, [4mname[24m, [4mfunc[24m, [4mclient_data[24m)
Widget [4mw[24m;
String [4mname[24m;
XtCallbackProc [4mfunc[24m;
XtPointer [4mclient_data[24m;
[4mw[24m Specifies the Dialog widget.
[4mname[24m Specifies the name of the new Command button to be
added to the Dialog.
[4mfunc[24m Specifies a callback function to be called when
this button is activated. If NULL is specified
then no callback is added.
[4mclient_data[24mSpecifies the client_data to be passed to the
[4mfunc[24m.
This function is merely a shorthand for the code sequence:
{
Widget button = XtCreateManagedWidget(name, commandWidgetClass, w, NULL, ZERO);
XtAddCallback(button, XtNcallback, func, client_data);
}
[1m175[0m
[1mAthena Widget Set libXaw 1.0.7[0m
[4m6.3.[24m [4mForm[24m [4mWidget[0m
Application Header file
Class Header file
Class formWidgetClass
Class Name Form
Superclass Constraint
The Form widget can contain an arbitrary number of children
or subwidgets. The Form provides geometry management for
its children, which allows individual control of the posi-
tion of each child. Any combination of children can be
added to a Form. The initial positions of the children may
be computed relative to the positions of previously created
children. When the Form is resized, it computes new posi-
tions and sizes for its children. This computation is based
upon information provided when a child is added to the Form.
The default width of the Form is the minimum width needed to
enclose the children after computing their initial layout,
with a margin of [1mdefaultDistance [22mat the right and bottom
edges. If a width and height is assigned to the Form that
is too small for the layout, the children will be clipped by
the right and bottom edges of the Form.
[4m6.3.1.[24m [4mResources[0m
When creating a Form widget instance, the following
resources are retrieved from the argument list or from the
resource database:
--------------------------------------------------------------------------------------------
[4mName[24m [4mClass[24m [4mType[24m [4mNotesDefault[24m [4mValue[0m
--------------------------------------------------------------------------------------------
accelerators Accelerators AcceleratorTable NULL
ancestorSensitiveAncestorSensitiveBoolean D True
background Background Pixel XtDefaultBackground
backgroundPixmap Pixmap Pixmap XtUnspecifiedPixmap
borderColor BorderColor Pixel XtDefaultForeground
borderPixmap Pixmap Pixmap XtUnspecifiedPixmap
borderWidth BorderWidth Dimension 1
children ReadOnly WidgetList R NULL
colormap Colormap Colormap Parent's Colormap
defaultDistance Thickness int 4
depth Depth int C Parent's Depth
destroyCallback Callback XtCallbackList NULL
height Height Dimension A Enough space to contain all children
mappedWhenManagedMappedWhenManagedBoolean True
[1m176[0m
[1mAthena Widget Set libXaw 1.0.7[0m
--------------------------------------------------------------------------------------------
[4mName[24m [4mClass[24m [4mType[24m [4mNotesDefault[24m [4mValue[0m
--------------------------------------------------------------------------------------------
numChildren ReadOnly Cardinal R 0
screen Screen Screen R Parent's Screen
sensitive Sensitive Boolean True
translations Translations TranslationTable NULL
width Width Dimension A Enough space to contain all children
x Position Position 0
y Position Position 0
--------------------------------------------------------------------------------------------
accelerators A list of event to action bindings to be exe-
cuted by this widget, even though the event
occurred in another widget. (See the [4mX[24m [4mTool-[0m
[4mkit[24m [4mIntrinsics[24m [4m--[24m [4mC[24m [4mLanguage[24m [4mInterface[24m for
details).
ancestorSensitive
The sensitivity state of the ancestors of
this widget. A widget is insensitive if
either it or any of its ancestors is insensi-
tive. This resource should not be changed
with [1mXtSetValues[22m, although it may be queried.
background A pixel value which indexes the widget's col-
ormap to derive the background color of the
widget's window.
backgroundPixmapThe background pixmap of this widget's win-
dow. If this resource is set to anything
other than [1mXtUnspecifiedPixmap[22m, the pixmap
specified will be used instead of the back-
ground color.
borderColor A pixel value which indexes the widget's col-
ormap to derive the border color of the wid-
get's window.
borderPixmap The border pixmap of this widget's window.
If this resource is set to anything other
than [1mXtUnspecifiedPixmap[22m, the pixmap speci-
fied will be used instead of the border
color.
borderWidth The width of this widget's window border.
children A list of all this composite widget's current
children.
colormap The colormap that this widget will use.
[1mdefaultDistance[22mThe default internal spacing for the
[1m177[0m
[1mAthena Widget Set libXaw 1.0.7[0m
children. This is the default value for the
constraint resources [1mhorizDistance [22mand [1mvert-[0m
[1mDistance[22m.
depth The depth of this widget's window.
destroyCallbackAll functions on this list are called when
this widget is destroyed.
height
width The height and width of this widget in pix-
els.
mappedWhenManaged
If this resource is [1mTrue[22m, then the widget's
window will automatically be mapped by the
Toolkit when it is realized and managed.
numChildren The number of children in this composite wid-
get.
screen The screen on which this widget is displayed.
This is not a settable resource.
sensitive Whether or not the toolkit should pass user
events to this widget. The widget will not
get input events if either [1mancestorSensitive[0m
or [1msensitive [22mis [1mFalse[22m.
translations The event bindings associated with this wid-
get.
x
y The location of the upper left outside corner
of this widget in its parent.
[4m6.3.2.[24m [4mConstraint[24m [4mResources[0m
Each child of the Form widget may request special layout
resources be applied to it. These [4mconstraint[24m resources
allow the Form widget's children to specify individual lay-
out requirements.
----------------------------------------------------------------------------
[4mName[24m [4mClass[24m [4mType[24m [4mNotes[24m [4mDefault[24m [4mValue[0m
----------------------------------------------------------------------------
bottom Edge XawEdgeType XawRubber
fromHoriz Widget Widget NULL (left edge of Form)
fromVert Widget Widget NULL (top edge of Form)
horizDistance Thickness int [1mdefaultDistance [22mresource
left Edge XawEdgeType XawRubber
[1m178[0m
[1mAthena Widget Set libXaw 1.0.7[0m
----------------------------------------------------------------------------
[4mName[24m [4mClass[24m [4mType[24m [4mNotes[24m [4mDefault[24m [4mValue[0m
----------------------------------------------------------------------------
resizable Boolean Boolean FALSE
right Edge XawEdgeType XawRubber
top Edge XawEdgeType XawRubber
vertDistance Thickness int [1mdefaultDistance [22mresource
----------------------------------------------------------------------------
[1mbottom[0m
[1mleft[0m
[1mright[0m
[1mtop [22mWhat to do with this edge of the child when
the parent is resized. This resource may be
any [1medgeType[22m. See [1mLayout Semantics [22mfor
details.
[1mfromHoriz[0m
[1mfromVert [22mWhich widget this child should be placed
underneath (or to the right of). If a value
of NULL is specified then this widget will be
positioned relative to the edge of the par-
ent.
[1mhorizDistance[0m
[1mvertDistance [22mThe amount of space, in pixels, between this
child and its left or upper neighbor.
[1mresizable [22mIf this resource is [1mFalse [22mthen the parent
widget will ignore all geometry request made
by this child. The parent may still resize
this child itself, however.
[4m6.3.3.[24m [4mLayout[24m [4mSemantics[0m
The Form widget uses two different sets of layout semantics.
One is used when initially laying out the children. The
other is used when the Form is resized.
The first layout method uses the [1mfromVert [22mand [1mfromHoriz[0m
resources to place the children of the Form. A single pass
is made through the Form widget's children in the order that
they were created. Each child is then placed in the Form
widget below or to the right of the widget specified by the
[1mfromVert [22mand [1mfromHoriz [22mresources. The distance the new
child is placed from its left or upper neighbor is deter-
mined by the [1mhorizDistance [22mand [1mvertDistance [22mresources. This
implies some things about how the order of creation affects
the possible placement of the children. The Form widget
registers a string to widget converter which does not post-
pone conversion and does not cache conversion results.
The second layout method is used when the Form is resized.
[1m179[0m
[1mAthena Widget Set libXaw 1.0.7[0m
It does not matter what causes this resize, and it is possi-
ble for a resize to happen before the widget becomes visible
(due to constraints imposed by the parent of the Form).
This layout method uses the [1mbottom[22m, [1mtop[22m, [1mleft[22m, and [1mright[0m
resources. These resources are used to determine what will
happen to each edge of the child when the Form is resized.
If a value of [1mXawChain[4m[22m[24m is specified, the the edge
of the child will remain a fixed distance from the [4mchain[0m
edge of the Form. For example if [1mXawChainLeft [22mis specified
for the [1mright [22mresource of a child then the right edge of
that child will remain a fixed distance from the left edge
of the Form widget. If a value of [1mXawRubber [22mis specified,
that edge will grow by the same percentage that the Form
grew. For instance if the Form grows by 50% the left edge
of the child (if specified as [1mXawRubber [22mwill be 50% farther
from the left edge of the Form). One must be very careful
when specifying these resources, for when they are specified
incorrectly children may overlap or completely occlude other
children when the Form widget is resized.
------------------------------------------------------------------------------------
[4mEdge[24m [4mType[24m [4mResource[24m [4mName[24m [4mDescription[0m
------------------------------------------------------------------------------------
XawChainBottom ChainBottom Edge remains a fixed distance from bottom of Form
XawChainLeft ChainLeft Edge remains a fixed distance from left of Form
XawChainRight ChainRight Edge remains a fixed distance from right of Form
XawChainTop ChainTop Edge remains a fixed distance from top of Form
XawRubber Rubber Edges will move a proportional distance
------------------------------------------------------------------------------------
[4m6.3.3.1.[24m [4mExample[0m
If you wish to force the Form to never resize one or more of
its children, then set [1mleft [22mand [1mright [22mto [1mXawChainLeft [22mand
[1mtop [22mand [1mbottom [22mto [1mXawChainTop[22m. This will cause the child to
remain a fixed distance from the top and left edges of the
Form, and never to resize.
[4m6.3.4.[24m [4mConvenience[24m [4mRoutines[0m
To force or defer a re-layout of the Form, use [4mXawFormDoLay-[0m
[4mout[24m.
void XawFormDoLayout([4mw[24m, [4mdo_layout[24m)
Widget [4mw[24m;
Boolean [4mdo_layout[24m;
[4mw[24m Specifies the Form widget.
[4mdo_layout[24m Specifies whether the layout of the Form widget is
enabled ([1mTrue[22m) or disabled ([1mFalse[22m).
[1m180[0m
[1mAthena Widget Set libXaw 1.0.7[0m
When making several changes to the children of a Form widget
after the Form has been realized, it is a good idea to dis-
able relayout until after all changes have been made.
[4m6.4.[24m [4mPaned[24m [4mWidget[0m
Application Header file
Class Header file
Class panedWidgetClass
Class Name Paned
Superclass Constraint
The Paned widget manages children in a vertically or hori-
zontally tiled fashion. The panes may be dynamically
resized by the user by using the [4mgrips[24m that appear near the
right or bottom edge of the border between two panes.
The Paned widget may accept any widget class as a pane
[1mexcept [22mGrip. Grip widgets have a special meaning for the
Paned widget, and adding a Grip as its own pane will confuse
the Paned widget.
[4m6.4.1.[24m [4mUsing[24m [4mthe[24m [4mPaned[24m [4mWidget[0m
The grips allow the panes to be resized by the user. The
semantics of how these panes resize is somewhat complicated,
and warrants further explanation here. When the mouse
pointer is positioned on a grip and pressed, an arrow is
displayed that indicates the pane that is to be to be
resized. While keeping the mouse button down, the user can
move the grip up and down (or left and right). This, in
turn, changes the size of the pane. The size of the Paned
widget will not change. Instead, it chooses another pane
(or panes) to resize. For more details on which pane it
chooses to resize, see [1mLayout Semantics[22m.
One pointer binding allows the border between two panes to
be moved, without affecting any of the other panes. When
this occurs the pointer will change to an arrow that points
along the pane border.
The default bindings for the Paned widget's grips are:
-----------------------------------------------------------------------
[4mMouse[24m [4mbutton[24m [4mPane[24m [4mto[24m [4mResize[24m [4m-[24m [4mVertical[24m [4mPane[24m [4mto[24m [4mResize[24m [4m-[24m [4mHorizontal[0m
-----------------------------------------------------------------------
1 (left) above the grip left of the grip
2 (middle) adjust border adjust border
[1m181[0m
[1mAthena Widget Set libXaw 1.0.7[0m
-----------------------------------------------------------------------
[4mMouse[24m [4mbutton[24m [4mPane[24m [4mto[24m [4mResize[24m [4m-[24m [4mVertical[24m [4mPane[24m [4mto[24m [4mResize[24m [4m-[24m [4mHorizontal[0m
-----------------------------------------------------------------------
3 (right) below the grip right of the grip
-----------------------------------------------------------------------
[4m6.4.2.[24m [4mResources[0m
When creating a Paned widget instance, the following
resources are retrieved from the argument list or the
resource database:
------------------------------------------------------------------------------------
[4mName[24m [4mClass[24m [4mType[24m [4mNotesDefault[24m [4mValue[0m
------------------------------------------------------------------------------------
accelerators Accelerators AcceleratorTable NULL
ancestorSensitive AncestorSensitiveBoolean D True
background Background Pixel XtDefaultBackground
backgroundPixmap Pixmap Pixmap XtUnspecifiedPixmap
betweenCursor Cursor Cursor A Depends on orientation
borderColor BorderColor Pixel XtDefaultForeground
borderPixmap Pixmap Pixmap XtUnspecifiedPixmap
borderWidth BorderWidth Dimension 1
children ReadOnly WidgetList R NULL
colormap Colormap Colormap Parent's Colormap
cursor Cursor Cursor None
depth Depth int C Parent's Depth
destroyCallback Callback XtCallbackList NULL
gripCursor Cursor Cursor A Depends on orientation
gripIndent GripIndent Position 10
gripTranslations Translations TranslationTable see below
height Height Dimension A Depends on orientation
horizontalBetweenCursorCursor Cursor sb_up_arrow
horizontalGripCursor Cursor Cursor sb_h_double_arrow
internalBorderColor BorderColor Pixel XtDefaultForeground
internalBorderWidth BorderWidth Dimension 1
leftCursor Cursor Cursor sb_left_arrow
lowerCursor Cursor Cursor sb_down_arrow
mappedWhenManaged MappedWhenManagedBoolean True
numChildren ReadOnly Cardinal R 0
orientation Orientation Orientation XtorientVertical
refigureMode Boolean Boolean True
rightCursor Cursor Cursor sb_right_arrow
screen Screen Screen R Parent's Screen
sensitive Sensitive Boolean True
translations Translations TranslationTable NULL
upperCursor Cursor Cursor sb_up_arrow
verticalBetweenCursor Cursor Cursor sb_left_arrow
verticalGripCursor Cursor Cursor sb_v_double_arrow
width Width Dimension A Depends on orientation
x Paned Position 0
[1m182[0m
[1mAthena Widget Set libXaw 1.0.7[0m
------------------------------------------------------------------------------------
[4mName[24m [4mClass[24m [4mType[24m [4mNotesDefault[24m [4mValue[0m
------------------------------------------------------------------------------------
y Paned Position 0
------------------------------------------------------------------------------------
accelerators A list of event to action bindings to be exe-
cuted by this widget, even though the event
occurred in another widget. (See the [4mX[24m [4mTool-[0m
[4mkit[24m [4mIntrinsics[24m [4m--[24m [4mC[24m [4mLanguage[24m [4mInterface[24m for
details).
ancestorSensitive
The sensitivity state of the ancestors of
this widget. A widget is insensitive if
either it or any of its ancestors is insensi-
tive. This resource should not be changed
with [1mXtSetValues[22m, although it may be queried.
background A pixel value which indexes the widget's col-
ormap to derive the background color of the
widget's window.
backgroundPixmapThe background pixmap of this widget's win-
dow. If this resource is set to anything
other than [1mXtUnspecifiedPixmap[22m, the pixmap
specified will be used instead of the back-
ground color.
borderColor A pixel value which indexes the widget's col-
ormap to derive the border color of the wid-
get's window.
borderPixmap The border pixmap of this widget's window.
If this resource is set to anything other
than [1mXtUnspecifiedPixmap[22m, the pixmap speci-
fied will be used instead of the border
color.
borderWidth The width of this widget's window border.
children A list of all this composite widget's current
children.
colormap The colormap that this widget will use.
[1mcursor [22mThe cursor to use when the mouse pointer is
over the Paned widget, but not in any of its
children (children may also inherit this cur-
sor). It should be noted that the internal
borders are actually part of the Paned wid-
get, not the children.
[1m183[0m
[1mAthena Widget Set libXaw 1.0.7[0m
depth The depth of this widget's window.
destroyCallbackAll functions on this list are called when
this widget is destroyed.
[1mgripCursor [22mThe cursor to use when the grips are not
active. The default value is [1mvertical-[0m
[1mGripCursor [22mor [1mhorizontalGripCursor [22mdepending
on the orientation of the Paned widget.
[1mgripIndent [22mThe amount of space left between the right
(or bottom) edge of the Paned widget and all
the grips.
[1mgripTranslation[22mTranslation table that will be applied to all
grips.
height
width The height and width of this widget in pix-
els.
[1mhorizontalBetweenCursor[0m
[1mverticalBetweenCursor[0m
The cursor to be used for the grip when
changing the boundary between two panes.
These resources allow the cursors to be dif-
ferent depending on the orientation of the
Paned widget.
[1mhorizontalGripCursor[0m
[1mverticalGripCursor[0m
The cursor to be used for the grips when they
are not active. These resources allow the
cursors to be different depending on the ori-
entation of the Paned widget.
[1minternalBorderColor[0m
A pixel value which indexes the widget's col-
ormap to derive the internal border color of
the widget's window. The class name of this
resource allows [4mPaned*BorderColor:[24m [4mblue[24m to
set the internal border color for the Paned
widget. An optimization is invoked if [1minter-[0m
[1mnalBorderColor [22mand [1mbackground [22mare the same,
and the internal borders are not drawn.
[1minternalBorderWidth [22mis still left between the
panes, however.
[1minternalBorderWidth[0m
The width of the internal borders. This is
the amount of space left between the panes.
The class name of this resource allows
[4mPaned*BorderWidth:[24m [4m3[24m to set the internal bor-
der width for the Paned widget.
[1m184[0m
[1mAthena Widget Set libXaw 1.0.7[0m
[1mleftCursor[0m
[1mrightCursor [22mThe cursor used to indicate which is the
[4mimportant[24m pane to resize when the Paned wid-
get is oriented horizontally.
[1mlowerCursor[0m
[1mupperCursor [22mThe cursor used to indicate which is the
[4mimportant[24m pane to resize when the Paned wid-
get is oriented vertically.
mappedWhenManaged
If this resource is [1mTrue[22m, then the widget's
window will automatically be mapped by the
Toolkit when it is realized and managed.
numChildren The number of children in this composite wid-
get. This is not the same as the number of
panes, since this also contains a grip for
some of the panes, use [1mXawPanedGetNumSub [22mto
retrieve the number of panes.
[1morientation [22mThe orientation to stack the panes. This
value can be either [1mXtorientVertical [22mor [1mXto-[0m
[1mrientHorizontal[22m. A converter is registered
for this resource that will convert the fol-
lowing strings: [1mvertical [22mand [1mhorizontal[22m.
[1mrefigureMode [22mThis resource allows pane layout to be sus-
pended. If this value is [1mFalse[22m, then no lay-
out actions will be taken. This may improve
efficiency when adding or removing more than
one pane from the Paned widget.
screen The screen on which this widget is displayed.
This is not a settable resource.
sensitive Whether or not the toolkit should pass user
events to this widget. The widget will not
get input events if either [1mancestorSensitive[0m
or [1msensitive [22mis [1mFalse[22m.
translations The event bindings associated with this wid-
get.
x
y The location of the upper left outside corner
of this widget in its parent.
[4m6.4.3.[24m [4mConstraint[24m [4mResources[0m
Each child of the Paned widget may request special layout
resources be applied to it. These [4mconstraint[24m resources
allow the Paned widget's children to specify individual lay-
out requirements.
[1m185[0m
[1mAthena Widget Set libXaw 1.0.7[0m
----------------------------------------------------------------------------------
[4mName[24m [4mClass[24m [4mType[24m [4mNotes[24m [4mDefault[24m [4mValue[0m
----------------------------------------------------------------------------------
allowResize Boolean Boolean False
max Max Dimension Infinity
min Min Dimension Height of Grips
preferredPaneSize PreferredPaneSize Dimension ask child
resizeToPreferred Boolean Boolean False
showGrip ShowGrip Boolean True
skipAdjust Boolean Boolean False
----------------------------------------------------------------------------------
[1mallowResize [22mIf this value is [1mFalse [22mthe the Paned widget
will disallow all geometry requests from this
child.
[1mmax[0m
[1mmin [22mThe absolute maximum or minimum size for this
pane. These values will never be overridden
by the Paned widget. This may cause some
panes to be pushed off the bottom (or right)
edge of the paned widget.
[1mpreferredPaneSize[0m
Normally the paned widget makes a QueryGeome-
try call on a child to determine the pre-
ferred size of the child's pane. There are
times when the application programmer or the
user has a better idea of the preferred size
of a pane. Setting this resource causes the
value passed to be interpreted as the pre-
ferred size, in pixels, of this pane.
[1mresizeToPreferred[0m
Determines whether or not to resize each pane
to its preferred size when the Paned widget
is resized. See [1mLayout Semantics [22mfor
details.
[1mshowGrip [22mIf [1mTrue [22mthen a grip will be shown for this
pane. The grip associated with a pane is
either below or to the right of the pane. No
grip is ever shown for the last pane.
[1mskipAdjust [22mThis resource is used to determine which pane
is forced to be resized. Setting this value
to [1mTrue [22mmakes this pane less likely to be
forced to be resized. See [1mLayout Semantics[0m
for details.
[4m6.4.4.[24m [4mLayout[24m [4mSemantics[0m
In order to make effective use of the Paned widget it is
[1m186[0m
[1mAthena Widget Set libXaw 1.0.7[0m
helpful to know the rules it uses to determine which child
will be resized in any given situation. There are three
rules used to determine which child is resized. While these
rules are always the same, the panes that are searched can
change depending upon what caused the relayout.
[1mLayout Rules[0m
[1m1 [22mDo not let a pane grow larger than its [1mmax [22mor smaller
than its [1mmin[22m.
[1m2 [22mDo not adjust panes with [1mskipAdjust [22mset.
[1m3 [22mDo not adjust panes away from their preferred size,
although moving one closer to its preferred size is
fine.
When searching the children the Paned widget looks for panes
that satisfy all the rules, and if unsuccessful then it
eliminates rule 3 and then 2. Rule 1 is always enforced.
If the relayout is due to a resize or change in management
then the panes are searched from bottom to top. If the
relayout is due to grip movement then they are searched from
the grip selected in the direction opposite the pane
selected.
[4m6.4.4.1.[24m [4mResizing[24m [4mPanes[24m [4mfrom[24m [4ma[24m [4mGrip[24m [4mAction[0m
The pane above the grip is resized by invoking the Gri-
pAction with [1mUpLeftPane [22mspecified. The panes below the grip
are each checked against all rules, then rules 2 and 1 and
finally against rule 1 only. No pane above the chosen pane
will ever be resized.
The pane below the grip is resized by invoking the Gri-
pAction with [1mLowRightPane [22mspecified. The panes above the
grip are each checked in this case. No pane below the cho-
sen pane will ever be resized.
Invoking GripAction with [1mThisBorderOnly [22mspecified just moves
the border between the panes. No other panes are ever
resized.
[4m6.4.4.2.[24m [4mResizing[24m [4mPanes[24m [4mafter[24m [4mthe[24m [4mPaned[24m [4mwidget[24m [4mis[24m [4mresized.[0m
When the Pane widget is resized it must determine a new size
for each pane. There are two methods of doing this. The
Paned widget can either give each pane its preferred size
and then resize the panes to fit, or it can use the current
sizes and then resize the panes to fit. The [1mresizeToPre-[0m
[1mferred [22mresource allows the application to tell the Paned
widget whether to query the child about its preferred size
[1m187[0m
[1mAthena Widget Set libXaw 1.0.7[0m
(subject to the the [1mpreferredPaneSize[22m) or to use the current
size when refiguring the pane locations after the pane has
been resized.
There is one special case. All panes assume they should
resize to their preferred size until the Paned widget
becomes visible to the user.
[4m6.4.4.3.[24m [4mManaging[24m [4mChildren[24m [4mand[24m [4mGeometry[24m [4mManagement[0m
The Paned widget always resizes its children to their pre-
ferred sizes when a new child is managed, or a geometry man-
agement request is honored. The Paned widget will first
attempt to resize itself to contain its panes exactly. If
this is not possible then it will hunt through the children,
from bottom to top (right to left), for a pane to resize.
[4m6.4.4.4.[24m [4mSpecial[24m [4mConsiderations[0m
When a user resizes a pane with the grips, the Paned widget
assumes that this new size is the preferred size of the
pane.
[4m6.4.5.[24m [4mGrip[24m [4mTranslations[0m
The Paned widget has no action routines of its own, as all
actions are handled through the grips. The grips are each
assigned a default Translation table.
: GripAction(Start, UpLeftPane)
: GripAction(Start, ThisBorderOnly)
: GripAction(Start, LowRightPane)
: GripAction(Move, UpLeftPane)
: GripAction(Move, ThisBorderOnly)
: GripAction(Move, LowRightPane)
Any: GripAction(Commit)
The Paned widget interprets the [1mGripAction [22mas taking two
arguments. The first argument may be any of the following:
[1mStart [22mSets up the Paned widget for resizing and changes
the cursor of the grip. The second argument
determines which pane will be resized, and can
take on any of the three values shown above.
[1mMove [22mThe internal borders are drawn over the current
pane locations to animate where the borders would
actually be placed if you were to move this border
as shown. The second argument must match the sec-
ond argument that was passed to the [1mStart [22maction,
[1m188[0m
[1mAthena Widget Set libXaw 1.0.7[0m
that began this process. If these arguments are
not passed, the behavior is undefined.
[1mCommit [22mThis argument causes the Paned widget to commit
the changes selected by the previously started
action. The cursor is changed back to the grip's
inactive cursor. No second argument is needed in
this case.
[4m6.4.6.[24m [4mConvenience[24m [4mRoutines[0m
To enable or disable a child's request for pane resizing,
use [4mXawPanedAllowResize[24m:
void XawPanedAllowResize([4mw[24m, [4mallow_resize[24m)
Widget [4mw[24m;
Boolean [4mallow_resize[24m;
[4mw[24m Specifies the child pane.
[4mallow_resize[0m
Specifies whether or not resizing requests for
this child will be granted by the Paned widget.
If allow_resize is [1mTrue[22m, the Paned widget allows geometry
requests from the child to change the pane's height. If
allow_resize is [1mFalse[22m, the Paned widget ignores geometry
requests from the child to change the pane's height. The
default state is [1mTrue [22mbefore the Pane is realized and [1mFalse[0m
after it is realized. This procedure is equivalent to
changing the [1mallowResize [22mconstraint resource for the child.
To change the minimum and maximum height settings for a
pane, use [4mXawPanedSetMinMax[24m:
void XawPanedSetMinMax([4mw[24m, [4mmin[24m, [4mmax[24m)
Widget [4mw[24m;
int [4mmin[24m, [4mmax[24m;
[4mw[24m Specifies the child pane.
[4mmin[24m Specifies the new minimum height of the child,
expressed in pixels.
[4mmax[24m Specifies new maximum height of the child,
expressed in pixels.
This procedure is equivalent to setting the [1mmin [22mand [1mmax [22mcon-
straint resources for the child.
[1m189[0m
[1mAthena Widget Set libXaw 1.0.7[0m
To retrieve the minimum and maximum height settings for a
pane, use [4mXawPanedGetMinMax[24m:
void XawPanedGetMinMax([4mw[24m, [4mmin_return[24m, [4mmax_return[24m)
Widget [4mw[24m;
int [4m*min_return[24m, [4m*max_return[24m;
[4mw[24m Specifies the child pane.
[4mmin_return[24mReturns the minimum height of the child, expressed
in pixels.
[4mmax_return[24mReturns the maximum height of the child, expressed
in pixels.
This procedure is equivalent to getting the [1mmin [22mand [1mmax[0m
resources for this child child.
To enable or disable automatic recalculation of pane sizes
and positions, use [4mXawPanedSetRefigureMode[24m:
void XawPanedSetRefigureMode([4mw[24m, [4mmode[24m)
Widget [4mw[24m;
Boolean [4mmode[24m;
[4mw[24m Specifies the Paned widget.
[4mmode[24m Specifies whether the layout of the Paned widget
is enabled ([1mTrue[22m) or disabled ([1mFalse[22m).
When making several changes to the children of a Paned wid-
get after the Paned has been realized, it is a good idea to
disable relayout until after all changes have been made.
To retrieve the number of panes in a paned widget use [1mXaw-[0m
[1mPanedGetNumSub[22m:
int XawPanedGetNumSub([4mw[24m)
Widget [4mw[24m;
[4mw[24m Specifies the Paned widget.
This function returns the number of panes in the Paned wid-
get. This is [1mnot [22mthe same as the number of children, since
the grips are also children of the Paned widget.
[4m6.5.[24m [4mPorthole[24m [4mWidget[0m
[1m190[0m
[1mAthena Widget Set libXaw 1.0.7[0m
Application Header file
Class Header file
Class portholeWidgetClass
Class Name Porthole
Superclass Composite
The Porthole widget provides geometry management of a list
of arbitrary widgets, only one of which may be managed at
any particular time. The managed child widget is reparented
within the porthole and is moved around by the application
(typically under the control of a Panner widget).
[4m6.5.1.[24m [4mResources[0m
When creating a Porthole widget instance, the following
resources are retrieved from the argument list or from the
resource database:
----------------------------------------------------------------------------
[4mName[24m [4mClass[24m [4mType[24m [4mNotesDefault[24m [4mValue[0m
----------------------------------------------------------------------------
accelerators Accelerators AcceleratorTable NULL
ancestorSensitiveAncestorSensitiveBoolean D True
background Background Pixel XtDefaultBackground
backgroundPixmap Pixmap Pixmap XtUnspecifiedPixmap
borderColor BorderColor Pixel XtDefaultForeground
borderPixmap Pixmap Pixmap XtUnspecifiedPixmap
borderWidth BorderWidth Dimension 1
children ReadOnly WidgetList R NULL
colormap Colormap Colormap Parent's Colormap
depth Depth int C Parent's Depth
destroyCallback Callback XtCallbackList NULL
height Height Dimension A see [1mLayout Semantics[0m
mappedWhenManagedMappedWhenManagedBoolean True
numChildren ReadOnly Cardinal R 0
reportCallback ReportCallback Callback NULL
screen Screen Screen R Parent's Screen
sensitive Sensitive Boolean True
translations Translations TranslationTable NULL
width Width Dimension A see [1mLayout Semantics[0m
x Position Position 0
y Position Position 0
----------------------------------------------------------------------------
accelerators A list of event to action bindings to be exe-
cuted by this widget, even though the event
occurred in another widget. (See the [4mX[24m [4mTool-[0m
[4mkit[24m [4mIntrinsics[24m [4m--[24m [4mC[24m [4mLanguage[24m [4mInterface[24m for
details).
[1m191[0m
[1mAthena Widget Set libXaw 1.0.7[0m
ancestorSensitive
The sensitivity state of the ancestors of
this widget. A widget is insensitive if
either it or any of its ancestors is insensi-
tive. This resource should not be changed
with [1mXtSetValues[22m, although it may be queried.
background A pixel value which indexes the widget's col-
ormap to derive the background color of the
widget's window.
backgroundPixmapThe background pixmap of this widget's win-
dow. If this resource is set to anything
other than [1mXtUnspecifiedPixmap[22m, the pixmap
specified will be used instead of the back-
ground color.
borderColor A pixel value which indexes the widget's col-
ormap to derive the border color of the wid-
get's window.
borderPixmap The border pixmap of this widget's window.
If this resource is set to anything other
than [1mXtUnspecifiedPixmap[22m, the pixmap speci-
fied will be used instead of the border
color.
borderWidth The width of this widget's window border.
children A list of all this composite widget's current
children.
colormap The colormap that this widget will use.
depth The depth of this widget's window.
destroyCallbackAll functions on this list are called when
this widget is destroyed.
height
width The height and width of this widget in pix-
els.
mappedWhenManaged
If this resource is [1mTrue[22m, then the widget's
window will automatically be mapped by the
Toolkit when it is realized and managed.
numChildren The number of children in this composite wid-
get.
[1mreportCallback [22mA list of functions to invoke whenever the
managed child widget changes size or posi-
tion.
[1m192[0m
[1mAthena Widget Set libXaw 1.0.7[0m
screen The screen on which this widget is displayed.
This is not a settable resource.
sensitive Whether or not the toolkit should pass user
events to this widget. The widget will not
get input events if either [1mancestorSensitive[0m
or [1msensitive [22mis [1mFalse[22m.
translations The event bindings associated with this wid-
get.
x
y The location of the upper left outside corner
of this widget in its parent.
[4m6.5.2.[24m [4mLayout[24m [4mSemantics[0m
The Porthole widget allows its managed child to request any
size that is as large or larger than the Porthole itself and
any location so long as the child still obscures all of the
Porthole. This widget typically is used with a Panner wid-
get.
[4m6.5.3.[24m [4mPorthole[24m [4mCallbacks[0m
The functions registered on the [1mreportCallback [22mlist are
invoked whenever the managed child changes size or position:
void ReportProc([4mporthole[24m, [4mclient_data[24m, [4mreport[24m)
Widget [4mporthole[24m;
XtPointer [4mclient_data[24m;
XtPointer [4mreport[24m; /* (XawPannerReport *) */
[4mporthole[24m Specifies the Porthole widget.
[4mclient_data[24mSpecifies the client data.
[4mreport[24m Specifies a pointer to an [1mXawPannerReport [22mstruc-
ture containing the location and size of the
slider and the size of the canvas.
[4m6.6.[24m [4mTree[24m [4mWidget[0m
Application Header file
Class Header file
Class treeWidgetClass
Class Name Tree
Superclass Constraint
[1m193[0m
[1mAthena Widget Set libXaw 1.0.7[0m
The Tree widget provides geometry management of arbitrary
widgets arranged in a directed, acyclic graph (i.e., a
tree). The hierarchy is constructed by attaching a con-
straint resource called [1mtreeParent [22mto each widget indicating
which other node in the tree should be treated as the wid-
get's superior. The structure of the tree is shown by lay-
ing out the nodes in the standard format for tree diagrams
with lines drawn connecting each node with its children.
The Tree sizes itself according to the needs of its children
and is not intended to be resized by its parent. Instead,
it should be placed inside another composite widget (such as
the [1mPorthole [22mor [1mViewport[22m) that can be used to scroll around
in the tree.
[4m6.6.1.[24m [4mResources[0m
When creating a Tree widget instance, the following
resources are retrieved from the argument list or from the
resource database:
----------------------------------------------------------------------------
[4mName[24m [4mClass[24m [4mType[24m [4mNotesDefault[24m [4mValue[0m
----------------------------------------------------------------------------
accelerators Accelerators AcceleratorTable NULL
ancestorSensitiveAncestorSensitiveBoolean D True
autoReconfigure AutoReconfigure Boolean False
background Background Pixel XtDefaultBackground
backgroundPixmap Pixmap Pixmap XtUnspecifiedPixmap
borderColor BorderColor Pixel XtDefaultForeground
borderPixmap Pixmap Pixmap XtUnspecifiedPixmap
borderWidth BorderWidth Dimension 1
children ReadOnly WidgetList R NULL
colormap Colormap Colormap Parent's Colormap
depth Depth int C Parent's Depth
destroyCallback Callback XtCallbackList NULL
foreground Foreground Pixel XtDefaultForeground
gravity Gravity XtGravity WestGravity
height Height Dimension A see [1mLayout Semantics[0m
hSpace HSpace Dimension 4
lineWidth LineWidth Dimension 0
mappedWhenManagedMappedWhenManagedBoolean True
numChildren ReadOnly Cardinal R 0
screen Screen Screen R Parent's Screen
sensitive Sensitive Boolean True
vSpace VSpace Dimension 4
translations Translations TranslationTable NULL
width Width Dimension A see [1mLayout Semantics[0m
x Position Position 0
y Position Position 0
----------------------------------------------------------------------------
[1m194[0m
[1mAthena Widget Set libXaw 1.0.7[0m
[1mautoReconfigure[22mWhether or not to layout the tree every time
a node is added or removed.
background A pixel value which indexes the widget's col-
ormap to derive the background color of the
widget's window.
backgroundPixmapThe background pixmap of this widget's win-
dow. If this resource is set to anything
other than [1mXtUnspecifiedPixmap[22m, the pixmap
specified will be used instead of the back-
ground color.
borderColor A pixel value which indexes the widget's col-
ormap to derive the border color of the wid-
get's window.
borderPixmap The border pixmap of this widget's window.
If this resource is set to anything other
than [1mXtUnspecifiedPixmap[22m, the pixmap speci-
fied will be used instead of the border
color.
borderWidth The width of this widget's window border.
children A list of all this composite widget's current
children.
colormap The colormap that this widget will use.
depth The depth of this widget's window.
destroyCallbackAll functions on this list are called when
this widget is destroyed.
foreground A pixel value which indexes the widget's col-
ormap to derive the foreground color of the
widget's window. This color is also used to
render all 1's in a [1mbitmap [22mone plane deep.
[1mgravity [22mSpecifies the side of the widget from which
the tree should grow. Valid values include
[1mWestGravity[22m, [1mNorthGravity[22m, [1mEastGravity[22m, and
[1mSouthGravity[22m. A converter is registered for
this resource that will convert the following
strings: the legal values.
height
width The height and width of this widget in pix-
els.
[1mhSpace[0m
[1mvSpace [22mThe amount of space, in pixels, to leave
between the children. This resource
[1m195[0m
[1mAthena Widget Set libXaw 1.0.7[0m
specifies the amount of space left between
the outermost children and the edge of the
box.
[1mlineWidth [22mThe width of the lines from nodes that do not
have a [1mtreeGC [22mconstraint resource to their
children.
mappedWhenManaged
If this resource is [1mTrue[22m, then the widget's
window will automatically be mapped by the
Toolkit when it is realized and managed.
numChildren The number of children in this composite wid-
get.
screen The screen on which this widget is displayed.
This is not a settable resource.
sensitive Whether or not the toolkit should pass user
events to this widget. The widget will not
get input events if either [1mancestorSensitive[0m
or [1msensitive [22mis [1mFalse[22m.
translations The event bindings associated with this wid-
get.
x
y The location of the upper left outside corner
of this widget in its parent.
[4m6.6.2.[24m [4mConstraint[24m [4mResources[0m
Each child of the Tree widget must specify its superior node
in the tree. In addition, it may specify a GC to use when
drawing a line between it and its inferior nodes.
--------------------------------------------------------------------
[4mName[24m [4mClass[24m [4mType[24m [4mNotes[24m [4mDefault[24m [4mValue[0m
--------------------------------------------------------------------
treeGC TreeGC GC NULL
treeParent TreeParent Widget NULL
--------------------------------------------------------------------
[1mtreeGC [22mThis specifies the GC to use when drawing
lines between this widget and its inferiors
in the tree. If this resource is not speci-
fied, the Tree's [1mforeground [22mand [1mlineWidth[0m
will be used.
[1mtreeParent [22mThis specifies the superior node in the tree
for this widget. The default is for the node
to have no superior (and to therefore be at
[1m196[0m
[1mAthena Widget Set libXaw 1.0.7[0m
the top of the tree).
[4m6.6.3.[24m [4mLayout[24m [4mSemantics[0m
Each time a child is managed or unmanaged, the Tree widget
will attempt to reposition the remaining children to fix the
shape of the tree if the [4mautoReconfigure[24m resource is set.
Children at the top (most superior) of the tree are drawn at
the side specified by the [4mgravity[24m resource.
After positioning all children, the Tree widget attempts to
shrink its own size to the minimum dimensions required for
the layout.
[4m6.6.4.[24m [4mConvenience[24m [4mRoutines[0m
The most efficient way to layout a tree is to set [4mautoRecon-[0m
[4mfigure[24m to False and then use the [4mXawTreeForceLayout[24m routine
to arrange the children.
void XawTreeForceLayout([4mw[24m)
Widget [4mw[24m;
[4mw[24m Specifies the Tree widget.
[4m6.7.[24m [4mViewport[24m [4mWidget[0m
Application Header file
Class Header file
Class viewportWidgetClass
Class Name Viewport
Superclass Form
The Viewport widget consists of a frame window, one or two
Scrollbars, and an inner window. The size of the frame win-
dow is determined by the viewing size of the data that is to
be displayed and the dimensions to which the Viewport is
created. The inner window is the full size of the data that
is to be displayed and is clipped by the frame window. The
Viewport widget controls the scrolling of the data directly.
No application callbacks are required for scrolling.
When the geometry of the frame window is equal in size to
the inner window, or when the data does not require
scrolling, the Viewport widget automatically removes any
scrollbars. The [1mforceBars [22moption causes the Viewport widget
to display all scrollbars permanently.
[1m197[0m
[1mAthena Widget Set libXaw 1.0.7[0m
[4m6.7.1.[24m [4mResources[0m
When creating a Viewport widget instance, the following
resources are retrieved from the argument list or the
resource database:
----------------------------------------------------------------------------
[4mName[24m [4mClass[24m [4mType[24m [4mNotesDefault[24m [4mValue[0m
----------------------------------------------------------------------------
accelerators Accelerators AcceleratorTable NULL
allowHoriz Boolean Boolean False
allowVert Boolean Boolean False
ancestorSensitiveAncestorSensitiveBoolean D True
background Background Pixel XtDefaultBackground
backgroundPixmap Pixmap Pixmap XtUnspecifiedPixmap
borderColor BorderColor Pixel XtDefaultForeground
borderPixmap Pixmap Pixmap XtUnspecifiedPixmap
borderWidth BorderWidth Dimension 1
children ReadOnly WidgetList R NULL
colormap Colormap Colormap Parent's Colormap
depth Depth int C Parent's Depth
destroyCallback Callback XtCallbackList NULL
forceBars Boolean Boolean False
height Height Dimension height of the child
mappedWhenManagedMappedWhenManagedBoolean True
numChildren ReadOnly Cardinal R 0
reportCallback ReportCallback XtCallbackList NULL
screen Screen Screen R Parent's Screen
sensitive Sensitive Boolean True
translations Translations TranslationTable NULL
useBottom Boolean Boolean False
useRight Boolean Boolean False
width Width Dimension width of the child
x Position Position 0
y Position Position 0
----------------------------------------------------------------------------
accelerators A list of event to action bindings to be exe-
cuted by this widget, even though the event
occurred in another widget. (See the [4mX[24m [4mTool-[0m
[4mkit[24m [4mIntrinsics[24m [4m--[24m [4mC[24m [4mLanguage[24m [4mInterface[24m for
details).
[1mallowHoriz[0m
[1mallowVert [22mIf these resources are [1mFalse [22mthen the View-
port will never create a scrollbar in this
direction. If it is [1mTrue [22mthen the scrollbar
will only appear when it is needed, unless
[1mforceBars [22mis [1mTrue[22m.
ancestorSensitive
The sensitivity state of the ancestors of
[1m198[0m
[1mAthena Widget Set libXaw 1.0.7[0m
this widget. A widget is insensitive if
either it or any of its ancestors is insensi-
tive. This resource should not be changed
with [1mXtSetValues[22m, although it may be queried.
background A pixel value which indexes the widget's col-
ormap to derive the background color of the
widget's window.
backgroundPixmapThe background pixmap of this widget's win-
dow. If this resource is set to anything
other than [1mXtUnspecifiedPixmap[22m, the pixmap
specified will be used instead of the back-
ground color.
borderColor A pixel value which indexes the widget's col-
ormap to derive the border color of the wid-
get's window.
borderPixmap The border pixmap of this widget's window.
If this resource is set to anything other
than [1mXtUnspecifiedPixmap[22m, the pixmap speci-
fied will be used instead of the border
color.
borderWidth The width of this widget's window border.
children A list of all this composite widget's current
children.
colormap The colormap that this widget will use.
depth The depth of this widget's window.
destroyCallbackAll functions on this list are called when
this widget is destroyed.
[1mforceBars [22mWhen [1mTrue [22mthe scrollbars that have been
[4mallowed[24m will always be visible on the screen.
If [1mFalse [22mthe scrollbars will be visible only
when the inner window is larger than the
frame.
height
width The height and width of this widget in pix-
els.
mappedWhenManaged
If this resource is [1mTrue[22m, then the widget's
window will automatically be mapped by the
Toolkit when it is realized and managed.
numChildren The number of children in this composite wid-
get.
[1m199[0m
[1mAthena Widget Set libXaw 1.0.7[0m
[1mreportCallback [22mThese callbacks will be executed whenever the
Viewport adjusts the viewed area of the
child. The call_data parameter is a pointer
to an XawPannerReport structure.
screen The screen on which this widget is displayed.
This is not a settable resource.
sensitive Whether or not the toolkit should pass user
events to this widget. The widget will not
get input events if either [1mancestorSensitive[0m
or [1msensitive [22mis [1mFalse[22m.
translations The event bindings associated with this wid-
get.
[1museBottom[0m
[1museRight [22mBy default the scrollbars appear on the left
and top of the screen. These resources allow
the vertical scrollbar to be placed on the
right edge of the Viewport, and the horizon-
tal scrollbar on the bottom edge of the View-
port.
x
y The location of the upper left outside corner
of this widget in its parent.
[4m6.7.2.[24m [4mLayout[24m [4mSemantics[0m
The Viewport widget manages a single child widget. When the
size of the child is larger than the size of the Viewport,
the user can interactively move the child within the View-
port by repositioning the scrollbars.
The default size of the Viewport before it is realized is
the width and/or height of the child. After it is realized,
the Viewport will allow its child to grow vertically or hor-
izontally if [1mallowVert [22mor [1mallowHoriz [22mare set, respectively.
If the corresponding vertical or horizontal scrollbar is not
enabled, the Viewport will propagate the geometry request to
its own parent and the child will be allowed to change size
only if the Viewport's parent allows it. Regardless of
whether or not scrollbars are enabled in the corresponding
direction, if the child requests a new size smaller than the
Viewport size, the change will be allowed only if the parent
of the Viewport allows the Viewport to shrink to the appro-
priate dimension.
The scrollbar children of the Viewport are named [1mhorizontal[0m
and [1mvertical[22m. By using these names the programmer can spec-
ify resources for the individual scrollbars. [1mXtSetValues[0m
can be used to modify the resources dynamically once the
widget ID has been obtained with [1mXtNameToWidget[22m.
[1m200[0m
[1mAthena Widget Set libXaw 1.0.7[0m
Note
Although the Viewport is a Subclass of the Form,
no resources for the Form may be supplied for any
of the children of the Viewport. These con-
straints are managed internally and are not meant
for public consumption.
[1m201[0m
[1mAthena Widget Set libXaw 1.0.7[0m
[1mChapter 7[0m
[1mCreating New Widgets (Subclassing)[0m
Written By: Ralph Swick
Although the task of creating a new widget may at first
appear a little daunting, there is a basic simple pattern
that all widgets follow. The Athena Widget library contains
a special widget called the [4mTemplate[24m widget that is intended
to assist the novice widget programmer in writing a custom
widget.
Reasons for wishing to write a custom widget include:
+o Providing a graphical interface not currently supported
by any existing widget set.
+o Convenient access to resource management procedures to
obtain fonts, colors, etc., even if user customization is
not desired.
+o Convenient access to user input dispatch and translation
management procedures.
+o Access to callback mechanism for building higher-level
application libraries.
+o Customizing the interface or behavior of an existing wid-
get to suit a special application need.
+o Desire to allow user customization of resources such as
fonts, colors, etc., or to allow convenient re-binding of
keys and buttons to internal functions.
+o Converting a non-Toolkit application to use the Toolkit.
In each of these cases, the operation needed to create a new
widget is to "subclass" an existing one. If the desired
semantics of the new widget are similar to an existing one,
then the implementation of the existing widget should be
examined to see how much work would be required to create a
subclass that will then be able to share the existing class
methods. Much time will be saved in writing the new widget
if an existing widget class Expose, Resize and/or Geometry-
Manager method can be used by the subclass.
Note that some trivial uses of a ``bare-bones'' widget may
be achieved by simply creating an instance of the Core
[1m202[0m
[1mAthena Widget Set libXaw 1.0.7[0m
widget. The class variable to use when creating a Core wid-
get is [4mwidgetClass[24m. The geometry of the Core widget is
determined entirely by the parent widget.
It is very often the case than an application will have a
special need for a certain set of functions and that many
copies of these functions will be needed. For example, when
converting an older application to use the Toolkit, it may
be desirable to have a "Window Widget" class that might have
the following semantics:
+o Allocate 2 drawing colors in addition to a background
color.
+o Allocate a text font.
+o Execute an application-supplied function to handle expo-
sure events.
+o Execute an application-supplied function to handle user
input events.
It is obvious that a completely general-purpose WindowWid-
getClass could be constructed that would export all class
methods as callbacks lists, but such a widget would be very
large and would have to choose some arbitrary number of
resources such as colors to allocate. An application that
used many instances of the general-purpose widget would
therefore un-necessarily waste many resources.
In this section, an outline will be given of the procedure
to follow to construct a special-purpose widget to address
the items listed above. The reader should refer to the
appropriate sections of the [4mX[24m [4mToolkit[24m [4mIntrinsics[24m [4m--[24m [4mC[24m [4mLan-[0m
[4mguage[24m [4mInterface[24m for complete details of the material out-
lined here. Section 1.4 of the [4mIntrinsics[24m should be read in
conjunction with this section.
All Athena widgets have three separate files associated with
them:
+o A "public" header file containing declarations needed by
applications programmers
+o A "private" header file containing additional declara-
tions needed by the widget and any subclasses
+o A source code file containing the implementation of the
widget
This separation of functions into three files is suggested
for all widgets, but nothing in the Toolkit actually
[1m203[0m
[1mAthena Widget Set libXaw 1.0.7[0m
requires this format. In particular, a private widget cre-
ated for a single application may easily combine the "pub-
lic" and "private" header files into a single file, or merge
the contents into another application header file. Simi-
larly, the widget implementation can be merged into other
application code.
In the following example, the public header file
[4mX11/Xaw/Template.h[24m>, the private header file [4mX11/Xaw/Tem-[0m
[4mplateP.h[24m> and the source code file [4mX11/Xaw/Template.c[24m> will
be modified to produce the "WindowWidget" described above.
In each case, the files have been designed so that a global
string replacement of ``Template'' and ``template'' with the
name of your new widget, using the appropriate case, can be
done.
[4m7.1.[24m [4mPublic[24m [4mHeader[24m [4mFile[0m
The public header file contains declarations that will be
required by any application module that needs to refer to
the widget; whether to create an instance of the class, to
perform an [4mXtSetValues[24m operation, or to call a public rou-
tine implemented by the widget class.
The contents of the Template public header file,
[4mX11/Xaw/Template.h[24m>, are:
/* XConsortium: Template.h,v 1.2 88/10/25 17:22:09 swick Exp $ */
/* Copyright (c) X Consortium 1987, 1988 */
#ifndef _Template_h
#define _Template_h
/****************************************************************
*
* Template widget
*
****************************************************************/
/* Resources:
Name Class RepType Default Value
---- ----- --------------------
background Background PixelXtDefaultBackground
border BorderColor PixelXtDefaultForeground
borderWidth BorderWidth Dimension1
destroyCallback Callback PointerNULL
height Height Dimension0
mappedWhenManaged MappedWhenManagedBooleanTrue
sensitive Sensitive Boolean True
width Width Dimension0
x Position Position0
[1m204[0m
[1mAthena Widget Set libXaw 1.0.7[0m
y Position Position0
*/
/* define any special resource names here that are not in */
#define XtNtemplateResource "templateResource"
#define XtCTemplateResource "TemplateResource"
/* declare specific TemplateWidget class and instance datatypes */
typedef struct _TemplateClassRec* TemplateWidgetClass;
typedef struct _TemplateRec* TemplateWidget;
/* declare the class constant */
extern WidgetClass templateWidgetClass;
#endif /* _Template_h */
You will notice that most of this file is documentation.
The crucial parts are the last 8 lines where macros for any
private resource names and classes are defined and where the
widget class datatypes and class record pointer are
declared.
For the "WindowWidget", we want 2 drawing colors, a callback
list for user input and an [1mexposeCallback [22mcallback list, and
we will declare three convenience procedures, so we need to
add
/* Resources:
...
callback Callback Callback NULL
drawingColor1 Color PixelXtDefaultForeground
drawingColor2 Color PixelXtDefaultForeground
exposeCallback Callback CallbackNULL
font Font XFontStruct*XtDefaultFont
...
*/
#define XtNdrawingColor1 "drawingColor1"
#define XtNdrawingColor2 "drawingColor2"
#define XtNexposeCallback "exposeCallback"
extern Pixel WindowColor1(/* Widget */);
extern Pixel WindowColor2(/* Widget */);
extern Font WindowFont(/* Widget */);
[1m205[0m
[1mAthena Widget Set libXaw 1.0.7[0m
Note that we have chosen to call the input callback list by
the generic name, [1mcallback[22m, rather than a specific name. If
widgets that define a single user-input action all choose
the same resource name then there is greater possibility for
an application to switch between widgets of different types.
[4m7.2.[24m [4mPrivate[24m [4mHeader[24m [4mFile[0m
The private header file contains the complete declaration of
the class and instance structures for the widget and any
additional private data that will be required by anticipated
subclasses of the widget. Information in the private header
file is normally hidden from the application and is designed
to be accessed only through other public procedures; e.g.
[4mXtSetValues[24m.
The contents of the Template private header file,
[4mX11/Xaw/TemplateP.h[24m>, are:
/* XConsortium: TemplateP.h,v 1.2 88/10/25 17:31:47 swick Exp $ */
/* Copyright (c) X Consortium 1987, 1988
*/
#ifndef _TemplateP_h
#define _TemplateP_h
#include
/* include superclass private header file */
#include
/* define unique representation types not found in */
#define XtRTemplateResource "TemplateResource"
typedef struct {
int empty;
} TemplateClassPart;
typedef struct _TemplateClassRec {
CoreClassPart core_class;
TemplateClassPart template_class;
} TemplateClassRec;
extern TemplateClassRec templateClassRec;
typedef struct {
/* resources */
char* resource;
/* private state */
} TemplatePart;
typedef struct _TemplateRec {
[1m206[0m
[1mAthena Widget Set libXaw 1.0.7[0m
CorePart core;
TemplatePart template;
} TemplateRec;
#endif /* _TemplateP_h */
The private header file includes the private header file of
its superclass, thereby exposing the entire internal struc-
ture of the widget. It may not always be advantageous to do
this; your own project development style will dictate the
appropriate level of detail to expose in each module.
The "WindowWidget" needs to declare two fields in its
instance structure to hold the drawing colors, a resource
field for the font and a field for the expose and user input
callback lists:
typedef struct {
/* resources */
Pixel color_1;
Pixel color_2;
XFontStruct* font;
XtCallbackList expose_callback;
XtCallbackList input_callback;
/* private state */
/* (none) */
} WindowPart;
[4m7.3.[24m [4mWidget[24m [4mSource[24m [4mFile[0m
The source code file implements the widget class itself.
The unique part of this file is the declaration and initial-
ization of the widget class record structure and the decla-
ration of all resources and action routines added by the
widget class.
The contents of the Template implementation file,
[4mX11/Xaw/Template.c[24m>, are:
/* XConsortium: Template.c,v 1.2 88/10/25 17:40:25 swick Exp $ */
/* Copyright (c) X Consortium 1987, 1988
*/
#include
#include
#include "TemplateP.h"
static XtResource resources[] = {
[1m207[0m
[1mAthena Widget Set libXaw 1.0.7[0m
#define offset(field) XtOffsetOf(TemplateRec, template.field)
/* {name, class, type, size, offset, default_type, default_addr}, */
{ XtNtemplateResource, XtCTemplateResource, XtRTemplateResource,
sizeof(char*), offset(resource), XtRString, (XtPointer) "default" },
#undef offset
};
static void TemplateAction(/* Widget, XEvent*, String*, Cardinal* */);
static XtActionsRec actions[] =
{
/* {name, procedure}, */
{"template", TemplateAction},
};
static char translations[] =
" : template() \n\
";
TemplateClassRec templateClassRec = {
{ /* core fields */
/* superclass */ (WidgetClass) &widgetClassRec,
/* class_name */ "Template",
/* widget_size */ sizeof(TemplateRec),
/* class_initialize */ NULL,
/* class_part_initialize */ NULL,
/* class_inited */ FALSE,
/* initialize */ NULL,
/* initialize_hook */ NULL,
/* realize */ XtInheritRealize,
/* actions */ actions,
/* num_actions */ XtNumber(actions),
/* resources */ resources,
/* num_resources */ XtNumber(resources),
/* xrm_class */ NULLQUARK,
/* compress_motion */ TRUE,
/* compress_exposure */ TRUE,
/* compress_enterleave */ TRUE,
/* visible_interest */ FALSE,
/* destroy */ NULL,
/* resize */ NULL,
/* expose */ NULL,
/* set_values */ NULL,
/* set_values_hook */ NULL,
/* set_values_almost */ XtInheritSetValuesAlmost,
/* get_values_hook */ NULL,
/* accept_focus */ NULL,
/* version */ XtVersion,
/* callback_private */ NULL,
/* tm_table */ translations,
/* query_geometry */ XtInheritQueryGeometry,
/* display_accelerator */ XtInheritDisplayAccelerator,
/* extension */ NULL
},
[1m208[0m
[1mAthena Widget Set libXaw 1.0.7[0m
{ /* template fields */
/* empty */ 0
}
};
WidgetClass templateWidgetClass = (WidgetClass)&templateClassRec;
The resource list for the "WindowWidget" might look like the
following:
static XtResource resources[] = {
#define offset(field) XtOffsetOf(WindowWidgetRec, window.field)
/* {name, class, type, size, offset, default_type, default_addr}, */
{ XtNdrawingColor1, XtCColor, XtRPixel, sizeof(Pixel),
offset(color_1), XtRString, XtDefaultForeground },
{ XtNdrawingColor2, XtCColor, XtRPixel, sizeof(Pixel),
offset(color_2), XtRString, XtDefaultForeground },
{ XtNfont, XtCFont, XtRFontStruct, sizeof(XFontStruct*),
offset(font), XtRString, XtDefaultFont },
{ XtNexposeCallback, XtCCallback, XtRCallback, sizeof(XtCallbackList),
offset(expose_callback), XtRCallback, NULL },
{ XtNcallback, XtCCallback, XtRCallback, sizeof(XtCallbackList),
offset(input_callback), XtRCallback, NULL },
#undef offset
};
The user input callback will be implemented by an action
procedure which passes the event pointer as call_data. The
action procedure is declared as:
/* ARGSUSED */
static void InputAction(w, event, params, num_params)
Widget w;
XEvent *event;
String *params; /* unused */
Cardinal *num_params; /* unused */
{
XtCallCallbacks(w, XtNcallback, (XtPointer)event);
}
static XtActionsRec actions[] =
{
/* {name, procedure}, */
{"input", InputAction},
};
and the default input binding will be to execute the input
callbacks on [4mKeyPress[24m and [4mButtonPress[24m:
[1m209[0m
[1mAthena Widget Set libXaw 1.0.7[0m
static char translations[] =
" : input() \n\
: input() \
";
In the class record declaration and initialization, the only
field that is different from the Template is the expose pro-
cedure:
/* ARGSUSED */
static void Redisplay(w, event, region)
Widget w;
XEvent *event; /* unused */
Region region;
{
XtCallCallbacks(w, XtNexposeCallback, (XtPointer)region);
}
WindowClassRec windowClassRec = {
...
/* expose */ Redisplay,
The "WindowWidget" will also declare three public procedures
to return the drawing colors and the font id, saving the
application the effort of constructing an argument list for
a call to [4mXtGetValues[24m:
Pixel WindowColor1(w)
Widget w;
{
return ((WindowWidget)w)->window.color_1;
}
Pixel WindowColor2(w)
Widget w;
{
return ((WindowWidget)w)->window.color_2;
}
Font WindowFont(w)
Widget w;
{
return ((WindowWidget)w)->window.font->fid;
}
[1m210[0m
[1mAthena Widget Set libXaw 1.0.7[0m
The "WindowWidget" is now complete. The application can
retrieve the two drawing colors from the widget instance by
calling either [4mXtGetValues[24m, or the [1mWindowColor [22mfunctions.
The actual window created for the "WindowWidget" is avail-
able by calling the [4mXtWindow[24m function.
[1m211[0m
[1m212[0m
[1mTable of Contents[0m
Acknowledgments ....................................... v
Chapter 1 - Athena Widgets and The Intrinsics ......... 1
Introduction to the X Toolkit ................. 1
Terminology ................................... 2
Underlying Model .............................. 4
Input Focus ................................... 8
Chapter 2 - Using Widgets ............................. 9
Setting the Locale ............................ 9
Initializing the Toolkit ...................... 10
Creating a Widget ............................. 11
Common Resources .............................. 12
Resource Conversions .......................... 13
Realizing a Widget ............................ 14
Processing Events ............................. 15
Standard Widget Manipulation Functions ........ 15
Using the Client Callback Interface ........... 18
Programming Considerations .................... 20
Example Programs .............................. 26
Chapter 3 - Simple Widgets ............................ 27
Command Widget ................................ 28
Grip Widget ................................... 34
Label Widget .................................. 38
List Widget ................................... 43
Panner Widget ................................. 50
Repeater Widget ............................... 56
Scrollbar Widget .............................. 62
Simple Widget ................................. 70
StripChart Widget ............................. 73
Toggle Widget ................................. 77
Chapter 4 - Menus ..................................... 88
Using the Menus ............................... 89
SimpleMenu Widget ............................. 89
SmeBSB Object ................................. 96
SmeLine Object ................................ 99
Sme Object .................................... 100
MenuButton Widget ............................. 102
Chapter 5 - Text Widgets. ............................ 110
Text Widget for Users ......................... 110
Actions Supported by all Text Widgets ......... 115
Default Translation Bindings .................. 123
Text Functions ................................ 125
AsciiText Widget .............................. 131
AsciiSrc Object ............................... 139
AsciiSink Object .............................. 144
Customizing the Text Widget ................... 146
Text Widget ................................... 147
TextSrc Object ................................ 152
[1miii[0m
TextSink Object ............................... 157
Chapter 6 - Composite and Constraint Widgets .......... 165
Box Widget .................................... 166
Dialog Widget ................................. 169
Form Widget ................................... 176
Paned Widget .................................. 181
Porthole Widget ............................... 190
Tree Widget ................................... 193
Viewport Widget ............................... 197
Chapter 7 - Creating New Widgets (Subclassing) ........ 202
Index ................................................. 212
[1miv[0m
0707010005615d000081a40000000000000000000000014c5c73b000007bb90000010000010036ffffffffffffffff0000003100000000root/usr/local/share/doc/libXaw/widgets.index.ps %!PS-Adobe-3.0
%%Creator: groff version 1.20
%%CreationDate: Sat Aug 7 06:41:42 2010
%%DocumentNeededResources: font Times-Bold
%%+ font Times-Roman
%%DocumentSuppliedResources: procset grops 1.20 0
%%Pages: 7
%%PageOrder: Ascend
%%DocumentMedia: Default 595 842 0 () ()
%%Orientation: Portrait
%%EndComments
%%BeginDefaults
%%PageMedia: Default
%%EndDefaults
%%BeginProlog
%%BeginResource: procset grops 1.20 0
%!PS-Adobe-3.0 Resource-ProcSet
/setpacking where{
pop
currentpacking
true setpacking
}if
/grops 120 dict dup begin
/SC 32 def
/A/show load def
/B{0 SC 3 -1 roll widthshow}bind def
/C{0 exch ashow}bind def
/D{0 exch 0 SC 5 2 roll awidthshow}bind def
/E{0 rmoveto show}bind def
/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
/G{0 rmoveto 0 exch ashow}bind def
/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
/I{0 exch rmoveto show}bind def
/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
/K{0 exch rmoveto 0 exch ashow}bind def
/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
/M{rmoveto show}bind def
/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
/O{rmoveto 0 exch ashow}bind def
/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
/Q{moveto show}bind def
/R{moveto 0 SC 3 -1 roll widthshow}bind def
/S{moveto 0 exch ashow}bind def
/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
/SF{
findfont exch
[exch dup 0 exch 0 exch neg 0 0]makefont
dup setfont
[exch/setfont cvx]cvx bind def
}bind def
/MF{
findfont
[5 2 roll
0 3 1 roll
neg 0 0]makefont
dup setfont
[exch/setfont cvx]cvx bind def
}bind def
/level0 0 def
/RES 0 def
/PL 0 def
/LS 0 def
/MANUAL{
statusdict begin/manualfeed true store end
}bind def
/PLG{
gsave newpath clippath pathbbox grestore
exch pop add exch pop
}bind def
/BP{
/level0 save def
1 setlinecap
1 setlinejoin
DEFS/BPhook known{DEFS begin BPhook end}if
72 RES div dup scale
LS{
90 rotate
}{
0 PL translate
}ifelse
1 -1 scale
}bind def
/EP{
level0 restore
showpage
}def
/DA{
newpath arcn stroke
}bind def
/SN{
transform
.25 sub exch .25 sub exch
round .25 add exch round .25 add exch
itransform
}bind def
/DL{
SN
moveto
SN
lineto stroke
}bind def
/DC{
newpath 0 360 arc closepath
}bind def
/TM matrix def
/DE{
TM currentmatrix pop
translate scale newpath 0 0 .5 0 360 arc closepath
TM setmatrix
}bind def
/RC/rcurveto load def
/RL/rlineto load def
/ST/stroke load def
/MT/moveto load def
/CL/closepath load def
/Fr{
setrgbcolor fill
}bind def
/setcmykcolor where{
pop
/Fk{
setcmykcolor fill
}bind def
}if
/Fg{
setgray fill
}bind def
/FL/fill load def
/LW/setlinewidth load def
/Cr/setrgbcolor load def
/setcmykcolor where{
pop
/Ck/setcmykcolor load def
}if
/Cg/setgray load def
/RE{
findfont
dup maxlength 1 index/FontName known not{1 add}if dict begin
{
1 index/FID ne
2 index/UniqueID ne
and
{def}{pop pop}ifelse
}forall
/Encoding exch def
dup/FontName exch def
currentdict end definefont pop
}bind def
/DEFS 0 def
/EBEGIN{
moveto
DEFS begin
}bind def
/EEND/end load def
/CNT 0 def
/level1 0 def
/PBEGIN{
/level1 save def
translate
div 3 1 roll div exch scale
neg exch neg exch translate
0 setgray
0 setlinecap
1 setlinewidth
0 setlinejoin
10 setmiterlimit
[]0 setdash
/setstrokeadjust where{
pop
false setstrokeadjust
}if
/setoverprint where{
pop
false setoverprint
}if
newpath
/CNT countdictstack def
userdict begin
/showpage{}def
/setpagedevice{}def
mark
}bind def
/PEND{
cleartomark
countdictstack CNT sub{end}repeat
level1 restore
}bind def
end def
/setpacking where{
pop
setpacking
}if
%%EndResource
%%EndProlog
%%BeginSetup
%%BeginFeature: *PageSize Default
<< /PageSize [ 595 842 ] /ImagingBBox null >> setpagedevice
%%EndFeature
%%IncludeResource: font Times-Bold
%%IncludeResource: font Times-Roman
grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
def/PL 841.89 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron
/Zcaron/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef
/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
/.notdef/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
/Times-Roman@0 ENC0/Times-Roman RE/Times-Bold@0 ENC0/Times-Bold RE
%%EndSetup
%%Page: 139 1
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Bold@0 SF(Athena W)72 60 Q(idget Set)-.18 E(libXaw 1.0.7)
298.57 E/F1 18/Times-Roman@0 SF(Inde)267.642 105.6 Q(x)-.27 E/F2 12
/Times-Bold@0 SF(/)72 139.2 Q/F3 10/Times-Roman@0 SF
(/usr/include/X11/bitmaps, 9)72 163.2 Q(/usr/lib/X11/app-def)72 175.2 Q
(aults, 14)-.1 E F2(A)72 199.2 Q F3(A, note,)72 223.2 Q/F4 11
/Times-Bold@0 SF(4)2.5 E F3(app-def)72 235.2 Q(aults, 14)-.1 E
(application def)72 247.2 Q(aults, 14)-.1 E(application header \214le,)
72 259.2 Q F4(4)2.5 E F3(application programmer)72 271.2 Q(,)-.4 E F4(2)
2.5 E F3(Ar)72 283.2 Q(g,)-.18 E F4(16)2.5 E F3(Ar)72 295.2 Q(gList,)
-.18 E F4(16)2.5 E F3(ar)72 307.2 Q(gument lists,)-.18 E F4(16)2.5 E F3
(AsciiSink object, 87,)72 319.2 Q F4(94)2.5 E F3(class name, 94)79.5
331.2 Q(resources, 95)79.5 343.2 Q(AsciiSink object, 96)72 355.2 Q
(resources, 103)79.5 367.2 Q(AsciiSink.h, 94)72 379.2 Q
(asciiSinkObjectClass, 94)72 391.2 Q(AsciiSinkP)72 403.2 Q(.h, 94)-1.11
E(AsciiSrc object, 87,)72 415.2 Q F4(91)2.5 E F3(class name, 91)79.5
427.2 Q(resources, 92)79.5 439.2 Q(AsciiSrc object, 96)72 451.2 Q
(AsciiSrc.h, 91)72 463.2 Q(asciiSrcObjectClass, 91)72 475.2 Q(AsciiSrcP)
72 487.2 Q(.h, 91)-1.11 E(AsciiT)72 499.2 Q -.15(ex)-.7 G 2.5(tw).15 G
(idget,)-2.5 E F4(86)2.5 E F3(class name, 86)79.5 511.2 Q(resources, 87)
79.5 523.2 Q(AsciiT)72 535.2 Q -.15(ex)-.7 G 2.5(tw).15 G(idget, 96)-2.5
E(AsciiT)72 547.2 Q -.15(ex)-.7 G(t.h, 86).15 E(AsciiT)72 559.2 Q -.15
(ex)-.7 G(tP).15 E(.h, 86)-1.11 E(asciiT)72 571.2 Q -.15(ex)-.7 G(tW).15
E(idgetClass, 86)-.4 E F2(B)72 595.2 Q F3(bitmap con)72 619.2 Q -.15(ve)
-.4 G(rsions,).15 E F4(9)2.5 E F3(BitmapFileP)72 631.2 Q(ath,)-.15 E F4
(9)2.5 E F3(bitmapFileP)72 643.2 Q(ath,)-.15 E F4(9)2.5 E F3
(Box widget,)72 655.2 Q F4(108)2.5 E F3(class name, 108)79.5 667.2 Q
(resources, 109)79.5 679.2 Q(layout semantics, 110)79.5 691.2 Q
(resources, 127)79.5 703.2 Q(Box.h, 108, 126)72 715.2 Q(BoxP)298 139.2 Q
(.h, 108)-1.11 E(boxW)298 151.2 Q(idgetClass, 108)-.4 E
(ButtonPress, 137)298 163.2 Q F2(C)298 187.2 Q F3(C, note,)298 211.2 Q
F4(4)2.5 E F3(CallbackProc,)298 223.2 Q F4(12)2.5 E F3(callbacks, 12)298
235.2 Q(chapter format,)298 247.2 Q F4(4)2.5 E F3(child, 2)298 259.2 Q
(class,)298 271.2 Q F4(2)2.5 E F3(,)A F4(4)2.5 E F3
(class header \214le,)298 283.2 Q F4(4)2.5 E F3(class name,)298 295.2 Q
F4(4)2.5 E F3(client,)298 307.2 Q F4(2)2.5 E F3(Command widget,)298
319.2 Q F4(18)2.5 E F3(class name, 18)305.5 331.2 Q(resources, 19)305.5
343.2 Q(actions, 22)305.5 355.2 Q(translation bindings, 22)305.5 367.2 Q
(Command.h, 18)298 379.2 Q(CommandP)298 391.2 Q(.h, 18)-1.11 E(commandW)
298 403.2 Q(idgetClass, 18)-.4 E(compiling applications, 14)298 415.2 Q
(con)298 427.2 Q -.15(ve)-.4 G(ntions:).15 E(used in manual,)305.5 439.2
Q F4(3)2.5 E F3(chapter format,)305.5 451.2 Q F4(4)2.5 E F3(con)298
463.2 Q -.15(ve)-.4 G(rsions,).15 E F4(8)2.5 E F3(Bitmap,)305.5 475.2 Q
F4(9)2.5 E F3(ColorCursor)305.5 487.2 Q(,)-.4 E F4(9)2.5 E F3(Cursor)
305.5 499.2 Q(,)-.4 E F4(9)2.5 E F3(Pix)305.5 511.2 Q(el,)-.15 E F4(9)
2.5 E F3(Justify)305.5 523.2 Q 2.5(,2)-.65 G(1)-2.5 E(ShapeStyle, 21)
305.5 535.2 Q(Justify)305.5 547.2 Q 2.5(,2)-.65 G(7, 39)-2.5 E
(ShapeStyle, 40)305.5 559.2 Q(Orientation, 43)305.5 571.2 Q(Justify)
305.5 583.2 Q 2.5(,5)-.65 G(3)-2.5 E(ShapeStyle, 54)305.5 595.2 Q
(BackingStore, 60)305.5 607.2 Q(Justify)305.5 619.2 Q 2.5(,6)-.65 G(9)
-2.5 E(ShapeStyle, 70)305.5 631.2 Q(Xa)305.5 643.2 Q(wT)-.15 E -.15(ex)
-.7 G(tEditT).15 E(ype, 89)-.8 E(Xa)305.5 655.2 Q(wT)-.15 E -.15(ex)-.7
G(tResizeMode, 90).15 E(Xa)305.5 667.2 Q(wT)-.15 E -.15(ex)-.7 G
(tScrollMode, 90).15 E(AsciiT)305.5 679.2 Q(ype, 91, 93)-.8 E(Xa)305.5
691.2 Q(wT)-.15 E -.15(ex)-.7 G(tEditT).15 E(ype, 93)-.8 E(Xa)305.5
703.2 Q(wT)-.15 E -.15(ex)-.7 G(tResizeMode, 98).15 E(Xa)305.5 715.2 Q
(wT)-.15 E -.15(ex)-.7 G(tScrollMode, 98).15 E F0(139)280.5 756 Q 0 Cg
EP
%%Page: 140 2
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Bold@0 SF(Athena W)72 60 Q(idget Set)-.18 E(libXaw 1.0.7)
298.57 E/F1 10/Times-Roman@0 SF(Xa)79.5 96 Q(wT)-.15 E -.15(ex)-.7 G
(tEditT).15 E(ype, 100)-.8 E(Orientation, 110)79.5 108 Q -.4(Wi)79.5 120
S(dget, 113, 117).4 E(Orientation, 121)79.5 132 Q(Gra)79.5 144 Q(vity)
-.2 E 2.5(,1)-.65 G(28)-2.5 E(Core widget, 132)72 156 Q(creating ne)72
168 Q 2.5(ww)-.25 G(idgets,)-2.5 E/F2 11/Times-Bold@0 SF(132)2.5 E F1
(creating widgets,)72 180 Q F2(7)2.5 E F1(cursor)72 192 Q 2.5(,9)-.4 G
/F3 12/Times-Bold@0 SF(D)72 216 Q F1(D, note,)72 240 Q F2(4)2.5 E F1
(destro)72 252 Q(yCallback,)-.1 E F2(13)2.5 E F1(Dialog widget, 108,)72
264 Q F2(110)2.5 E F1(class name, 111)79.5 276 Q(resources, 111)79.5 288
Q(constraint resources, 112)79.5 300 Q(layout semantics, 113)79.5 312 Q
(automatically created children, 114)79.5 324 Q
(special considerations, 114)79.5 336 Q(Dialog.h, 110)72 348 Q(DialogP)
72 360 Q(.h, 111)-1.11 E(dialogW)72 372 Q(idgetClass, 111)-.4 E F3(E)72
396 Q F1 -2.15 -.25(ev e)72 420 T(nts, 10).25 E -.15(ex)72 432 S
(amples, 17).15 E F3(F)72 456 Q F1 -.1(fa)72 480 S(llback resources,).1
E F2(6)2.5 E F1(FindPosition, 105)72 492 Q(\215oat resources:)72 504 Q
(setting, 46)79.5 516 Q(FMT8BIT)72 528 Q 2.5(,8)-.74 G(3)-2.5 E -.15(Fo)
72 540 S(rm widget, 108,).15 E F2(115)2.5 E F1(class name, 115)79.5 552
Q(resources, 115)79.5 564 Q(constraint resources, 116)79.5 576 Q
(re-layout, 118)79.5 588 Q -.15(Fo)72 600 S(rm.h, 115).15 E -.15(Fo)72
612 S(rmP).15 E(.h, 115)-1.11 E(formW)72 624 Q(idgetClass, 115)-.4 E
(fromHoriz, 113, 117)72 636 Q(fromLeft, 114)72 648 Q(fromV)72 660 Q
(ert, 113, 117)-1.11 E(FullName, 2)298 96 Q F3(G)298 120 Q F1
(geometry management, 108)298 144 Q(Grip widget, 18,)298 156 Q F2(22)2.5
E F1(class name, 22)305.5 168 Q(resources, 23)305.5 180 Q
(GripAction routine, 24)305.5 192 Q(actions, 24)305.5 204 Q
(GripAction table, 25)305.5 216 Q(Grip.h, 22)298 228 Q(GripAction, 123)
298 240 Q(GripCallData, 25)298 252 Q(GripP)298 264 Q(.h, 22)-1.11 E
(gripW)298 276 Q(idgetClass, 22)-.4 E F3(H)298 300 Q F1
(horizDistance, 113, 117)298 324 Q F3(I)298 348 Q F1(initialization,)298
372 Q F2(6)2.5 E F1(input,)298 384 Q F2(5)2.5 E F1(input focus,)298 396
Q F2(5)2.5 E F1(Input Method, 80)298 408 Q(instance,)298 420 Q F2(2)2.5
E F1(internationalization, 6)298 432 Q(Intrinsic.h, 13)298 444 Q
(introduction,)298 456 Q F2(1)2.5 E F3(J)298 480 Q F1(jumpProc, 44,)298
504 Q F2(45)2.5 E F3(K)298 528 Q F1 -2.15 -.25(Ke y)298 552 T
(Press, 137).25 E F3(L)298 576 Q F1(Label widget, 18,)298 600 Q F2(25)
2.5 E F1(class name, 25)305.5 612 Q(resources, 25)305.5 624 Q
(Label.h, 25)298 636 Q(LabelP)298 648 Q(.h, 25)-1.11 E(labelW)298 660 Q
(idgetClass, 25)-.4 E(libICE, 14)298 672 Q(libSM, 14)298 684 Q
(libX11, 14)298 696 Q(libXa)298 708 Q 1.3 -.65(w, 1)-.15 H(4).65 E
(libXe)298 720 Q(xt, 14)-.15 E F0(140)280.5 756 Q 0 Cg EP
%%Page: 141 3
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Bold@0 SF(Athena W)72 60 Q(idget Set)-.18 E(libXaw 1.0.7)
298.57 E/F1 10/Times-Roman@0 SF(libXmu, 14)72 96 Q(libXt, 14)72 108 Q
(linking applications, 14)72 120 Q(List widget, 18,)72 132 Q/F2 11
/Times-Bold@0 SF(28)2.5 E F1(class name, 28)79.5 144 Q(resources, 28)
79.5 156 Q(actions, 31)79.5 168 Q(callbacks, 31)79.5 180 Q(def)79.5 192
Q(ault translation table, 31)-.1 E(List.h, 28)72 204 Q(ListP)72 216 Q
(.h, 28)-1.11 E(listW)72 228 Q(idgetClass, 28)-.4 E(locale, 6)72 240 Q
/F3 12/Times-Bold@0 SF(M)72 264 Q F1(MenuButton widget,)72 288 Q F2(67)
2.5 E F1(class name, 67)79.5 300 Q(resources, 67)79.5 312 Q(actions, 70)
79.5 324 Q(MenuButton.h, 67)72 336 Q(MenuButtonP)72 348 Q(.h, 67)-1.11 E
(menuButtonW)72 360 Q(idgetClass, 67)-.4 E(Menus, 58)72 372 Q(popup, 58)
79.5 384 Q(pulldo)79.5 396 Q(wn, 58)-.25 E(using, 58)79.5 408 Q(method,)
72 420 Q F2(2)2.5 E F1(MultiSink object, 87, 96)72 432 Q
(MultiSrc object, 87, 96)72 444 Q F3(N)72 468 Q F1(name:)72 492 Q
(widget,)79.5 504 Q F2(2)2.5 E F1(notes,)72 516 Q F2(4)2.5 E F3(O)72 540
Q F1(object,)72 564 Q F2(2)2.5 E F3(P)72 588 Q F1 -.15(Pa)72 612 S
(ned widget, 108,).15 E F2(118)2.5 E F1(class name, 118)79.5 624 Q
(using, 118)79.5 636 Q(resources, 119)79.5 648 Q
(constraint resources, 121)79.5 660 Q(layout semantics, 122)79.5 672 Q
(change height settings, 123)79.5 684 Q(disable pane resizing, 123)79.5
696 Q(enable pane resizing, 123)79.5 708 Q
(disable auto-recon\214guring, 124)79.5 720 Q
(enable auto-recon\214guring, 124)305.5 96 Q(get height settings, 124)
305.5 108 Q(getting the number of children, 124)305.5 120 Q -.15(Pa)298
132 S(ned.h, 118).15 E -.15(Pa)298 144 S(nedP).15 E(.h, 118)-1.11 E
(panedW)298 156 Q(idgetClass, 118)-.4 E -.15(Pa)298 168 S
(nner widget, 18,).15 E F2(33)2.5 E F1(class name, 33)305.5 180 Q
(resources, 33)305.5 192 Q(actions, 36)305.5 204 Q(callbacks, 36)305.5
216 Q(def)305.5 228 Q(ault translation table, 36)-.1 E -.15(Pa)298 240 S
(nner).15 E(.h, 33)-.55 E -.15(Pa)298 252 S(nnerP).15 E(.h, 33)-1.11 E
(pannerW)298 264 Q(idgetClass, 33)-.4 E(parent,)298 276 Q F2(2)2.5 E F1
(pix)298 288 Q(el, 9)-.15 E(Porthole widget, 108,)298 300 Q F2(124)2.5 E
F1(class name, 124)305.5 312 Q(resources, 125)305.5 324 Q
(callbacks, 126)305.5 336 Q(layout semantics, 126)305.5 348 Q
(Porthole.h, 124)298 360 Q(PortholeP)298 372 Q(.h, 124)-1.11 E
(portholeW)298 384 Q(idgetClass, 124)-.4 E F3(R)298 408 Q F1(R, note,)
298 432 Q F2(4)2.5 E F1(Radio b)298 444 Q(utton, 51)-.2 E
(Radio groups, 51, 56)298 456 Q(one of man)305.5 468 Q 1.3 -.65(y, 5)
-.15 H(6).65 E(zero or one of man)305.5 480 Q 1.3 -.65(y, 5)-.15 H(6).65
E(radioData, 56)298 492 Q(realizing widgets,)298 504 Q F2(9)2.5 E F1
(Repeater widget, 18,)298 516 Q F2(37)2.5 E F1(class name, 37)305.5 528
Q(resources, 37)305.5 540 Q(actions, 40)305.5 552 Q
(translation bindings, 40)305.5 564 Q(Repeater)298 576 Q(.h, 37)-.55 E
(RepeaterP)298 588 Q(.h, 37)-1.11 E(repeaterW)298 600 Q(idgetClass, 37)
-.4 E(ReportProc,)298 612 Q F2(36)2.5 E F1(,)A F2(126)2.5 E F1
(resource,)298 624 Q F2(2)2.5 E F1 2.5(,8)C 2.5(,1)-2.5 G(4)-2.5 E -.18
(rg)298 636 S -.4(b.).18 G(txt, 9).4 E F3(S)298 660 Q F1
(Scrollbar widget, 18,)298 684 Q F2(41)2.5 E F1(class name, 41)305.5 696
Q(resources, 41)305.5 708 Q(actions, 44)305.5 720 Q F0(141)280.5 756 Q 0
Cg EP
%%Page: 142 4
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Bold@0 SF(Athena W)72 60 Q(idget Set)-.18 E(libXaw 1.0.7)
298.57 E/F1 10/Times-Roman@0 SF(callbacks, 44)79.5 96 Q(def)79.5 108 Q
(ault translation table, 44)-.1 E(setting thumb v)79.5 120 Q(alues, 45)
-.25 E(Scrollbar)72 132 Q(.h, 41)-.55 E(ScrollbarP)72 144 Q(.h, 41)-1.11
E(scrollbarW)72 156 Q(idgetClass, 41)-.4 E(ScrollProc,)72 168 Q/F2 11
/Times-Bold@0 SF(44)2.5 E F1(SetSelection,)72 180 Q F2(102)2.5 E F1
(Simple widget, 18,)72 192 Q F2(46)2.5 E F1(class name, 46)79.5 204 Q
(resources, 46)79.5 216 Q(simple widgets, 18)72 228 Q(Simple.h, 46)72
240 Q(SimpleMenP)72 252 Q(.h, 59)-1.11 E(SimpleMenu widget,)72 264 Q F2
(58)2.5 E F1(class name, 59)79.5 276 Q(resources, 59)79.5 288 Q
(MenuPopdo)79.5 300 Q(wn routine, 61)-.25 E(actions, 61)79.5 312 Q(def)
79.5 324 Q(ault translations, 61)-.1 E(MenuPopdo)79.5 336 Q
(wn routine, 62)-.25 E(positioning,)79.5 348 Q F2(62)2.5 E F1
(SimpleMenu.h, 58)72 360 Q(simpleMenuW)72 372 Q(idgetClass, 59)-.4 E
(SimpleP)72 384 Q(.h, 46)-1.11 E(simpleW)72 396 Q(idgetClass, 46)-.4 E
(Sme object, 58,)72 408 Q F2(65)2.5 E F1(Highlight method, 66)79.5 420 Q
(Notify method, 66)79.5 432 Q(Unhighlight method, 66)79.5 444 Q
(class name, 66)79.5 456 Q(subclassing, 66)79.5 468 Q(Sme.h, 65)72 480 Q
(SmeBSB object, 58,)72 492 Q F2(63)2.5 E F1(class name, 63)79.5 504 Q
(resources, 63)79.5 516 Q(SmeBSB.h, 63)72 528 Q(smeBSBObjectClass, 63)72
540 Q(SmeBSBP)72 552 Q(.h, 63)-1.11 E(SmeLine object, 58,)72 564 Q F2
(65)2.5 E F1(class name, 65)79.5 576 Q(resources, 65, 66)79.5 588 Q
(SmeLine.h, 65)72 600 Q(smeLineObjectClass, 65)72 612 Q(SmeLineP)72 624
Q(.h, 65)-1.11 E(smeObjectClass, 66)72 636 Q(SmeP)72 648 Q(.h, 65)-1.11
E(string con)72 660 Q -.15(ve)-.4 G(rsions,).15 E F2(8)2.5 E F1
(StringDefs.h, 13)72 672 Q(StripCharP)72 684 Q(.h, 48)-1.11 E
(StripChart widget, 18,)72 696 Q F2(48)2.5 E F1(class name, 48)79.5 708
Q(resources, 48)79.5 720 Q(getV)305.5 96 Q(alue callback,)-1.11 E F2(50)
2.5 E F1(getting the v)305.5 108 Q(alue, 50)-.25 E(StripChart.h, 48)298
120 Q(stripChartW)298 132 Q(idgetClass, 48)-.4 E(subclassing,)298 144 Q
F2(132)2.5 E F1(superclass,)298 156 Q F2(2)2.5 E F1 2.5(,4)C/F3 12
/Times-Bold@0 SF(T)298 180 Q F1 -1.25 -.7(Te x)298 204 T 2.5(tw).7 G
(idget:)-2.5 E(User')305.5 216 Q 2.5(sG)-.55 G(uide to the T)-2.5 E -.15
(ex)-.7 G 2.5(tw).15 G(idget, 72)-2.5 E(def)305.5 228 Q(ault k)-.1 E .3
-.15(ey b)-.1 H(indings, 72).15 E(edit modes, 72)305.5 240 Q
(query replace, 73)305.5 252 Q(search, 73)305.5 264 Q
(\214le insertion, 74)305.5 276 Q -1.25 -.7(Te x)305.5 288 T 2.5(tS).7 G
(elections for Users, 75)-2.5 E(actions,)305.5 300 Q F2(75)2.5 E F1
-1.25 -.7(Te x)305.5 312 T 2.5(tS).7 G
(elections for Application Programmers, 80)-2.5 E(def)305.5 324 Q
(ault translations, 81)-.1 E -1.25 -.7(Te x)298 336 T 2.5(tw).7 G
(idget, 95)-2.5 E(customizing,)305.5 348 Q F2(95)2.5 E F1 -1.25 -.7
(Te x)298 360 T 2.5(tw).7 G(idget,)-2.5 E F2(96)2.5 E F1(class name, 96)
305.5 372 Q(resources, 96)305.5 384 Q(Con)305.5 396 Q -.15(ve)-.4 G
(rtSelection,).15 E F2(102)2.5 E F1 -1.25 -.7(Te x)298 408 T(t.h, 96).7
E -1.25 -.7(Te x)298 420 T(tP).7 E(.h, 96)-1.11 E -1.25 -.7(Te x)298 432
T(tSink object, 95,).7 E F2(103)2.5 E F1(DisplayT)305.5 444 Q -.15(ex)
-.7 G(t,).15 E F2(103)2.5 E F1(class name, 103)305.5 456 Q(subclassing,)
305.5 468 Q F2(103)2.5 E F1(ClearT)305.5 480 Q(oBackground,)-.8 E F2
(104)2.5 E F1(InsertCursor)305.5 492 Q(,)-.4 E F2(104)2.5 E F1
(FindPosition,)305.5 504 Q F2(105)2.5 E F1(Resolv)305.5 516 Q(e,)-.15 E
F2(105)2.5 E F1(FindDistance,)305.5 528 Q F2(106)2.5 E F1(MaxHeight,)
305.5 540 Q F2(106)2.5 E F1(MaxLines,)305.5 552 Q F2(106)2.5 E F1(SetT)
305.5 564 Q(abs,)-.8 E F2(106)2.5 E F1(GetCursorBounds,)305.5 576 Q F2
(107)2.5 E F1 -1.25 -.7(Te x)298 588 T(tSink.h, 103).7 E(te)298 600 Q
(xtSinkObjectClass, 103)-.15 E -1.25 -.7(Te x)298 612 T(tSinkP).7 E
(.h, 103)-1.11 E -1.25 -.7(Te x)298 624 T(tSrc object, 96,).7 E F2(99)
2.5 E F1(class name, 99)305.5 636 Q(resources, 99)305.5 648 Q(Read,)
305.5 660 Q F2(100)2.5 E F1(Replace,)305.5 672 Q F2(100)2.5 E F1
(subclassing,)305.5 684 Q F2(100)2.5 E F1(Scan,)305.5 696 Q F2(101)2.5 E
F1(Search,)305.5 708 Q F2(101)2.5 E F1 -1.25 -.7(Te x)298 720 T
(tSrc.h, 99).7 E F0(142)280.5 756 Q 0 Cg EP
%%Page: 143 5
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Bold@0 SF(Athena W)72 60 Q(idget Set)-.18 E(libXaw 1.0.7)
298.57 E/F1 10/Times-Roman@0 SF(te)72 96 Q(xtSrcObjectClass, 99)-.15 E
-1.25 -.7(Te x)72 108 T(tSrcP).7 E(.h, 99)-1.11 E(te)72 120 Q(xtW)-.15 E
(idgetClass, 96)-.4 E -.8(To)72 132 S(ggle widget, 18,).8 E/F2 11
/Times-Bold@0 SF(51)2.5 E F1(class name, 51)79.5 144 Q(resources, 51)
79.5 156 Q(used in radio groups, 51)79.5 168 Q(actions, 55)79.5 180 Q
(def)79.5 192 Q(ault translation table, 55)-.1 E -.8(To)72 204 S
(ggle.h, 51).8 E -.8(To)72 216 S(ggleP).8 E(.h, 51)-1.11 E(toggleW)72
228 Q(idgetClass, 51)-.4 E(toolkit initialization,)72 240 Q F2(6)2.5 E
F1 -.35(Tr)72 252 S(ee widget, 108,).35 E F2(126)2.5 E F1
(class name, 126)79.5 264 Q(constraint resources, 128)79.5 276 Q(con)
79.5 288 Q -.15(ve)-.4 G(nience routines, 128).15 E
(layout semantics, 128)79.5 300 Q -.35(Tr)72 312 S(eeP).35 E(.h, 126)
-1.11 E(treeW)72 324 Q(idgetClass, 126)-.4 E(type con)72 336 Q -.15(ve)
-.4 G(rsions,).15 E F2(8)2.5 E/F3 12/Times-Bold@0 SF(U)72 360 Q F1
(underlying model,)72 384 Q F2(3)2.5 E F1(user)72 396 Q(,)-.4 E F2(2)2.5
E F1(using widgets,)72 408 Q F2(6)2.5 E F3(V)72 432 Q F1 -.15(ve)72 456
S(rtDistance, 113, 117).15 E -.6(Vi)72 468 S -.25(ew).6 G
(port widget, 108,).25 E F2(129)2.5 E F1(class name, 129)79.5 480 Q
(resources, 129)79.5 492 Q(layout semantics, 131)79.5 504 Q -.6(Vi)72
516 S -.25(ew).6 G(port.h, 129).25 E -.6(Vi)72 528 S -.25(ew).6 G(portP)
.25 E(.h, 129)-1.11 E(vie)72 540 Q(wportW)-.25 E(idgetClass, 129)-.4 E
F3(W)72 564 Q F1(widget,)72 588 Q F2(3)2.5 E F1(widget class,)72 600 Q
F2(3)2.5 E F1(widget creation,)72 612 Q F2(7)2.5 E F1(widget programmer)
72 624 Q(,)-.4 E F2(3)2.5 E F1(widgetClass, 132)72 636 Q -.4(Wi)72 648 S
(ndo).4 E 2.5(ww)-.25 G(idget, 132)-2.5 E(WrapMode, 91, 99)72 660 Q
(writing applications, 13)298 96 Q F3(X)298 120 Q F1
(X11/Intrinsic.h, 13)298 144 Q(X11/Xa)298 156 Q(w/Command.h, 13)-.15 E
(X11/Xa)298 168 Q(w/Label.h, 13)-.15 E(X11/Xa)298 180 Q(w/T)-.15 E
(emplate.c, 133, 135)-.7 E(X11/Xa)298 192 Q(w/T)-.15 E(emplate.h, 133)
-.7 E(X11/Xa)298 204 Q(w/T)-.15 E(emplateP)-.7 E(.h, 133, 134)-1.11 E
(X11/Xlib)298 216 Q(.h, 13)-.4 E(Xa)298 228 Q(wAsciiSa)-.15 E -.15(ve)
-.2 G(,).15 E F2(94)2.5 E F1(Xa)298 240 Q(wAsciiSa)-.15 E -.15(ve)-.2 G
(AsFile,).15 E F2(94)2.5 E F1(Xa)298 252 Q(wAsciiSourceChanged,)-.15 E
F2(94)2.5 E F1(Xa)298 264 Q(wAsciiSourceFreeString,)-.15 E F2(94)2.5 E
F1 2.5(,1)C(14)-2.5 E(Xa)298 276 Q(wChain, 113, 117)-.15 E(Xa)298 288 Q
(wChainBottom, 113, 117)-.15 E(Xa)298 300 Q(wChainLeft, 113, 117)-.15 E
(Xa)298 312 Q(wChainRight, 113, 117)-.15 E(Xa)298 324 Q(wChainT)-.15 E
(op, 113, 118)-.8 E(Xa)298 336 Q(wDialogAddButton,)-.15 E F2(114)2.5 E
F1(Xa)298 348 Q(wDialogGetV)-.15 E(alueString,)-1.11 E F2(114)2.5 E F1
(Xa)298 360 Q(wEdgeT)-.15 E(ype, 112, 116)-.8 E(Xa)298 372 Q
(wEditDone, 84, 101)-.15 E(Xa)298 384 Q(wEditError)-.15 E 2.5(,8)-.4 G
(4, 101)-2.5 E(Xa)298 396 Q(wF)-.15 E(ormDoLayout,)-.15 E F2(118)2.5 E
F1(Xa)298 408 Q(wGripCallData,)-.15 E F2(24)2.5 E F1 2.5(,2)C(5)-2.5 E
(Xa)298 420 Q(wGripCallDataRec,)-.15 E F2(24)2.5 E F1 2.5(,2)C(5)-2.5 E
(Xa)298 432 Q(wListChange,)-.15 E F2(31)2.5 E F1 2.5(,3)C(2)-2.5 E(Xa)
298 444 Q(wListHighlight,)-.15 E F2(32)2.5 E F1(Xa)298 456 Q
(wListReturnStruct,)-.15 E F2(31)2.5 E F1 2.5(,3)C(2)-2.5 E(Xa)298 468 Q
(wListSho)-.15 E(wCurrent,)-.25 E F2(32)2.5 E F1(Xa)298 480 Q
(wListUnhighlight,)-.15 E F2(32)2.5 E F1(Xa)298 492 Q(wP)-.15 E
(anedAllo)-.15 E(wResize,)-.25 E F2(123)2.5 E F1(Xa)298 504 Q(wP)-.15 E
(anedGetMinMax,)-.15 E F2(124)2.5 E F1(Xa)298 516 Q(wP)-.15 E
(anedGetNumSub,)-.15 E F2(124)2.5 E F1(Xa)298 528 Q(wP)-.15 E
(anedSetMinMax,)-.15 E F2(123)2.5 E F1(Xa)298 540 Q(wP)-.15 E
(anedSetRe\214gureMode,)-.15 E F2(124)2.5 E F1(Xa)298 552 Q
(wPositionError)-.15 E 2.5(,8)-.4 G(4, 101)-2.5 E(Xa)298 564 Q
(wPositionSimpleMenu,)-.15 E F2(62)2.5 E F1(Xa)298 576 Q(wRubber)-.15 E
2.5(,1)-.4 G(12, 113, 117, 118)-2.5 E(Xa)298 588 Q(wScrollbarSetThumb,)
-.15 E F2(45)2.5 E F1(Xa)298 600 Q(wScrollbarThumb, 45)-.15 E(Xa)298 612
Q(wsdLeft, 101, 102)-.15 E(Xa)298 624 Q(wsdRight, 101, 102)-.15 E(Xa)298
636 Q(wselectAll, 80)-.15 E(Xa)298 648 Q(wselectChar)-.15 E 2.5(,8)-.4 G
(0)-2.5 E(Xa)298 660 Q(wselectLine, 80)-.15 E(Xa)298 672 Q
(wselectNull, 80)-.15 E(Xa)298 684 Q(wselectP)-.15 E(aragraph, 80)-.15 E
(Xa)298 696 Q(wselectPosition, 80)-.15 E(Xa)298 708 Q(wselectW)-.15 E
(ord, 80)-.8 E(Xa)298 720 Q(wSimpleMenuAddGlobalActions,)-.15 E F2(62)
2.5 E F0(143)280.5 756 Q 0 Cg EP
%%Page: 144 6
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Bold@0 SF(Athena W)72 60 Q(idget Set)-.18 E(libXaw 1.0.7)
298.57 E/F1 10/Times-Roman@0 SF(Xa)72 96 Q(wSimpleMenuClearActi)-.15 E
-.15(ve)-.25 G(Entry).15 E(,)-.65 E/F2 11/Times-Bold@0 SF(63)2.5 E F1
(Xa)72 108 Q(wSimpleMenuGetActi)-.15 E -.15(ve)-.25 G(Entry).15 E(,)-.65
E F2(62)2.5 E F1(Xa)72 120 Q(wstAll, 101)-.15 E(Xa)72 132 Q(wstEOL, 101)
-.15 E(Xa)72 144 Q(wstP)-.15 E(aragraph, 101)-.15 E(Xa)72 156 Q
(wstPositions, 101)-.15 E(Xa)72 168 Q(wstWhiteSpace, 101)-.15 E(Xa)72
180 Q(wte)-.15 E(xtAppend, 89, 93, 100)-.15 E(Xa)72 192 Q(wT)-.15 E -.15
(ex)-.7 G(tBlock,).15 E F2(82)2.5 E F1(Xa)72 204 Q(wT)-.15 E -.15(ex)-.7
G(tBlockPtr).15 E 2.5(,8)-.4 G(2)-2.5 E(Xa)72 216 Q(wT)-.15 E -.15(ex)
-.7 G(tDisableRedisplay).15 E(,)-.65 E F2(85)2.5 E F1(Xa)72 228 Q(wT)
-.15 E -.15(ex)-.7 G(tDisplay).15 E(,)-.65 E F2(85)2.5 E F1(Xa)72 240 Q
(wT)-.15 E -.15(ex)-.7 G(tDisplayCaret,).15 E F2(86)2.5 E F1(Xa)72 252 Q
(wte)-.15 E(xtEdit, 89, 93, 100)-.15 E(Xa)72 264 Q(wT)-.15 E -.15(ex)-.7
G(tEnableRedisplay).15 E(,)-.65 E F2(84)2.5 E F1(Xa)72 276 Q(wT)-.15 E
-.15(ex)-.7 G(tGetInsertionPoint,).15 E F2(86)2.5 E F1(Xa)72 288 Q(wT)
-.15 E -.15(ex)-.7 G(tGetSelectionPos,).15 E F2(83)2.5 E F1(Xa)72 300 Q
(wT)-.15 E -.15(ex)-.7 G(tGetSource,).15 E F2(86)2.5 E F1(Xa)72 312 Q
(wT)-.15 E -.15(ex)-.7 G(tIn).15 E -.25(va)-.4 G(lidate,).25 E F2(84)2.5
E F1(Xa)72 324 Q(wT)-.15 E -.15(ex)-.7 G(tPosition,).15 E F2(82)2.5 E F1
(Xa)72 336 Q(wte)-.15 E(xtRead, 89, 93, 100)-.15 E(Xa)72 348 Q(wT)-.15 E
-.15(ex)-.7 G(tReplace, 72,).15 E F2(83)2.5 E F1(Xa)72 360 Q(wte)-.15 E
(xtResizeBoth, 90, 98)-.15 E(Xa)72 372 Q(wte)-.15 E
(xtResizeHeight, 90, 98)-.15 E(Xa)72 384 Q(wte)-.15 E(xtResizeNe)-.15 E
-.15(ve)-.25 G .8 -.4(r, 9).15 H(0, 98).4 E(Xa)72 396 Q(wte)-.15 E
(xtResizeW)-.15 E(idth, 90, 98)-.4 E(Xa)72 408 Q(wte)-.15 E(xtScrollAl)
-.15 E -.1(wa)-.1 G(ys, 90, 98).1 E(Xa)72 420 Q(wte)-.15 E(xtScrollNe)
-.15 E -.15(ve)-.25 G .8 -.4(r, 9).15 H(0, 98).4 E(Xa)72 432 Q(wte)-.15
E(xtScrollWhenNeeded, 90, 98)-.15 E(Xa)72 444 Q(wT)-.15 E -.15(ex)-.7 G
(tSearch,).15 E F2(84)2.5 E F1(Xa)72 456 Q(wT)-.15 E -.15(ex)-.7 G
(tSearchError).15 E 2.5(,1)-.4 G(02)-2.5 E(Xa)72 468 Q(wT)-.15 E -.15
(ex)-.7 G(tSetInsertionPoint,).15 E F2(85)2.5 E F1(Xa)72 480 Q(wT)-.15 E
-.15(ex)-.7 G(tSetSelection,).15 E F2(83)2.5 E F1(Xa)72 492 Q(wT)-.15 E
-.15(ex)-.7 G(tSetSelectionArray).15 E 2.5(,8)-.65 G(0,)-2.5 E F2(85)2.5
E F1(Xa)72 504 Q(wT)-.15 E -.15(ex)-.7 G(tSetSource,).15 E F2(86)2.5 E
F1(Xa)72 516 Q(wT)-.15 E -.15(ex)-.7 G(tSinkClearT).15 E
(oBackground, 103)-.8 E(Xa)72 528 Q(wT)-.15 E -.15(ex)-.7 G
(tSinkDisplayT).15 E -.15(ex)-.7 G(t, 103).15 E(Xa)72 540 Q(wT)-.15 E
-.15(ex)-.7 G(tSinkFindDistance, 103).15 E(Xa)72 552 Q(wT)-.15 E -.15
(ex)-.7 G(tSinkFindPosition, 103).15 E(Xa)72 564 Q(wT)-.15 E -.15(ex)-.7
G(tSinkGetCursorBounds, 103).15 E(Xa)72 576 Q(wT)-.15 E -.15(ex)-.7 G
(tSinkInsertCursor).15 E 2.5(,1)-.4 G(03)-2.5 E(Xa)72 588 Q(wT)-.15 E
-.15(ex)-.7 G(tSinkMaxHeight, 103).15 E(Xa)72 600 Q(wT)-.15 E -.15(ex)
-.7 G(tSinkMaxLines, 103).15 E(Xa)72 612 Q(wT)-.15 E -.15(ex)-.7 G
(tSinkResolv).15 E(e, 103)-.15 E(Xa)72 624 Q(wT)-.15 E -.15(ex)-.7 G
(tSinkSetT).15 E(abs, 103)-.8 E(Xa)72 636 Q(wT)-.15 E -.15(ex)-.7 G
(tSourceCon).15 E -.15(ve)-.4 G(rtSelection, 100).15 E(Xa)72 648 Q(wT)
-.15 E -.15(ex)-.7 G(tSourceRead, 100).15 E(Xa)72 660 Q(wT)-.15 E -.15
(ex)-.7 G(tSourceReplace, 100).15 E(Xa)72 672 Q(wT)-.15 E -.15(ex)-.7 G
(tSourceScan, 100).15 E(Xa)72 684 Q(wT)-.15 E -.15(ex)-.7 G
(tSourceSearch, 100).15 E(Xa)72 696 Q(wT)-.15 E -.15(ex)-.7 G
(tSourceSetSelection, 100).15 E(Xa)72 708 Q(wT)-.15 E -.15(ex)-.7 G(tT)
.15 E(opPosition, 85)-.8 E(Xa)72 720 Q(wT)-.15 E -.15(ex)-.7 G
(tUnsetSelection,).15 E F2(83)2.5 E F1(Xa)298 96 Q(wte)-.15 E
(xtWrapLine, 91, 99)-.15 E(Xa)298 108 Q(wte)-.15 E(xtWrapNe)-.15 E -.15
(ve)-.25 G .8 -.4(r, 9).15 H(1, 99).4 E(Xa)298 120 Q(wte)-.15 E(xtWrapW)
-.15 E(ord, 91, 99)-.8 E(Xa)298 132 Q(wT)-.15 E(oggleChangeRadioGroup,)
-.8 E F2(56)2.5 E F1(Xa)298 144 Q(wT)-.15 E(oggleGetCurrent,)-.8 E F2
(56)2.5 E F1(Xa)298 156 Q(wT)-.15 E(oggleSetCurrent,)-.8 E F2(56)2.5 E
F1(Xa)298 168 Q(wT)-.15 E(oggleUnsetCurrent,)-.8 E F2(57)2.5 E F1(Xa)298
180 Q(wT)-.15 E(reeF)-.35 E(orceLayout,)-.15 E F2(128)2.5 E F1(Xa)298
192 Q(wWMProtocols, 80)-.15 E(XA)298 204 Q(W_LIST_NONE, 32)-.9 E
(xrdb, 14)298 216 Q(XrmP)298 228 Q(arseCommand, 7)-.15 E(XtAddCallback,)
298 240 Q F2(12)2.5 E F1 2.5(,1)C(3)-2.5 E(XtAddCallbacks, 12)298 252 Q
(XtAppInitialize,)298 264 Q F2(6)2.5 E F1 2.5(,1)C(0, 13)-2.5 E
(XtAppMainLoop,)298 276 Q F2(10)2.5 E F1 2.5(,1)C(3)-2.5 E
(XtCallbackList,)298 288 Q F2(12)2.5 E F1(XtCallbackProc, 12)298 300 Q
(XtCallbackRec,)298 312 Q F2(12)2.5 E F1(XtCreateManagedW)298 324 Q
(idget,)-.4 E F2(7)2.5 E F1 2.5(,1)C(3)-2.5 E(XtCreateW)298 336 Q
(idget, 10, 12)-.4 E(XtDef)298 348 Q(aultBackground, 8, 9)-.1 E(XtDef)
298 360 Q(aultF)-.1 E(ore)-.15 E(ground, 8, 9)-.15 E(XtDestro)298 372 Q
(yW)-.1 E(idget,)-.4 E F2(11)2.5 E F1(XtError)298 384 Q 2.5(,7)-.4 G
(XtGetApplicationResources, 15)298 396 Q(XtGetV)298 408 Q(alues,)-1.11 E
F2(11)2.5 E F1 2.5(,1)C(2, 138)-2.5 E(XtInheritClearT)298 420 Q
(oBackground, 103, 104)-.8 E(XtInheritCon)298 432 Q -.15(ve)-.4 G
(rtSelection, 100).15 E(XtInheritDisplayT)298 444 Q -.15(ex)-.7 G
(t, 103).15 E(XtInheritFindDistance, 103)298 456 Q
(XtInheritFindPosition, 103)298 468 Q(XtInheritGetCursorBounds, 103)298
480 Q(XtInheritInsertCursor)298 492 Q 2.5(,1)-.4 G(03)-2.5 E
(XtInheritMaxHeight, 103)298 504 Q(XtInheritMaxLines, 103)298 516 Q
(XtInheritRead, 100)298 528 Q(XtInheritReplace, 100)298 540 Q
(XtInheritResolv)298 552 Q(e, 103)-.15 E(XtInheritScan, 100)298 564 Q
(XtInheritSearch, 100)298 576 Q(XtInheritSetSelection, 100)298 588 Q
(XtInheritSetT)298 600 Q(abs, 103)-.8 E(XtManageChildren,)298 612 Q F2
(10)2.5 E F1(XtMapW)298 624 Q(idget,)-.4 E F2(10)2.5 E F1(XtMo)298 636 Q
-.15(ve)-.15 G -.4(Wi).15 G(dget, 108).4 E(XtN,)298 648 Q F2(13)2.5 E F1
(XtNameT)298 660 Q(oW)-.8 E(idget, 114, 131)-.4 E(XtNcallback, 13)298
672 Q(XtNinput,)298 684 Q F2(5)2.5 E F1(XtNumber)298 696 Q 2.5(,1)-.4 G
(6, 17)-2.5 E(XtorientHorizontal, 43,)298 708 Q F2(110)2.5 E F1 2.5(,1)C
(21)-2.5 E(XtorientV)298 720 Q(ertical, 43,)-1.11 E F2(110)2.5 E F1 2.5
(,1)C(21)-2.5 E F0(144)280.5 756 Q 0 Cg EP
%%Page: 145 7
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Bold@0 SF(Athena W)72 60 Q(idget Set)-.18 E(libXaw 1.0.7)
298.57 E/F1 10/Times-Roman@0 SF(XtRealizeW)72 96 Q(idget, 7,)-.4 E/F2 11
/Times-Bold@0 SF(9)2.5 E F1 2.5(,1)C(0, 13)-2.5 E(XtResizeW)72 108 Q
(idget, 108)-.4 E(XtSetAr)72 120 Q(g,)-.18 E F2(16)2.5 E F1
(XtSetLanguageProc,)72 132 Q F2(6)2.5 E F1(XtSetMappedWhenManaged,)72
144 Q F2(10)2.5 E F1(XtSetV)72 156 Q(alues,)-1.11 E F2(11)2.5 E F1 2.5
(,1)C(2, 108, 133, 134)-2.5 E(XtW)72 168 Q(indo)-.4 E 1.3 -.65(w, 1)-.25
H(38).65 E/F3 12/Times-Bold@0 SF(_)72 192 Q F1(_in_out,)72 216 Q F2(3)
2.5 E F1(_return,)72 228 Q F2(3)2.5 E F0(145)280.5 756 Q 0 Cg EP
%%Trailer
end
%%EOF
0707010005615c000081a40000000000000000000000014c5c73b0000b98e00000010000010036ffffffffffffffff0000002d00000000root/usr/local/share/doc/libXaw/widgets.html

Permission is hereby granted,
free of charge, to any person obtaining a copy of this
software and associated documentation files (the
‘‘Software’’), to deal in the
Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute,
sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and
this permission notice shall be included in all copies or
substantial portions of the Software.

THE SOFTWARE IS PROVIDED
‘‘AS IS’’, WITHOUT WARRANTY OF ANY
KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE X
CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Except as contained in this
notice, the name of the X Consortium shall not be used in
advertising or otherwise to promote the sale, use or other
dealings in this Software without prior written
authorization from the X Consortium.

Permission to use, copy, modify
and distribute this documentation for any purpose and
without fee is hereby granted, provided that the above
copyright notice appears in all copies and that both that
copyright notice and this permission notice appear in
supporting documentation, and that the name of Digital not
be used in in advertising or publicity pertaining to
distribution of the software without specific, written prior
permission. Digital makes no representations about the
suitability of the software described herein for any
purpose. It is provided ‘‘as is’’
without express or implied warranty.

Acknowledgments

Many thanks go to Ralph
Swick (Project Athena / Digital) who has contributed much
time and effort to this widget set. Previous versions of the
widget set are largely due to his time and effort. Many of
the improvements that I have been able to make are because
he provided a solid foundation to build upon. While much of
the effort has been Ralph’s, many other people have
contributed to the code.

Putting this manual
together was a major task in and of itself. I would like to
thank Ralph Swick, Donna Converse, and Jim Fulton for taking
the time to help convert my technical knowledge into legible
text. A special thanks to Jean Diaz (O’Reilly and
Associates) for spending nearly a month with me working out
all the annoying little details.

Chris D. Peterson
MIT X Consortium 1989

The R5 edition of this
document has been edited by the research staff of the MIT X
Consortium, with significant contributions by Jim Fulton
(NCD).

Donna Converse
MIT X Consortium 1991

The R6 edition of this
document has been edited to reflect changes brought about by
research staff of the Omron Corporation, with special
recognition to Li Yuhong, Seiji Kuwari, and Hiroshi
Kuribayashi for the X11R5/contrib/lib/Xaw
internationalization that inspired this version.

Frank Sheeran
Omron Corporation 1994

Chapter
1

Athena Widgets
and The Intrinsics

The X Toolkit is made up
of two distinct pieces, the Xt Intrinsics and a widget set.
The Athena widget set is a sample implementation of a widget
set built upon the Intrinsics. In the X Toolkit, a widget is
the combination of an X window or subwindow and its
associated input and output semantics.

Because the Intrinsics
provide the same basic functionality to all widget sets it
may be possible to use widgets from the Athena widget set
with other widget sets based upon the Intrinsics. Since
widget sets may also implement private protocols, all
functionality may not be available when mixing and matching
widget sets. For information about the Intrinsics, see the
X Toolkit Intrinsics — C Language
Interface.

The Athena widget set is
a library package layered on top of the Intrinsics and Xlib
that provides a set of user interface tools sufficient to
build a wide variety of applications. This layer extends the
basic abstractions provided by X and provides the next layer
of functionality primarily by supplying a cohesive set of
sample widgets. Although the Intrinsics are a Consortium
standard, there is no standard widget set.

To the extent possible,
the Intrinsics are "policy-free". The application
environment and widget set, not the Intrinsics, define,
implement, and enforce:

•

Policy

•

Consistency

•

Style

Each individual widget
implementation defines its own policy. The X Toolkit design
allows for, but does not necessarily encourage, the free
mixing of radically differing widget
implementations.

1.1. Introduction to
the X Toolkit

The X Toolkit provides
tools that simplify the design of application user
interfaces in the X Window System programming environment.
It assists application programmers by providing a set of
common underlying user-interface functions. It also lets
widget programmers modify existing widgets, by subclassing,
or add new widgets. By using the X Toolkit in their
applications, programmers can present a similar user
interface across applications to all workstation
users.

The X Toolkit consists
of:

•

A set of Intrinsics functions for building
widgets

•

An architectural model for constructing
widgets

•

A widget set for application
programming

While the majority of the
Intrinsics functions are intended for the widget programmer,
a subset of the Intrinsics functions are to be used by
application programmers (see X Toolkit Intrinsics —
C Language Interface). The architectural model lets the
widget programmer design new widgets by using the Intrinsics
and by combining other widgets. The application interface
layers built on top of the X Toolkit include a coordinated
set of widgets and composition policies. Some of these
widgets and policies are specific to a single application
domain, and others are common to a variety of
applications.

The remainder of this
chapter discusses the X Toolkit and Athena widget
set:

•

Terminology

•

Model

•

Conventions used in this manual

•

Format of the Widget Reference
Chapters

1.2.
Terminology

In addition to the terms
already defined for X programming (see Xlib — C
Language X Interface), the following terms are specific
to the Intrinsics and Athena widget set and used throughout
this document.

Application
programmer

A
programmer who uses the X Toolkit to produce an application
user interface.

Child

A widget
that is contained within another "parent"
widget.

Class

The
general group to which a specific object
belongs.

Client

A
function that uses a widget in an application or for
composing other widgets.

FullName

The name
of a widget instance appended to the full name of its
parent.

Instance

A
specific widget object as opposed to a general widget
class.

Method

A
function or procedure implemented by a widget
class.

Name

The name
that is specific to an instance of a widget for a given
client. This name is specified at creation time and cannot
be modified.

Object

A data
abstraction consisting of private data and private and
public functions that operate on the private data. Users of
the abstraction can interact with the object only through
calls to the object’s public functions. In the X
Toolkit, some of the object’s public functions are
called directly by the application, while others are called
indirectly when the application calls the common Intrinsics
functions. In general, if a function is common to all
widgets, an application uses a single Intrinsics function to
invoke the function for all types of widgets. If a function
is unique to a single widget type, the widget exports the
function.

Parent

A widget
that contains at least one other ("child") widget.
A parent widget is also known as a composite
widget.

Resource

A named
piece of data in a widget that can be set by a client, by an
application, or by user defaults.

Superclass

A larger
class of which a specific class is a member. All members of
a class are also members of the superclass.

The
general group to which a specific widget belongs, otherwise
known as the type of the widget.

Widget
programmer

A
programmer who adds new widgets to the X
Toolkit.

1.3. Underlying
Model

The underlying
architectural model is based on the following
premises:

Widgets
are X windows

Every
user-interface widget is associated with an X
window. The X window ID for a widget is readily avail-
able from the widget. Standard Xlib calls can be used
by widgets for many of their input and output opera-
tions.

Information
hiding

The data
for every widget is private to the widget and
its subclasses. That is, the data is neither directly
accessible nor visible outside of the module implement-
ing the widget. All program interaction with the wid-
get is performed by a set of operations (methods) that
are defined for the widget.

Widget
semantics and widget layout geometry

Widget
semantics are clearly separated from widget lay-
out geometry. Widgets are concerned with implementing
specific user-interface semantics. They have little
control over issues such as their size or placement
relative to other widget peers. Mechanisms are provid-
ed for associating geometric managers with widgets and
for widgets to make suggestions about their own geome-
try.

1.4. Conventions Used
in this Manual

•

All resources available to the widgets are listed
with each widget. Many of these are available to more than
one widget class due to the object oriented nature of the
Intrinsics. The new resources for each widget are listed in
bold text, and the inherited resources are listed in plain
text.

•

Global symbols are printed in bold and can
be function names, symbols defined in include files, or
structure names. Arguments are printed in
italics.

•

Each function is introduced by a general
discussion that distinguishes it from other functions. The
function declaration itself follows, and each argument is
specifically explained. General discussion of the function,
if any is required, follows the arguments. Where applicable,
the last paragraph of the explanation lists the return
values of the function.

•

To eliminate any ambiguity between those
arguments that you pass and those that a function returns to
you, the explanations for all arguments that you pass start
with the word specifies or, in the case of multiple
arguments, the word specify. The explanations for all
arguments that are returned to you start with the word
returns or, in the case of multiple arguments, the
word return. The explanations for all arguments that
you can pass and are returned start with the words
specifies and returns.

•

Any pointer to a structure that is used to return
a value is designated as such by the _return suffix
as part of its name. All other pointers passed to these
functions are used for reading only. A few arguments use
pointers to structures that are used for both input and
output and are indicated by using the _in_out
suffix.

1.5. Format of the
Widget Reference Chapters

The majority of this
document is a reference guide for the Athena widget set.
Chapters three through six give the programmer all
information necessary to use the widgets. The layout of the
chapters follows a specific pattern to allow the programmer
to easily find the desired information.

The first few pages of
every chapter give an overview of the widgets in that
section. Widgets are grouped into chapters by
functionality.

Chapter
3
Simple Widgets

Chapter
4
Menus

Chapter
5
Text Widgets

Chapter
6
Composite and Constraint Widget

Following the
introduction will be a description of each widget in that
chapter. When no functional grouping is obvious the widgets
are listed in alphabetical order, such as in chapters three
and six.

The first section of each
widget’s description is a table that contains general
information about this widget class. Here is the table for
the Box widget, and an explanation of all the
entries.

Application Header
file<X11/Xaw/Box.h>

Class Header file

<X11/Xaw/BoxP.h>

Class

boxWidgetClass

Class Name

Box

Superclass

Composite

Application
Header File
This file must be included when an application uses this
widget. It usually contains the class definition, and some
resource macros. This is often called the
‘‘public’’ header file.

Class Header File

This file will only be used by widget
programmers. It will need to be included by any widget that
subclasses this widget. This is often called the
‘‘private’’ header file.

Class

This is the widget class of this widget. This
global symbol is passed to XtCreateWidget so that the
Intrinsics will know which type of widget to
create.

Class Name

This is the resource name of this class. This
name can be used in a resource file to match any widget of
this class.

Superclass

This is the superclass that this widget class is
descended from. If you understand how the superclass works
it will allow you to more quickly understand what this
widget does, since much of its functionality may be
inherited from its superclass.

After this table follows
a general description of the default behavior of this
widget, as seen by the user. In many cases this
functionality may be overridden by the application
programmer, or by the user.

The next section is a
table showing the name, class, type and default value of
each resource that is available to this widget. There is
also a column containing notes describing special
restrictions placed upon individual resources.

A

This resource may be automatically adjusted when
another resource is changed.

C

This resource is only settable at widget creation
time, and may not be modified with
XtSetValues.

D

Do not modify this resource. While setting this
resource will work, it can cause unexpected behavior. When
this symbol appears there is another, preferred, interface
provided by the X Toolkit.

R

This resource is READ-ONLY, and may not be
modified.

After the resource table
is a detailed description of every resource available to
that widget. Many of these are redundant, but printing them
with each widget saves page flipping. The names of the
resources that are inherited are printed in plain text,
while the names of the resources that are new to this class
are printed in bold. If you have already read the
description of the superclass you need only pay attention to
the resources printed in bold.

For each composite widget
there is a section on layout semantics that follows the
resource description. This section will describe the effect
of constraint resources on the layout of the children, as
well as a general description of where it prefers to place
its children.

Descriptions of default
translations and action routines come next, for widgets to
which they apply. The last item in each widget’s
documentation is the description of all convenience routines
provided by the widget.

1.6. Input
Focus

The Intrinsics define a
resource on all Shell widgets that interact with the window
manager called input. This resource requests the
assistance of window manager in acquiring the input focus.
The resource defaults to False in the Intrinsics, but
is redefined to default to True when an application
is using the Athena widget set. An application programmer
may override this default and set the resource back to
False if the application does not need the window
manager to give it the input focus. See the X Toolkit
Intrinsics — C Language Interface for details on
the input resource.

Chapter
2

Using
Widgets

Widgets serve as the
primary tools for building a user interface or application
environment. The Athena widget set consists of primitive
widgets that contain no children (for example, a command
button) and composite widgets which may contain one or more
widget children (for example, a Box widget).

The remaining chapters
explain the widgets that are provided by the Athena widget
set. These user-interface components serve as an interface
for application programmers who do not want to implement
their own widgets. In addition, they serve as a starting
point for those widget programmers who, using the Intrinsics
mechanisms, want to implement alternative application
programming interfaces.

This chapter is a brief
introduction to widget programming. The examples provided
use the Athena widgets, though most of the concepts will
apply to all widget sets. Although there are several
programming interfaces to the X Toolkit, only one is
described here. A full description of the programming
interface is provided in the document X Toolkit
Intrinsics — C Language Interface.

2.1. Setting the
Locale

If it is desirable that
the application take advantage of internationalization
(i18n), you must establish locale with
XtSetLanguageProc before XtDisplayInitialize
or XtAppInitialize is called. For full details,
please refer to the document X Toolkit Intrinsics —
C Language Interface, section 2.2. However, the
following simplest-case call is sufficient in many or most
applications.

XtSetLanguageProc(NULL, NULL, NULL);

Most notably, this will
affect the Standard C locale, determine which resource files
will be loaded, and what fonts will be required of FontSet
specifications. In many cases, the addition of this line is
the only source change required to internationalize Xaw
programs, and will not disturb the function of programs in
the default "C" locale.

2.2. Initializing the
Toolkit

You must call a toolkit
initialization function before invoking any other toolkit
routines (besides locale setting, above).
XtAppInitialize opens the X server connection, parses
the command line, and creates an initial widget that will
serve as the root of a tree of widgets created by this
application.
Widget XtAppInitialize(app_context_return,
application_class, options,
num_options,

application_class
Specifies the class name of this application, which is
usually the generic name for all instances of this
application. A useful convention is to form the class name
by capitalizing the first letter of the application name.
For example, the application named
‘‘xman’’ has a class name of
‘‘Xman’’.

options

Specifies how to parse the command line for any
application-specific resources. The options argument is
passed as a parameter to XrmParseCommand. For further
information, see Xlib — C Language X
Interface.

num_options

Specifies the number of entries in the options
list.

argc_in_out

Specifies a pointer to the number of command line
parameters.

argv_in_out

Specifies the command line
parameters.

fallback_resources
Specifies resource values to be used if the site-wide
application class defaults file cannot be opened, or
NULL.

args

Specifies the argument list to use when creating
the Application shell.

num_args

Specifies the number of arguments in
args.

This function will remove
the command line arguments that the toolkit reads from
argc_in_out, and argv_in_out. It will then
attempt to open the display. If the display cannot be
opened, an error message is issued and XtAppInitialize
terminates the application. Once the display is opened, all
resources are read from the locations specified by the
Intrinsics. This function returns an ApplicationShell widget
to be used as the root of the application’s widget
tree.

2.3. Creating a
Widget

Creating a widget is a
three-step process. First, the widget instance is allocated,
and various instance-specific attributes are set by using
XtCreateWidget. Second, the widget’s parent is
informed of the new child by using XtManageChild.
Finally, X windows are created for the parent and all its
children by using XtRealizeWidget and specifying the
top-most widget. The first two steps can be combined by
using XtCreateManagedWidget. In addition,
XtRealizeWidget is automatically called when the
child becomes managed if the parent is already
realized.

Specifies the instance name for the created
widget that is used for retrieving widget
resources.

widget_class
Specifies the widget class pointer for the created
widget.

parent

Specifies the parent widget ID.

args

Specifies the argument list. The argument list is
a variable-length list composed of name and value pairs that
contain information pertaining to the specific widget
instance being created. For further information, see Section
2.7.2.

num_args

Specifies the number of arguments in the argument
list. If the num_args is zero, the argument list is never
referenced.

When a widget instance is
successfully created, the widget identifier is returned to
the application. If an error is encountered, the
XtError routine is invoked to inform the user of the
error.

Although a widget can
have unique arguments that it understands, all widgets have
common arguments that provide some regularity of operation.
The common arguments allow arbitrary widgets to be managed
by higher-level components without regard for the individual
widget type. Widgets will ignore any argument that they do
not understand.

The following additional
resources are retrieved from the argument list or from the
resource database by many of the Athena widgets:
Name Class Type Default Value
callback Callback XtCallbackList NULL
cursor Cursor Cursor widget dependent
foreground Foreground Pixel XtDefaultForeground
insensitiveBorder Insensitive Pixmap
GreyPixmap

2.5. Resource
Conversions

Most resources in the
Athena widget set have a converter registered that will
translate the string in a resource file to the correct
internal representation. While some are obvious (string to
integer, for example), others need specific mention of the
allowable values. Three general converters are described
here:

•

Cursor

•

Pixel

•

Bitmap

Many widgets have defined
special converters that apply only to that widget. When
these occur, the documentation section for that widget will
describe the converter.

2.5.1. Cursor
Conversion

The value for the
cursorName resource is specified in the resource
database as a string, and is of the following
forms:

•

A standard X cursor name from <
X11/cursorfont.h >. The names in cursorfont.h
each describe a specific cursor. The resource names for
these cursors are exactly like the names in this file except
the XC_ is not used. The cursor definition
XC_gumby has a resource name of
gumby.

•

Glyphs, as in FONT font-name glyph-index [[
font-name ] glyph-index ]. The first font and glyph
specify the cursor source pixmap. The second font and glyph
specify the cursor mask pixmap. The mask font defaults to
the source font, and the mask glyph index defaults to the
source glyph index.

•

A relative or absolute file name. If a relative
or absolute file name is specified, that file is used to
create the source pixmap. Then the string "Mask"
is appended to locate the cursor mask pixmap. If the
"Mask" file does not exist, the suffix
"msk" is tried. If "msk" fails, no
cursor mask will be used. If the filename does not start
with ’/’ or ’./’ the the bitmap file
path is used (see section 2.4.3).

2.5.2. Pixel
Conversion

The string-to-pixel
converter takes any name that is acceptable to XParseColor
(see Xlib — C Language X Interface). In
addition this routine understands the special toolkit
symbols ‘XtDefaultForeground’ and
‘XtDefaultBackground’, described in X Toolkit
Intrinsics — C Language Interface. In short the
acceptable pixel names are:

•

Any color name for the rgb.txt file (typically in
the directory /usr/lib/X11 on POSIX systems).

•

A numeric specification of the form
#<red><green><blue> where these numeric
values are hexadecimal digits (both upper and lower
case).

•

The special strings
‘XtDefaultForeground’ and
‘XtDefaultBackground’

2.5.3. Bitmap
Conversion

The string-to-bitmap
converter attempts to locate a file containing bitmap data
whose name is specified by the input string. If the file
name is relative (i.e. does not begin with / or ./), the
directories to be searched are specified in the
bitmapFilePath resource--class BitmapFilePath.
This resource specifies a colon (:) separated list of
directories that will be searched for the named bitmap or
cursor glyph (see section 2.4.1). The bitmapFilePath
resource is global to the application, and may not be
specified differently for each widget that wishes to convert
a cursor to bitmap. In addition to the directories specified
in the bitmapFilePath resource a default directory is
searched. When using POSIX the default directory is
/usr/include/X11/bitmaps.

2.6. Realizing a
Widget

The
XtRealizeWidget function performs two
tasks:

•

Calculates the geometry constraints of all
managed descendants of this widget. The actual calculation
is put off until realize time for performance
reasons.

•

Creates an X window for the widget and, if it is
a composite widget, realizes each of its managed
children.

void XtRealizeWidget(w)
Widget w;

w

Specifies the widget.

For further information
about this function, see the X Toolkit Intrinsics —
C Language Interface.

2.7. Processing
Events

Now that the application
has created, managed and realized its widgets, it is ready
to process the events that will be delivered by the X Server
to this client. A function call that will process the events
is XtAppMainLoop.
void XtAppMainLoop(app_context)
XtAppContext app_context;

app_contextSpecifies
the application context of this application. The value is
normally returned by XtAppInitialize.

This function never
returns: it is an infinite loop that processes the X events.
User input can be handled through callback procedures and
application defined action routines. More details are
provided in X Toolkit Intrinsics — C Language
Interface.

2.8. Standard Widget
Manipulation Functions

After a widget has been
created, a client can interact with that widget by calling
one of the standard widget manipulation routines provided by
the Intrinsics, or a widget class-specific manipulation
routine.

The Intrinsics provide
generic routines to give the application programmer access
to a set of standard widget functions. The common widget
routines let an application or composite widget perform the
following operations on widgets without requiring explicit
knowledge of the widget type.

•

Control the mapping of widget windows

•

Destroy a widget instance

•

Obtain an argument value

•

Set an argument value

2.8.1. Mapping
Widgets

By default, widget
windows are mapped (made viewable) automatically by
XtRealizeWidget. This behavior can be disabled by
using XtSetMappedWhenManaged, making the client
responsible for calling XtMapWidget to make the
widget viewable.
void XtSetMappedWhenManaged(w,
map_when_managed)
Widget w;
Boolean map_when_managed;

w

Specifies the widget.

map_when_managed
Specifies the new value. If map_when_managed is True,
the widget is mapped automatically when it is realized. If
map_when_managed is False, the client must call
XtMapWidget or make a second call to
XtSetMappedWhenManaged to cause the child window to
be mapped.

The definition for
XtMapWidget is:
void XtMapWidget(w)
Widget w;

w

Specifies the widget.

When you are creating
several children in sequence for a previously realized
common parent it is generally more efficient to construct a
list of children as they are created (using
XtCreateWidget) and then use XtManageChildren
to request that their parent managed them all at once. By
managing a list of children at one time, the parent can
avoid wasteful duplication of geometry processing and the
associated ‘‘screen flash’’.
void XtManageChildren(children, num_children)
WidgetList children;
Cardinal num_children;

children

Specifies a list of children to add.

num_children
Specifies the number of children to add.

If the parent is already
visible on the screen, it is especially important to batch
updates so that the minimum amount of visible window
reconfiguration is performed.

For further information
about these functions, see the X Toolkit Intrinsics
— C Language Interface.

2.8.2. Destroying
Widgets

To destroy a widget
instance of any type, use XtDestroyWidget.
void XtDestroyWidget(w)
Widget w;

w

Specifies the widget.

XtDestroyWidget
destroys the widget and recursively destroys any children
that it may have, including the windows created by its
children. After calling XtDestroyWidget, no further
references should be made to the widget or any children that
the destroyed widget may have had.

2.8.3. Retrieving
Widget Resource Values

To retrieve the current
value of a resource attribute associated with a widget
instance, use XtGetValues.
void XtGetValues(w, args, num_args)
Widget w;
ArgList args;
Cardinal num_args;

w

Specifies the widget.

args

Specifies a variable-length argument list of name
and address pairs that contain the resource name and
the address into which the resource value is
stored.

num_args

Specifies the number of arguments in the argument
list.

The arguments and values
passed in the argument list are dependent on the widget.
Note that the caller is responsible for providing space into
which the returned resource value is copied; the
ArgList contains a pointer to this storage (e.g. x
and y must be allocated as Position). For further
information, see the X Toolkit Intrinsics — C
Language Interface.

2.8.4. Modifying
Widget Resource Values

To modify the current
value of a resource attribute associated with a widget
instance, use XtSetValues.
void XtSetValues(w, args, num_args)
Widget w;
ArgList args;
Cardinal num_args;

w

Specifies the widget.

args

Specifies an array of name and value pairs
that contain the arguments to be modified and their new
values.

num_args

Specifies the number of arguments in the argument
list.

The arguments and values
that are passed will depend on the widget being modified.
Some widgets may not allow certain resources to be modified
after the widget instance has been created or realized. No
notification is given if any part of a XtSetValues
request is ignored.

For further information
about these functions, see the X Toolkit Intrinsics
— C Language Interface.

Note

The argument list entry
for XtGetValues specifies the address to which the
caller wants the value copied. The argument list entry for
XtSetValues, however, contains the new value itself,
if the size of value is less than sizeof(XtArgVal)
(architecture dependent, but at least sizeof(long));
otherwise, it is a pointer to the value. String resources
are always passed as pointers, regardless of the length of
the string.

2.9. Using the Client
Callback Interface

Widgets can communicate
changes in their state to their clients by means of a
callback facility. The format for a client’s callback
handler is:
void CallbackProc(w, client_data,
call_data)
Widget w;
XtPointer client_data;
XtPointer call_data;

w

Specifies widget for which the callback is
registered.

client_dataSpecifies
arbitrary client-supplied data that the widget should pass
back to the client when the widget executes the
client’s callback procedure. This is a way for the
client registering the callback to also register
client-specific data: a pointer to additional information
about the widget, a reason for invoking the callback, and so
on. If no additional information is necessary, NULL may be
passed as this argument. This field is also frequently known
as the closure.

call_data

Specifies any callback-specific data the widget
wants to pass to the client. For example, when Scrollbar
executes its jumpProc callback list, it passes the
current position of the thumb in
call_data.

Callbacks can be
registered either by creating an argument containing the
callback list described below or by using the special
convenience routines XtAddCallback and
XtAddCallbacks. When the widget is created, a pointer
to a list of callback procedure and data pairs can be passed
in the argument list to XtCreateWidget. The list is
of type XtCallbackList:

typedef struct
{

XtCallbackProc callback;

XtPointer closure;

} XtCallbackRec, *XtCallbackList;

The callback list must be
allocated and initialized before calling
XtCreateWidget. The end of the list is identified by
an entry containing NULL in callback and closure. Once the
widget is created, the client can change or de-allocate this
list; the widget itself makes no further reference to it.
The closure field contains the client_data passed to the
callback when the callback list is executed.

The second method for
registering callbacks is to use XtAddCallback after
the widget has been created.
void XtAddCallback(w, callback_name, callback,
client_data)
Widget w;
String callback_name;
XtCallbackProc callback;
XtPointer client_data;

w

Specifies the widget to add the callback
to.

callback_name
Specifies the callback list within the widget to append
to.

callback

Specifies the callback procedure to
add.

client_dataSpecifies
the data to be passed to the callback when it is
invoked.

XtAddCallback adds
the specified callback to the list for the named
widget.

All widgets provide a
callback list named destroyCallback where clients can
register procedures that are to be executed when the widget
is destroyed. The destroy callbacks are executed when the
widget or an ancestor is destroyed. The call_data
argument is unused for destroy callbacks.

2.10. Programming
Considerations

This section provides
some guidelines on how to set up an application program that
uses the X Toolkit.

2.10.1. Writing
Applications

When writing an
application that uses the X Toolkit, you should make sure
that your application performs the following:

1.

Include <X11/Intrinsic.h> in your
application programs. This header file automatically
includes <X11/Xlib.h>, so all Xlib functions
also are defined. It may also be necessary to include
< X11/StringDefs.h > when setting up argument
lists, as many of the XtNsomething definitions are
only defined in this file.

2.

Include the widget-specific header files for each
widget type that you need to use. For example,
<X11/Xaw/Label.h> and
<X11/Xaw/Command.h>.

3.

Call the XtAppInitialize function before
invoking any other toolkit or Xlib functions. For further
information, see Section 2.1 and the X Toolkit Intrinsics
— C Language Interface.

4.

To pass attributes to the widget creation
routines that will override any site or user customizations,
set up argument lists. In this document, a list of valid
argument names is provided in the discussion of each widget.
The names each have a global symbol defined that begins with
XtN to help catch spelling errors. For example,
XtNlabel is defined for the label resource of
many widgets.

For
further information, see Section 2.9.2.2.

5.

When the argument list is set up, create the
widget with the XtCreateManagedWidget function. For
further information, see Section 2.2 and the X Toolkit
Intrinsics — C Language Interface.

6.

If the widget has any callback routines, set by
the XtNcallback argument or the XtAddCallback
function, declare these routines within the
application.

7.

After creating the initial widget hierarchy,
windows must be created for each widget by calling
XtRealizeWidget on the top level widget.

8.

Most applications now sit in a loop processing
events using XtAppMainLoop, for example:

The Intrinsics support
two methods of changing the default resource values; the
resource manager, and an argument list passed into
XtCreateWidget. While resources values will get updated no
matter which method you use, the two methods provide
slightly different functionality.

Resource
ManagerThis method picks up resource definitions described
in Xlib — C Language X Interface from many
different locations at run time. The locations most
important to the application programmer are the fallback
resources and the app-defaults file, (see X
Toolkit Intrinsics — C Language Interface for the
complete list). Since these resource are loaded at run time,
they can be overridden by the user, allowing an application
to be customized to fit the particular needs of each
individual user. These values can also be modified without
the need to rebuild the application, allowing rapid
prototyping of user interfaces. Application programmers
should use resources in preference to hard-coded values
whenever possible.

Argument Lists

The values passed into the widget at creation
time via an argument list cannot be modified by the user,
and allow no opportunity for customization. It is used to
set resources that cannot be specified as strings (e.g.
callback lists) or resources that should not be overridden
(e.g. window depth) by the user.

2.10.2.1. Specifying
Resources

It is important for all X
Toolkit application programmers to understand how to use the
X Resource Manager to specify resources for widgets in an X
application. This section will describe the most common
methods used to specify these resources, and how to use the
X Resource manager.

Xrdb

The xrdb utility may be used to load a
file containing resources into the X server. Once the
resources are loaded, the resources will affect any new
applications started on the display that they were loaded
onto.

Application
Defaults
The application defaults (app-defaults) file (normally in
/usr/lib/X11/app-defaults/classname) for an
application is loaded whenever the application is
started.

The resource
specification has two colon-separated parts, a name, and a
value. The value is a string whose format is
dependent on the resource specified by name.
Name is constructed by appending a resource name to a
full widget name.

The full widget name is a
list of the name of every ancestor of the desired widget
separated by periods (.). Each widget also has a class
associated with it. A class is a type of widget (e.g. Label
or Scrollbar or Box). Notice that class names, by
convention, begin with capital letters and instance names
begin with lower case letters. The class of any widget may
be used in place of its name in a resource specification.
Here are a few examples:

xman.form.button1
This is a fully specified resource name, and will affect
only widgets called button1 that are children of widgets
called form that are children of applications named xman.
(Note that while typically two widgets that are siblings
will have different names, it is not
prohibited.)

Xman.Form.Command
This will match any Command widget that is a child of a Form
widget that is itself a child of an application of class
Xman.

Xman.Form.button1
This is a mixed resource name with both widget names and
classes specified.

This syntax allows an
application programmer to specify any widget in the widget
tree. To match more than one widget (for example a user may
want to make all Command buttons blue), use an asterisk (*)
instead of a period. When an asterisk is used, any number of
widgets (including zero) may exist between the two widget
names. For example:

Xman*Command

This matches all Command widgets in the Xman
application.

Foo*button1

This matches any widget in the Foo application
that is named button1.

The root of all
application widget trees is the widget returned by
XtAppInitialize. Even though this is actually an
ApplicationShell widget, the toolkit replaces its widget
class with the class name of the application. The name of
this widget is either the name used to invoke the
application (argv[0]) or the name of the application
specified using the standard -name command line
option supported by the Intrinsics.

The last step in
constructing the resource name is to append the name of the
resource with either a period or asterisk to the full or
partial widget name already constructed.

*foreground:Blue

Specifies that all widgets in all applications
will have a foreground color of blue.

Xman*borderWidth:10

Specifies that all widgets in an application
whose class is Xman will have a border width of 10
(pixels).

xman.form.button1.label:Testing
Specifies that a particular widget in the xman application
will have a label named Testing.

An exclamation point (!)
in the first column of a line indicates that the rest of the
line should be treated as a comment.

Final
Words

The Resource manager is a
powerful tool that can be used very effectively to customize
X Toolkit applications at run time by either the application
programmer or the user. Some final points to
note:

•

An application programmer may add new resources
to their application. These resources are associated with
the global application, and not any particular widget. The X
Toolkit function used for adding the application resources
is XtGetApplicationResources.

•

Be careful when creating resource files. Since
widgets will ignore resources that they do not understand,
any spelling errors will cause a resource to have no
effect.

•

Only one resource line will match any given
resource. There is a set of precedence rules, which take the
following general stance.

•

More specific overrides less specific, thus
period always overrides asterisk.

•

Names on the left are more specific and override
names on the right.

•

When resource specifications are exactly the
same, user defaults

will override program defaults.

For a complete
explanation of the rules of precedence, and other specific
topics see X Toolkit Intrinsics — C Language
Interface and Xlib — C Language X
Interface.

2.10.2.2. Creating
Argument Lists

To set up an argument
list for the inline specification of widget attributes, you
may use any of the four approaches discussed in this
section. Each resource name has a global symbol associated
with it. This global symbol has the form XtNresource
name. For example, the symbol for
‘‘foreground’’ is
XtNforeground. For further information, see the X
Toolkit Intrinsics — C Language
Interface.

Argument are specified by
using the following structure:

typedef struct
{

String name;

XtArgVal value;

} Arg, *ArgList;

The first approach is to
statically initialize the argument list. For
example:

static Arg arglist[] =
{

{XtNwidth, (XtArgVal) 400},

{XtNheight, (XtArgVal) 300},

};

This approach is
convenient for lists that do not need to be computed at
runtime and makes adding or deleting new elements easy. The
XtNumber macro is used to compute the number of
elements in the argument list, preventing simple programming
errors:

Note that in this
example, as in the previous example, XtNumber would
return 10, not 2, and therefore would not be
useful.

The fourth approach is to
use a mixture of the first and third approaches: you can
statically define the argument list but modify some entries
at runtime. For example:

static Arg arglist[] =
{

{XtNwidth, (XtArgVal) 400},

{XtNheight, (XtArgVal) NULL},

};
arglist[1].value = (XtArgVal) 300;

In this example,
XtNumber can be used, as in the first approach, for
easier code maintenance.

2.11. Example
Programs

The best way to
understand how to use any programming library is by trying
some simple examples. A collection of example programs that
introduces each of the widgets in that Athena widget set, as
well as many important toolkit programming concepts, is
available in the X11R6 release as distributed by the X
Consortium. It can be found in the distribution directory
contrib/examples/mit/Xaw, but see your site
administrator for the exact location of these files on your
system. See the README file from that directory for a guide
to the examples.

Chapter
3

Simple
Widgets

Each of these widgets
performs a specific user interface function. They are
simple because they cannot have widget
children—they may only be used as leaves of the widget
tree. These widgets display information or take user
input.

Command

A push button that, when selected, may cause a
specific action to take place. This widget can display a
multi-line string or a bitmap or pixmap image.

Grip

A rectangle that, when selected, will cause an
action to take place.

Label

A rectangle that can display a multi-line string
or a bitmap or pixmap image.

List

A list of text strings presented in row column
format that may be individually selected. When an element is
selected an action may take place.

Panner

A rectangular area containing a slider
that may be moved in two dimensions. Notification of
movement may be continuous or discrete.

Repeater

A push button that triggers an action at an
increasing rate when selected. This widget can display a
multi-line string or a bitmap or pixmap image.

Scrollbar

A rectangular area containing a thumb that
when slid along one dimension may cause a specific action to
take place. The Scrollbar may be oriented horizontally or
vertically.

Simple

The base class for most of the simple widgets.
Provides a rectangular area with a settable mouse cursor and
special border.

StripChartA
real time data graph that will automatically update and
scroll.

Toggle

A push button that contains state information.
Toggles may also be used as ‘‘radio
buttons’’ to implement a ‘‘one of
many’’ or ‘‘zero or one of
many’’ group of buttons. This widget can display
a multi-line string or a bitmap or pixmap image.

3.1. Command
Widget

Application header
file<X11/Xaw/Command.h>

Class header file

<X11/Xaw/CommandP.h>

Class

commandWidgetClass

Class Name

Command

Superclass

Label

The Command widget is an
area, often rectangular, that contains text or a graphical
image. Command widgets are often referred to as
‘‘push buttons.’’ When the pointer
is over a Command widget, the widget becomes highlighted by
drawing a rectangle around its perimeter. This highlighting
indicates that the widget is ready for selection. When mouse
button 1 is pressed, the Command widget indicates that it
has been selected by reversing its foreground and background
colors. When the mouse button is released, the Command
widget’s notify action is invoked, calling all
functions on its callback list. If the pointer is moved off
of the widget before the pointer button is released, the
widget reverts to its normal foreground and background
colors, and releasing the pointer button has no effect. This
behavior allows the user to cancel an action.

A list of event to action bindings to be executed
by this widget, even though the event occurred in another
widget. (See the X Toolkit Intrinsics — C Language
Interface for details).

ancestorSensitive
The sensitivity state of the ancestors of this widget. A
widget is insensitive if either it or any of its ancestors
is insensitive. This resource should not be changed with
XtSetValues, although it may be queried.

background

A pixel value which indexes the widget’s
colormap to derive the background color of the
widget’s window.

backgroundPixmapThe
background pixmap of this widget’s window. If this
resource is set to anything other than
XtUnspecifiedPixmap, the pixmap specified will be
used instead of the background color.

bitmap

A bitmap to display instead of the label.
The default size of the widget will be just large enough to
contain the bitmap and the widget’s internal width and
height. The resource converter for this resource constructs
bitmaps from the contents of files. (See Converting
Bitmaps for details.) If this bitmap is one bit deep
then the 1’s will be rendered in the foreground color,
and the 0’s in the background color. If bitmap
has a depth greater than one, it is copied directly into the
window.

borderColor

A pixel value which indexes the widget’s
colormap to derive the border color of the widget’s
window.

borderPixmap

The border pixmap of this widget’s window.
If this resource is set to anything other than
XtUnspecifiedPixmap, the pixmap specified will be
used instead of the border color.

borderWidth

The width of this widget’s window
border.

callback

A list of routines to be called when the
notify action is invoked.

colormap

The colormap that this widget will
use.

cornerRoundPercent
When a ShapeStyle of roundedRectangle is used,
this resource controls the radius of the rounded corner. The
radius of the rounded corners is specified as a percentage
of the length of the shortest side of the
widget.

cursor

The image that will be displayed as the pointer
cursor whenever it is in this widget. The use of this
resource is deprecated in favor of
cursorName.

cursorName

The name of the symbol to use to represent the
pointer cursor. This resource will override the
cursor resource if both are specified. (See
2.4.1)

depth

The depth of this widget’s
window.

destroyCallbackAll
functions on this list are called when this widget is
destroyed.

encoding

The encoding method used by the value of the
label resource. The value may be
XawTextEncoding8bit or XawTextEncodingChar2b.
When international is set to true this
resource is not used.

font

The text font to use when displaying the
label, when the international resource is
false.

fontSet

The text font set to use when displaying the
label, when the international resource is
true.

foreground

A pixel value which indexes the widget’s
colormap to derive the foreground color of the
widget’s window. This color is also used to render all
1’s in a bitmap one plane deep.

height

width

The height and width of this widget in
pixels.

highlightThickness
The thickness of the rectangle that is used to highlight the
internal border of this widget, alerting the user that it is
ready to be selected. The default value is 2 pixels if the
shapeStyle is rectangle, and 0 Pixels (no
highlighting) otherwise.

insensitiveBorder
This pixmap will be tiled into the widget’s border if
the widget becomes insensitive.

internalHeight

internalWidth

The minimum amount of space to leave between the
graphic and the vertical and horizontal edges of the
window.

international

This is a boolean flag, only settable at widget
creation time. A value of false signals the widget to
use pre-R6 internationalization (specifically, the lack
thereof), such as using fonts for displaying text, etc. A
value of true directs the widget to act in an
internationalized manner, such as utilizing font sets for
displaying text, etc.

justify

Specifies left, center, or right alignment of
graphic within the widget. This resource may be specified
with the values XtJustifyLeft,
XtJustifyCenter, or XtJustifyRight. A
converter is registered for this resource that will convert
the following strings: left, right, and
center. This resource only has noticeable effect when
the width of the widget is larger than necessary to display
the graphic. Note that when the graphic is a multi-line
label, the longest line will obey this justification
while shorter lines will be left-justified with the longest
one.

label

Specifies the text string to be displayed in the
widget’s window if no bitmap is specified. The default
is the name of this widget. Regardless of the value of
encoding or international, a single newline
character (1 byte) will cause a line break.

leftBitmap

Specifies a bitmap to display to the left of the
graphic in the widget’s window.

mappedWhenManaged
If this resource is True, then the widget’s
window will automatically be mapped by the Toolkit when it
is realized and managed.

pointerColor

A pixel value which indexes the widget’s
colormap to derive the foreground color of the pointer
symbol specified by the cursorName
resource.

pointerColorBackground
A pixel value which indexes the widget’s colormap to
derive the background color of the pointer symbol specified
by the cursorName resource.

resize

Specifies whether the widget should attempt to
resize to its preferred dimensions whenever its resources
are modified with XtSetValues. This attempt to resize
may be denied by the parent of this widget. The parent is
always free to resize the widget regardless of the state of
this resource.

screen

The screen on which this widget is displayed.
This is not a settable resource.

sensitive

Whether or not the toolkit should pass user
events to this widget. The widget will not get input events
if either ancestorSensitive or sensitive is
False.

shapeStyle

Nonrectangular widgets may be created using this
resource. Nonrectangular widgets are supported only on a
server that supports the Shape Extension. If
nonrectangular widgets are specified for a server lacking
this extension, the shape is ignored and the widgets will be
rectangular. The following shapes are currently supported:
XmuShapeRectangle, XmuShapeOval,
XmuShapeEllipse, and XmuShapeRoundedRectangle.
A converter is registered for this resource that will
convert the following strings: rectangle, oval,
ellipse, and roundedRectangle.

translations

The event bindings associated with this
widget.

x

y

The location of the upper left outside corner of
this widget in its parent.

3.1.2. Command
Actions

The Command widget
supports the following actions:

•

Switching the button’s interior between the
foreground and background colors with set,
unset, and reset.

•

Processing application callbacks with
notify

•

Switching the internal border between highlighted
and unhighlighted states with highlight and
unhighlight

The following are the
default translation bindings used by the Command
widget:

<EnterWindow>:

highlight()

<LeaveWindow>:

reset()

<Btn1Down>:

set()

<Btn1Up>:

notify() unset()

The full list of actions
supported by Command is:

highlight(condition)
Displays the internal highlight border in the color
(foreground or background ) that contrasts
with the interior color of the Command widget. The
conditions WhenUnset and Always are understood
by this action procedure. If no argument is passed,
WhenUnset is assumed.

unhighlight()

Displays the internal highlight border in the
color (foreground or background ) that matches
the interior color of the Command widget.

set()

Enters the set state, in which
notify is possible. This action causes the button to
display its interior in the foreground color. The
label or bitmap is displayed in the background
color.

unset()

Cancels the set state and displays the
interior of the button in the background color. The
label or bitmap is displayed in the foreground
color.

reset()

Cancels any set or highlight and
displays the interior of the button in the background
color, with the label or bitmap displayed in the
foreground color.

notify()

When the button is in the set state this
action calls all functions in the callback list named by the
callback resource. The value of the call_data
argument passed to these functions is undefined.

A very common alternative
to registering callbacks is to augment a Command’s
translations with an action performing the desired function.
This often takes the form of:

*Myapp*save.translations:
#augment <Btn1Down>,<Btn1Up>: Save()

Note

When a bitmap of depth
greater that one (1) is specified the set(),
unset(), and reset() actions have no effect,
since there are no foreground and background colors used in
a multi-plane pixmap.

3.2. Grip
Widget

Application header
file<X11/Xaw/Grip.h>

Class header file

<X11/Xaw/GripP.h>

Class

gripWidgetClass

Class Name

Grip

Superclass

Simple

The Grip widget provides
a small rectangular region in which user input events (such
as ButtonPress or ButtonRelease) may be handled. The most
common use for the Grip widget is as an attachment point for
visually repositioning an object, such as the pane border in
a Paned widget.

A list of event to action bindings to be executed
by this widget, even though the event occurred in another
widget. (See the X Toolkit Intrinsics — C Language
Interface for details).

ancestorSensitive
The sensitivity state of the ancestors of this widget. A
widget is insensitive if either it or any of its ancestors
is insensitive. This resource should not be changed with
XtSetValues, although it may be queried.

background

A pixel value which indexes the widget’s
colormap to derive the background color of the
widget’s window.

backgroundPixmapThe
background pixmap of this widget’s window. If this
resource is set to anything other than
XtUnspecifiedPixmap, the pixmap specified will be
used instead of the background color.

borderColor

A pixel value which indexes the widget’s
colormap to derive the border color of the widget’s
window.

borderPixmap

The border pixmap of this widget’s window.
If this resource is set to anything other than
XtUnspecifiedPixmap, the pixmap specified will be
used instead of the border color.

borderWidth

The width of this widget’s window
border.

callback

All routines on this list are called whenever the
GripAction action routine is invoked. The
call_data contains all information passed to the
action routine. A detailed description is given below in the
Grip Actions section.

colormap

The colormap that this widget will
use.

cursor

The image that will be displayed as the pointer
cursor whenever it is in this widget. The use of this
resource is deprecated in favor of
cursorName.

cursorName

The name of the symbol to use to represent the
pointer cursor. This resource will override the
cursor resource if both are specified. (See
2.4.1)

depth

The depth of this widget’s
window.

destroyCallbackAll
functions on this list are called when this widget is
destroyed.

foreground

A pixel value which indexes the widget’s
colormap to derive the color used to flood fill the entire
Grip widget.

height

width

The height and width of this widget in
pixels.

insensitiveBorder
This pixmap will be tiled into the widget’s border if
the widget becomes insensitive.

international

This is a boolean flag, only settable at widget
creation time. While not utilized in this widget, it can and
should be checked by any subclasses that have behavior that
should vary with locale.

mappedWhenManaged
If this resource is True, then the widget’s
window will automatically be mapped by the Toolkit when it
is realized and managed.

pointerColor

A pixel value which indexes the widget’s
colormap to derive the foreground color of the pointer
symbol specified by the cursorName
resource.

pointerColorBackground
A pixel value which indexes the widget’s colormap to
derive the background color of the pointer symbol specified
by the cursorName resource.

screen

The screen on which this widget is displayed.
This is not a settable resource.

sensitive

Whether or not the toolkit should pass user
events to this widget. The widget will not get input events
if either ancestorSensitive or sensitive is
False.

translations

The event bindings associated with this
widget.

x

y

The location of the upper left outside corner of
this widget in its parent.

3.2.2. Grip
Actions

The Grip widget does not
declare any default event translation bindings, but it does
declare a single action routine named GripAction. The
client specifies an arbitrary event translation table,
optionally giving parameters to the GripAction
routine.

The GripAction
routine executes the callbacks on the callback list,
passing as call_data a pointer to a
XawGripCallData structure, defined in the Grip
widget’s application header file.

In this structure, the
event is a pointer to the input event that triggered
the action. params and num_params give the
string parameters specified in the translation table for the
particular event binding.

The following is an
example of a translation table that uses the
GripAction:

<Btn1Down>:

GripAction(press)

<Btn1Motion>:

GripAction(move)

<Btn1Up>:

GripAction(release)

For a complete
description of the format of translation tables, see the
X Toolkit Intrinsics — C Language
Interface.

3.3. Label
Widget

Application header
file<X11/Xaw/Label.h>

Class header file

<X11/Xaw/LabelP.h>

Class

labelWidgetClass

Class Name

Label

Superclass

Simple

A Label widget holds a
graphic displayed within a rectangular region of the screen.
The graphic may be a text string containing multiple lines
of characters in an 8 bit or 16 bit character set (to be
displayed with a font), or in a multi-byte encoding
(for use with a fontset). The graphic may also be a
bitmap or pixmap. The Label widget will allow its graphic to
be left, right, or center justified. Normally, this widget
can be neither selected nor directly edited by the user. It
is intended for use as an output device only.

A list of event to action bindings to be executed
by this widget, even though the event occurred in another
widget. (See the X Toolkit Intrinsics — C Language
Interface for details).

ancestorSensitive
The sensitivity state of the ancestors of this widget. A
widget is insensitive if either it or any of its ancestors
is insensitive. This resource should not be changed with
XtSetValues, although it may be queried.

background

A pixel value which indexes the widget’s
colormap to derive the background color of the
widget’s window.

backgroundPixmapThe
background pixmap of this widget’s window. If this
resource is set to anything other than
XtUnspecifiedPixmap, the pixmap specified will be
used instead of the background color.

bitmap

A bitmap to display instead of the label.
The default size of the widget will be just large enough to
contain the bitmap and the widget’s internal width and
height. The resource converter for this resource constructs
bitmaps from the contents of files. (See Converting
Bitmaps for details.) If this bitmap is one bit deep
then the 1’s will be rendered in the foreground color,
and the 0’s in the background color. If bitmap
has a depth greater than one, it is copied directly into the
window.

borderColor

A pixel value which indexes the widget’s
colormap to derive the border color of the widget’s
window.

borderPixmap

The border pixmap of this widget’s window.
If this resource is set to anything other than
XtUnspecifiedPixmap, the pixmap specified will be
used instead of the border color.

borderWidth

The width of this widget’s window
border.

colormap

The colormap that this widget will
use.

cursor

The image that will be displayed as the pointer
cursor whenever it is in this widget. The use of this
resource is deprecated in favor of
cursorName.

cursorName

The name of the symbol to use to represent the
pointer cursor. This resource will override the
cursor resource if both are specified. (See
2.4.1)

depth

The depth of this widget’s
window.

destroyCallbackAll
functions on this list are called when this widget is
destroyed.

encoding

The encoding method used by the value of the
label resource. The value may be
XawTextEncoding8bit or XawTextEncodingChar2b.
When international is set to true this
resource is not used.

font

The text font to use when displaying the
label, when the international resource is
false.

fontSet

The text font set to use when displaying the
label, when the international resource is
true.

foreground

A pixel value which indexes the widget’s
colormap to derive the foreground color of the
widget’s window. This color is also used to render all
1’s in a bitmap one plane deep.

height

width

The height and width of this widget in
pixels.

insensitiveBorder
This pixmap will be tiled into the widget’s border if
the widget becomes insensitive.

internalHeight

internalWidth

The minimum amount of space to leave between the
graphic and the vertical and horizontal edges of the
window.

international

This is a boolean flag, only settable at widget
creation time. A value of false signals the widget to
use pre-R6 internationalization (specifically, the lack
thereof), such as using fonts for displaying text, etc. A
value of true directs the widget to act in an
internationalized manner, such as utilizing font sets for
displaying text, etc.

justify

Specifies left, center, or right alignment of
graphic within the widget. This resource may be specified
with the values XtJustifyLeft,
XtJustifyCenter, or XtJustifyRight. A
converter is registered for this resource that will convert
the following strings: left, right, and
center. This resource only has noticeable effect when
the width of the widget is larger than necessary to display
the graphic. Note that when the graphic is a multi-line
label, the longest line will obey this justification
while shorter lines will be left-justified with the longest
one.

label

Specifies the text string to be displayed in the
widget’s window if no bitmap is specified. The default
is the name of this widget. Regardless of the value of
encoding or international, a single newline
character (1 byte) will cause a line break.

leftBitmap

Specifies a bitmap to display to the left of the
graphic in the widget’s window.

mappedWhenManaged
If this resource is True, then the widget’s
window will automatically be mapped by the Toolkit when it
is realized and managed.

pointerColor

A pixel value which indexes the widget’s
colormap to derive the foreground color of the pointer
symbol specified by the cursorName
resource.

pointerColorBackground
A pixel value which indexes the widget’s colormap to
derive the background color of the pointer symbol specified
by the cursorName resource.

resize

Specifies whether the widget should attempt to
resize to its preferred dimensions whenever its resources
are modified with XtSetValues. This attempt to resize
may be denied by the parent of this widget. The parent is
always free to resize the widget regardless of the state of
this resource.

screen

The screen on which this widget is displayed.
This is not a settable resource.

sensitive

Whether or not the toolkit should pass user
events to this widget. The widget will not get input events
if either ancestorSensitive or sensitive is
False.

translations

The event bindings associated with this
widget.

x

y

The location of the upper left outside corner of
this widget in its parent.

3.4. List
Widget

Application header
file<X11/Xaw/List.h>

Class header file

<X11/Xaw/ListP.h>

Class

listWidgetClass

Class Name

List

Superclass

Simple

The List widget contains
a list of strings formatted into rows and columns. When one
of the strings is selected, it is highlighted, and the List
widget’s Notify action is invoked, calling all
routines on its callback list. Only one string may be
selected at a time.

A list of event to action bindings to be executed
by this widget, even though the event occurred in another
widget. (See the X Toolkit Intrinsics — C Language
Interface for details).

ancestorSensitive
The sensitivity state of the ancestors of this widget. A
widget is insensitive if either it or any of its ancestors
is insensitive. This resource should not be changed with
XtSetValues, although it may be queried.

background

A pixel value which indexes the widget’s
colormap to derive the background color of the
widget’s window.

backgroundPixmapThe
background pixmap of this widget’s window. If this
resource is set to anything other than
XtUnspecifiedPixmap, the pixmap specified will be
used instead of the background color.

borderColor

A pixel value which indexes the widget’s
colormap to derive the border color of the widget’s
window.

borderPixmap

The border pixmap of this widget’s window.
If this resource is set to anything other than
XtUnspecifiedPixmap, the pixmap specified will be
used instead of the border color.

borderWidth

The width of this widget’s window
border.

callback

All functions on this list are called whenever
the notify action is invoked. The call_data
argument contains information about the element selected and
is described in detail in the List Callbacks
section.

colormap

The colormap that this widget will
use.

columnSpacing

rowSpacing

The amount of space, in pixels, between each of
the rows and columns in the list.

cursor

The image that will be displayed as the pointer
cursor whenever it is in this widget. The use of this
resource is deprecated in favor of
cursorName.

cursorName

The name of the symbol to use to represent the
pointer cursor. This resource will override the
cursor resource if both are specified. (See
2.4.1)

defaultColumns

The default number of columns. This value is used
when neither the width nor the height of the List widget is
specified or when forceColumns is
True.

depth

The depth of this widget’s
window.

destroyCallbackAll
functions on this list are called when this widget is
destroyed.

font

The text font to use when displaying the
list, when the international resource is
false.

fontSet

The text font set to use when displaying the
list, when the international resource is
true.

forceColumns

Forces the default number of columns to be used
regardless of the List widget’s current
size.

foreground

A pixel value which indexes the widget’s
colormap to derive the color used to paint the text of the
list elements.

height

width

The height and width of this widget in
pixels.

insensitiveBorder
This pixmap will be tiled into the widget’s border if
the widget becomes insensitive.

internalHeight

internalWidth

The margin, in pixels, between the edges of the
list and the corresponding edge of the List widget’s
window.

list

An array of text strings displayed in the List
widget. If numberStrings is zero (the default) then
the list must be NULL terminated. If a value is not
specified for the list, then numberStrings is
set to 1, and the name of the widget is used as the
list, and longest is set to the length of the
name of the widget. The list is used in place, and
must be available to the List widget for the lifetime of
this widget, or until it is changed with XtSetValues
or XawListChange.

international

This is a boolean flag, only settable at widget
creation time. A value of false signals the widget to
use pre-R6 internationalization (specifically, the lack
thereof), such as using fonts for displaying text, etc. A
value of true directs the widget to act in an
internationalized manner, such as utilizing font sets for
displaying text, etc.

longest

Specifies the width, in pixels, of the longest
string in the current list. The List widget will compute
this value if zero (the default) is specified. If this
resource is set by hand, entries longer than this will be
clipped to fit.

mappedWhenManaged
If this resource is True, then the widget’s
window will automatically be mapped by the Toolkit when it
is realized and managed.

numberStrings

The number of strings in the current list. If a
value of zero (the default) is specified, the List widget
will compute it. When computing the number of strings the
List widget assumes that the list is NULL
terminated.

pasteBuffer

If this resource is set to True then the
name of the currently selected list element will be put into
CUT_BUFFER_0.

pointerColor

A pixel value which indexes the widget’s
colormap to derive the foreground color of the pointer
symbol specified by the cursorName
resource.

pointerColorBackground
A pixel value which indexes the widget’s colormap to
derive the background color of the pointer symbol specified
by the cursorName resource.

screen

The screen on which this widget is displayed.
This is not a settable resource.

sensitive

Whether or not the toolkit should pass user
events to this widget. The widget will not get input events
if either ancestorSensitive or sensitive is
False.

translations

The event bindings associated with this
widget.

verticalList

If this resource is set to True then the
list elements will be presented in column major
order.

x

y

The location of the upper left outside corner of
this widget in its parent.

3.4.2. List
Actions

The List widget supports
the following actions:

•

Highlighting and unhighlighting the list element
under the pointer with Set and
Unset

•

Processing application callbacks with
Notify

The following is the
default translation table used by the List
Widget:

<Btn1Down>,<Btn1Up>:

Set() Notify()

The full list of actions
supported by List widget is:

Set()

Sets the list element that is currently
under the pointer. To inform the user that this element is
currently set, it is drawn with foreground and background
colors reversed. If this action is called when there is no
list element under the cursor, the currently set
element will be unset.

Unset()

Cancels the set state of the element under
the pointer, and redraws it with normal foreground and
background colors.

Notify()

Calls all callbacks on the List widget’s
callback list. Information about the currently selected list
element is passed in the call_data argument (see
List Callbacks below).

3.4.3. List
Callbacks

All procedures on the
List widget’s callback list will have a
XawListReturnStruct passed to them as
call_data. The structure is defined in the List
widget’s application header file.

typedef struct
_XawListReturnStruct {

String string;

/* string shown in the list. */

int list_index;

/* index of the item selected. */

} XawListReturnStruct;

Note

The list_index
item used to be called simply index.
Unfortunately, this name collided with a global name defined
on some
operating systems, and had to be changed.

Specifies the number of items in the list.
If a value less than 1 is specified, list must be
NULL terminated, and the number of items will be calculated
by the List widget.

longest

Specifies the length of the longest item in the
list in pixels. If a value less than 1 is specified,
the List widget will calculate the value.

resize

Specifies a Boolean value that if True
indicates that the List widget should try to resize itself
after making the change. The constraints of the List
widget’s parent are always enforced, regardless of the
value specified here.

XawListChange will
unset all list elements that are currently set
before the list is actually changed. The list is used
in place, and must remain usable for the lifetime of the
List widget, or until list has been changed again
with this function or with XtSetValues.

3.4.5. Highlighting an
Item

To highlight an item in
the list, use XawListHighlight.
void XawListHighlight(w, item)
Widget w;
int item;

w

Specifies the List widget.

item

Specifies an index into the current list that
indicates the item to be highlighted.

Only one item can be
highlighted at a time. If an item is already highlighted
when XawListHighlight is called, the highlighted item
is unhighlighted before the new item is
highlighted.

3.4.6. Unhighlighting
an Item

To unhighlight the
currently highlighted item in the list, use
XawListUnhighlight.
void XawListUnhighlight(w)
Widget w;

w

Specifies the List widget.

3.4.7. Retrieving the
Currently Selected Item

To retrieve the list
element that is currently set, use
XawListShowCurrent.
XawListReturnStruct *XawListShowCurrent(w)
Widget w;

w

Specifies the List widget.

XawListShowCurrent
returns a pointer to an XawListReturnStruct
structure, containing the currently highlighted item. If the
value of the index member is XAW_LIST_NONE, the string
member is undefined, and no item is currently
selected.

3.4.8.
Restrictions

Many programmers create a
‘‘scrolled list’’ by putting a List
widget with many entries as a child of a Viewport widget.
The List continues to create a window as big as its
contents, but that big window is only visible where it
intersects the parent Viewport’s window. (I.e., it is
‘‘clipped.’’)

While this is a useful
technique, there is a serious drawback. X does not support
windows above 32,767 pixels in width or height, but this
height limit will be exceeded by a List’s window when
the List has many entries (i.e., with a 12 point font, about
3000 entries would be too many.)

3.5. Panner
Widget

Application header
file<X11/Xaw/Panner.h>

Class header file

<X11/Xaw/PannerP.h>

Class

pannerWidgetClass

Class Name

Panner

Superclass

Simple

A Panner widget is a
rectangle, called the ‘‘canvas,’’ on
which another rectangle, the
‘‘slider,’’ moves in two dimensions.
It is often used with a Porthole widget to move, or
‘‘scroll,’’ a third widget in two
dimensions, in which case the slider’s size and
position gives feedback as to what portion of the third
widget is visible.

The slider may be
scrolled around the canvas by pressing, dragging, and
releasing Button1; the default translation also enables
scrolling via arrow keys and some other keys. While
scrolling is in progress, the application receives
notification through callback procedures. Notification may
be done either continuously whenever the slider moves or
discretely whenever the slider has been given a new
location.

A list of event to action bindings to be executed
by this widget, even though the event occurred in another
widget. (See the X Toolkit Intrinsics — C Language
Interface for details).

allowOff

Whether to allow the edges of the slider to go
off the edges of the canvas.

ancestorSensitive
The sensitivity state of the ancestors of this widget. A
widget is insensitive if either it or any of its ancestors
is insensitive. This resource should not be changed with
XtSetValues, although it may be queried.

background

A pixel value which indexes the widget’s
colormap to derive the background color of the
widget’s window.

backgroundPixmapThe
background pixmap of this widget’s window. If this
resource is set to anything other than
XtUnspecifiedPixmap, the pixmap specified will be
used instead of the background color.

backgroundStipple
The name of a bitmap pattern to be used as the background
for the area representing the canvas.

borderColor

A pixel value which indexes the widget’s
colormap to derive the border color of the widget’s
window.

borderPixmap

The border pixmap of this widget’s window.
If this resource is set to anything other than
XtUnspecifiedPixmap, the pixmap specified will be
used instead of the border color.

borderWidth

The width of this widget’s window
border.

canvasHeight

canvasWidth

The size of the canvas.

colormap

The colormap that this widget will
use.

cursor

The image that will be displayed as the pointer
cursor whenever it is in this widget. The use of this
resource is deprecated in favor of
cursorName.

cursorName

The name of the symbol to use to represent the
pointer cursor. This resource will override the
cursor resource if both are specified. (See
2.4.1)

defaultScale

The percentage size that the Panner widget should
have relative to the size of the canvas.

depth

The depth of this widget’s
window.

destroyCallbackAll
functions on this list are called when this widget is
destroyed.

foreground

A pixel value which indexes the widget’s
colormap to derive the color used to draw the
slider.

height

width

The height and width of this widget in
pixels.

internalSpace

The width of internal border in pixels between a
slider representing the full size of the canvas and the edge
of the Panner widget.

international

This is a boolean flag, only settable at widget
creation time. While not utilized in this widget, it can and
should be checked by any subclasses that have behavior that
should vary with locale.

lineWidth

The width of the lines in the rubberbanding
rectangle when rubberbanding is in effect instead of
continuous scrolling. The default is 0.

mappedWhenManaged
If this resource is True, then the widget’s
window will automatically be mapped by the Toolkit when it
is realized and managed.

pointerColor

A pixel value which indexes the widget’s
colormap to derive the foreground color of the pointer
symbol specified by the cursorName
resource.

pointerColorBackground
A pixel value which indexes the widget’s colormap to
derive the background color of the pointer symbol specified
by the cursorName resource.

reportCallback

All functions on this callback list are called
when the notify action is invoked. See the Panner
Actions section for details.

resize

Whether or not to resize the panner whenever the
canvas size is changed so that the defaultScale is
maintained.

rubberBand

Whether or not scrolling should be discrete (only
moving a rubberbanded rectangle until the scrolling is done)
or continuous (moving the slider itself). This controls
whether or not the move action procedure also invokes
the notify action procedure.

screen

The screen on which this widget is displayed.
This is not a settable resource.

sensitive

Whether or not the toolkit should pass user
events to this widget. The widget will not get input events
if either ancestorSensitive or sensitive is
False.

shadowColor

The color of the shadow underneath the
slider.

shadowThicknessThe
width of the shadow underneath the slider.

sliderX

sliderY

The location of the slider in the coordinates of
the canvas.

sliderHeight

sliderWidth

The size of the slider.

translations

The event bindings associated with this
widget.

x

y

The location of the upper left outside corner of
this widget in its parent.

3.5.2. Panner
Actions

The actions supported by
the Panner widget are:

start()

This action begins movement of the
slider.

stop()

This action ends movement of the
slider.

abort()

This action ends movement of the slider and
restores it to the position it held when the start
action was invoked.

move()

This action moves the outline of the slider (if
the rubberBand resource is True) or the slider itself
(by invoking the notify action
procedure).

page(xamount,yamount)
This action moves the slider by the specified amounts. The
format for the amounts is a signed or unsigned
floating-point number (e.g., +1.0 or −.5) followed by
either p indicating pages (slider sizes), or c
indicating canvas sizes. Thus, page(+0,+.5p)
represents vertical movement down one-half the height of the
slider and page(0,0) represents moving to the upper
left corner of the canvas.

notify()

This action informs the application of the
slider’s current position by invoking the
reportCallback functions registered by the
application.

set(what,value)This
action changes the behavior of the Panner. The what
argument must currently be the string rubberband and
controls the value of the rubberBand resource. The
value argument may have one of the values on,
off, or toggle.

The default bindings for
Panner are:

<Btn1Down>:

start()

<Btn1Motion>:move()

<Btn1Up>:

notify() stop()

<Btn2Down>:

abort()

<Key>KP_Enter:set(rubberband,toggle)

<Key>space:

page(+1p,+1p)

<Key>Delete:page(−1p,−1p)

<Key>BackSpace:page(−1p,−1p)

<Key>Left:

page(−.5p,+0)

<Key>Right:

page(+.5p,+0)

<Key>Up:

page(+0,−.5p)

<Key>Down:

page(+0,+.5p)

<Key>Home:

page(0,0)

3.5.3. Panner
Callbacks

The functions registered
on the reportCallback list are invoked by the
notify action as follows:
void ReportProc(panner, client_data,
report)

Widget panner;

XtPointer client_data;

XtPointer report; /* (XawPannerReport *)
*/

panner

Specifies the Panner widget.

client_dataSpecifies
the client data.

report

Specifies a pointer to an XawPannerReport
structure containing the location and size of the slider and
the size of the canvas.

3.6. Repeater
Widget

Application header
file<X11/Xaw/Repeater.h>

Class header file

<X11/Xaw/RepeaterP.h>

Class

repeaterWidgetClass

Class Name

Repeater

Superclass

Command

The Repeater widget is a
subclass of the Command widget; see the Command
documentation for details. The difference is that the
Repeater can call its registered callbacks repeatedly, at an
increasing rate. The default translation does so for the
duration the user holds down pointer button 1 while the
pointer is on the Repeater.

A list of event to action bindings to be executed
by this widget, even though the event occurred in another
widget. (See the X Toolkit Intrinsics — C Language
Interface for details).

ancestorSensitive
The sensitivity state of the ancestors of this widget. A
widget is insensitive if either it or any of its ancestors
is insensitive. This resource should not be changed with
XtSetValues, although it may be queried.

background

A pixel value which indexes the widget’s
colormap to derive the background color of the
widget’s window.

backgroundPixmapThe
background pixmap of this widget’s window. If this
resource is set to anything other than
XtUnspecifiedPixmap, the pixmap specified will be
used instead of the background color.

bitmap

A bitmap to display instead of the label.
The default size of the widget will be just large enough to
contain the bitmap and the widget’s internal width and
height. The resource converter for this resource constructs
bitmaps from the contents of files. (See Converting
Bitmaps for details.) If this bitmap is one bit deep
then the 1’s will be rendered in the foreground color,
and the 0’s in the background color. If bitmap
has a depth greater than one, it is copied directly into the
window.

borderColor

A pixel value which indexes the widget’s
colormap to derive the border color of the widget’s
window.

borderPixmap

The border pixmap of this widget’s window.
If this resource is set to anything other than
XtUnspecifiedPixmap, the pixmap specified will be
used instead of the border color.

borderWidth

The width of this widget’s window
border.

callback

A list of routines to be called when the
notify action is invoked.

colormap

The colormap that this widget will
use.

cornerRoundPercent
When a ShapeStyle of roundedRectangle is used,
this resource controls the radius of the rounded corner. The
radius of the rounded corners is specified as a percentage
of the length of the shortest side of the
widget.

cursor

The image that will be displayed as the pointer
cursor whenever it is in this widget. The use of this
resource is deprecated in favor of
cursorName.

cursorName

The name of the symbol to use to represent the
pointer cursor. This resource will override the
cursor resource if both are specified. (See
2.4.1)

decay

The number of milliseconds that should be
subtracted from each succeeding interval while the Repeater
button is being held down until the interval has reached
minimumDelay milliseconds.

depth

The depth of this widget’s
window.

destroyCallbackAll
functions on this list are called when this widget is
destroyed.

encoding

The encoding method used by the value of the
label resource. The value may be
XawTextEncoding8bit or XawTextEncodingChar2b.
When international is set to true this
resource is not used.

flash

Whether or not to flash the Repeater button
whenever the timer goes off.

font

The text font to use when displaying the
label, when the international resource is
false.

fontSet

The text font set to use when displaying the
label, when the international resource is
true.

foreground

A pixel value which indexes the widget’s
colormap to derive the foreground color of the
widget’s window. This color is also used to render all
1’s in a bitmap one plane deep.

height

width

The height and width of this widget in
pixels.

highlightThickness
The thickness of the rectangle that is used to highlight the
internal border of this widget, alerting the user that it is
ready to be selected. The default value is 2 pixels if the
shapeStyle is rectangle, and 0 Pixels (no
highlighting) otherwise.

initialDelay

The number of milliseconds between the beginning
of the Repeater button being held down and the first
invocation of the callback function.

insensitiveBorder
This pixmap will be tiled into the widget’s border if
the widget becomes insensitive.

internalHeight

internalWidth

The minimum amount of space to leave between the
graphic and the vertical and horizontal edges of the
window.

international

This is a boolean flag, only settable at widget
creation time. A value of false signals the widget to
use pre-R6 internationalization (specifically, the lack
thereof), such as using fonts for displaying text, etc. A
value of true directs the widget to act in an
internationalized manner, such as utilizing font sets for
displaying text, etc.

justify

Specifies left, center, or right alignment of
graphic within the widget. This resource may be specified
with the values XtJustifyLeft,
XtJustifyCenter, or XtJustifyRight. A
converter is registered for this resource that will convert
the following strings: left, right, and
center. This resource only has noticeable effect when
the width of the widget is larger than necessary to display
the graphic. Note that when the graphic is a multi-line
label, the longest line will obey this justification
while shorter lines will be left-justified with the longest
one.

label

Specifies the text string to be displayed in the
widget’s window if no bitmap is specified. The default
is the name of this widget. Regardless of the value of
encoding or international, a single newline
character (1 byte) will cause a line break.

leftBitmap

Specifies a bitmap to display to the left of the
graphic in the widget’s window.

mappedWhenManaged
If this resource is True, then the widget’s
window will automatically be mapped by the Toolkit when it
is realized and managed.

minimumDelay

The minimum time between callbacks in
milliseconds.

pointerColor

A pixel value which indexes the widget’s
colormap to derive the foreground color of the pointer
symbol specified by the cursorName
resource.

pointerColorBackground
A pixel value which indexes the widget’s colormap to
derive the background color of the pointer symbol specified
by the cursorName resource.

repeatDelay

The number of milliseconds between each callback
after the first (minus an increasing number of
decays).

resize

Specifies whether the widget should attempt to
resize to its preferred dimensions whenever its resources
are modified with XtSetValues. This attempt to resize
may be denied by the parent of this widget. The parent is
always free to resize the widget regardless of the state of
this resource.

screen

The screen on which this widget is displayed.
This is not a settable resource.

sensitive

Whether or not the toolkit should pass user
events to this widget. The widget will not get input events
if either ancestorSensitive or sensitive is
False.

shapeStyle

Nonrectangular widgets may be created using this
resource. Nonrectangular widgets are supported only on a
server that supports the Shape Extension. If
nonrectangular widgets are specified for a server lacking
this extension, the shape is ignored and the widgets will be
rectangular. The following shapes are currently supported:
XmuShapeRectangle, XmuShapeOval,
XmuShapeEllipse, and XmuShapeRoundedRectangle.
A converter is registered for this resource that will
convert the following strings: rectangle, oval,
ellipse, and roundedRectangle.

startCallback

The list of functions to invoke by the
start action (typically when the Repeater button is
first pressed). The callback data parameter is set to
NULL.

stopCallback

The list of functions to invoke by the
stop action (typically when the Repeater button is
released). The callback data parameter is set to
NULL.

translations

The event bindings associated with this
widget.

x

y

The location of the upper left outside corner of
this widget in its parent.

3.6.2. Repeater
Actions

The Repeater widget
supports the following actions beyond those of the Command
button:

start()

This invokes the functions on the
startCallback and callback lists and sets a
timer to go off in initialDelay milliseconds. The
timer will cause the callback functions to be invoked
with increasing frequency until the stop action
occurs.

stop()

This invokes the functions on the
stopCallback list and prevents any further timers
from occuring until the next start
action.

The following are the
default translation bindings used by the Repeater
widget:

<EnterWindow>:

highlight()

<LeaveWindow>:

unhighlight()

<Btn1Down>:

set() start()

<Btn1Up>:

stop() unset()

3.7. Scrollbar
Widget

Application header
file<X11/Xaw/Scrollbar.h>

Class header file

<X11/Xaw/ScrollbarP.h>

Class

scrollbarWidgetClass

Class Name

Scrollbar

Superclass

Simple

A Scrollbar widget is a
rectangle, called the ‘‘canvas,’’ on
which another rectangle, the
‘‘thumb,’’ moves in one dimension,
either vertically or horizontally. A Scrollbar can be used
alone, as a value generator, or it can be used within a
composite widget (for example, a Viewport). When a Scrollbar
is used to move, or ‘‘scroll,’’ the
contents of another widget, the size and the position of the
thumb usually give feedback as to what portion of the other
widget’s contents are visible.

Each pointer button
invokes a specific action. Pointer buttons 1 and 3 do not
move the thumb automatically. Instead, they return the pixel
position of the cursor on the scroll region. When pointer
button 2 is clicked, the thumb moves to the current pointer
position. When pointer button 2 is held down and the pointer
is moved, the thumb follows the pointer.

The pointer cursor in the
scroll region changes depending on the current action. When
no pointer button is pressed, the cursor appears as a
double-headed arrow that points in the direction that
scrolling can occur. When pointer button 1 or 3 is pressed,
the cursor appears as a single-headed arrow that points in
the logical direction that the thumb will move. When pointer
button 2 is pressed, the cursor appears as an arrow that
points to the top or the left of the thumb.

When the user scrolls,
the application receives notification through callback
procedures. For both discrete scrolling actions, the
callback returns the Scrollbar widget, the client_data, and
the pixel position of the pointer when the button was
released. For continuous scrolling, the callback routine
returns the scroll bar widget, the client data, and the
current relative position of the thumb. When the thumb is
moved using pointer button 2, the callback procedure is
invoked continuously. When either button 1 or 3 is pressed,
the callback procedure is invoked only when the button is
released and the client callback procedure is responsible
for moving the thumb.

A list of event to action bindings to be executed
by this widget, even though the event occurred in another
widget. (See the X Toolkit Intrinsics — C Language
Interface for details).

ancestorSensitive
The sensitivity state of the ancestors of this widget. A
widget is insensitive if either it or any of its ancestors
is insensitive. This resource should not be changed with
XtSetValues, although it may be queried.

background

A pixel value which indexes the widget’s
colormap to derive the background color of the
widget’s window.

backgroundPixmapThe
background pixmap of this widget’s window. If this
resource is set to anything other than
XtUnspecifiedPixmap, the pixmap specified will be
used instead of the background color.

borderColor

A pixel value which indexes the widget’s
colormap to derive the border color of the widget’s
window.

borderPixmap

The border pixmap of this widget’s window.
If this resource is set to anything other than
XtUnspecifiedPixmap, the pixmap specified will be
used instead of the border color.

borderWidth

The width of this widget’s window
border.

colormap

The colormap that this widget will
use.

cursor

The image that will be displayed as the pointer
cursor whenever it is in this widget. The use of this
resource is deprecated in favor of
cursorName.

cursorName

The name of the symbol to use to represent the
pointer cursor. This resource will override the
cursor resource if both are specified. (See
2.4.1)

depth

The depth of this widget’s
window.

destroyCallbackAll
functions on this list are called when this widget is
destroyed.

foreground

A pixel value which indexes the widget’s
colormap to derive the color used to draw the
thumb.

height

width

The height and width of this widget in
pixels.

insensitiveBorder
This pixmap will be tiled into the widget’s border if
the widget becomes insensitive.

international

This is a boolean flag, only settable at widget
creation time. While not utilized in this widget, it can and
should be checked by any subclasses that have behavior that
should vary with locale.

jumpProc

All functions on this callback list are called
when the NotifyThumb action is invoked. See the
Scrollbar Actions section for details.

length

The height of a vertical scrollbar or the width
of a horizontal scrollbar.

mappedWhenManaged
If this resource is True, then the widget’s
window will automatically be mapped by the Toolkit when it
is realized and managed.

minimumThumb

The smallest size, in pixels, to which the thumb
can shrink.

orientation

The orientation is the direction that the thumb
will be allowed to move. This value can be either
XtorientVertical or XtorientHorizontal. A
converter is registered for this resource that will convert
the following strings: vertical and
horizontal.

pointerColor

A pixel value which indexes the widget’s
colormap to derive the foreground color of the pointer
symbol specified by the cursorName
resource.

pointerColorBackground
A pixel value which indexes the widget’s colormap to
derive the background color of the pointer symbol specified
by the cursorName resource.

screen

The screen on which this widget is displayed.
This is not a settable resource.

scrollDCursor

This cursor is used when scrolling backward in a
vertical scrollbar.

scrollHCursor

This cursor is used when a horizontal scrollbar
is inactive.

scrollLCursor

This cursor is used when scrolling forward in a
horizontal scrollbar.

scrollProc

All functions on this callback list may be called
when the NotifyScroll action is invoked. See the
Scrollbar Actions section for details.

scrollRCursor

This cursor is used when scrolling backward in a
horizontal scrollbar, or when thumbing a vertical
scrollbar.

scrollUCursor

This cursor is used when scrolling forward in a
vertical scrollbar, or when thumbing a horizontal
scrollbar.

scrollVCursor

This cursor is used when a vertical scrollbar is
inactive.

sensitive

Whether or not the toolkit should pass user
events to this widget. The widget will not get input events
if either ancestorSensitive or sensitive is
False.

shown

This is the size of the thumb, expressed as a
percentage (0.0 - 1.0) of the length of the
scrollbar.

thickness

The width of a vertical scrollbar or the height
of a horizontal scrollbar.

thumb

This pixmap is used to tile (or stipple) the
thumb of the scrollbar. If no tiling is desired, then set
this resource to None. This resource will accept
either a bitmap or a pixmap that is the same depth as the
window. The resource converter for this resource constructs
bitmaps from the contents of files. (See Converting
Bitmaps for details.)

topOfThumb

The location of the top of the thumb, as a
percentage (0.0 - 1.0) of the length of the scrollbar. This
resource was called top in previous versions of the
Athena widget set. The name collided with the a Form widget
constraint resource, and had to be changed.

translations

The event bindings associated with this
widget.

x

y

The location of the upper left outside corner of
this widget in its parent.

3.7.2. Scrollbar
Actions

The actions supported by
the Scrollbar widget are:

StartScroll(value)
The possible values are Forward, Backward, or
Continuous. This must be the first action to begin a new
movement.

NotifyScroll(value)
The possible values are Proportional or FullLength.
If the argument to StartScroll was Forward or Backward,
NotifyScroll executes the scrollProc callbacks and
passes either; the position of the pointer, if value
is Proportional, or the full length of the scroll bar, if
value is FullLength. If the argument to StartScroll
was Continuous, NotifyScroll returns without executing any
callbacks.

EndScroll()

This must be the last action after a movement is
complete.

MoveThumb()

Repositions the Scrollbar’s thumb to the
current pointer location.

NotifyThumb() Calls
the jumpProc callbacks and passes the relative
position of the pointer as a percentage of the scroll bar
length.

The default bindings for
Scrollbar are:

<Btn1Down>:

StartScroll(Forward)

<Btn2Down>:

StartScroll(Continuous) MoveThumb()
NotifyThumb()

<Btn3Down>:

StartScroll(Backward)

<Btn2Motion>:MoveThumb()
NotifyThumb()

<BtnUp>:

NotifyScroll(Proportional)
EndScroll()

Examples of additional
bindings a user might wish to specify in a resource file
are:

*Scrollbar.Translations:
\

~Meta<Key>space:

StartScroll(Forward) NotifyScroll(FullLength)
\n\

Meta<Key>space:

StartScroll(Backward) NotifyScroll(FullLength)
\n\

EndScroll()

3.7.3. Scrollbar
Callbacks

There are two callback
lists provided by the Scrollbar widget. The procedural
interface for these functions is described here.

The scrollProc
callback is used for incremental scrolling and is called by
the NotifyScroll action. The position argument is a
signed quantity and should be cast to an int when used.
Using the default button bindings, button 1 returns a
positive value, and button 3 returns a negative value. In
both cases, the magnitude of the value is the distance of
the pointer in pixels from the top (or left) of the
Scrollbar. The value will never be greater than the length
of the Scrollbar.

percent_ptrSpecifies
the floating point position of the thumb (0.0 −
1.0).

The jumpProc
callback is used to implement smooth scrolling and is called
by the NotifyThumb action. Percent_ptr must be cast
to a pointer to float before use; i.e.

float percent = *(float*)percent_ptr;

With the default button
bindings, button 2 moves the thumb interactively, and the
jumpProc is called on each new position of the
pointer, while the pointer button remains down. The value
specified by percent_ptr is the current location of
the thumb (from the top or left of the Scrollbar) expressed
as a percentage of the length of the Scrollbar.

3.7.4. Convenience
Routines

To set the position and
length of a Scrollbar thumb, use
XawScrollbarSetThumb.
void XawScrollbarSetThumb(w, top,
shown)
Widget w;
float top;
float shown;

w

Specifies the Scrollbar widget.

top

Specifies the position of the top of the thumb as
a fraction of the length of the Scrollbar.

shown

Specifies the length of the thumb as a fraction
of the total length of the Scrollbar.

XawScrollbarThumb
moves the visible thumb to a new position (0.0 − 1.0)
and length (0.0 − 1.0). Either the top or shown
arguments can be specified as −1.0, in which case the
current value is left unchanged. Values greater than 1.0 are
truncated to 1.0.

If called from
jumpProc, XawScrollbarSetThumb has no
effect.

3.7.5. Setting Float
Resources

The shown and
topOfThumb resources are of type float. These
resources can be difficult to get into an argument list. The
reason is that C performs an automatic cast of the float
value to an integer value, usually truncating the important
information. The following code fragment is one portable
method of getting a float into an argument list.

top = 0.5;

if (sizeof(float) > sizeof(XtArgVal))
{

/*

* If a float is larger than an
XtArgVal then pass this

* resource value by
reference.

*/

XtSetArg(args[0], XtNshown,
&top);

}

else {

/*

* Convince C not to perform an
automatic conversion, which

* would truncate 0.5 to
0.

*/

XtArgVal * l_top = (XtArgVal *)
&top;

XtSetArg(args[0], XtNshown,
*l_top);

}

3.8. Simple
Widget

Application Header
file<Xaw/Simple.h>

Class Header file

<Xaw/SimpleP.h>

Class

simpleWidgetClass

Class Name

Simple

Superclass

Core

The Simple widget is not
very useful by itself, as it has no semantics of its own. It
main purpose is to be used as a common superclass for the
other simple Athena widgets. This widget adds six
resources to the resource list provided by the Core widget
and its superclasses.

A list of event to action bindings to be executed
by this widget, even though the event occurred in another
widget. (See the X Toolkit Intrinsics — C Language
Interface for details).

ancestorSensitive
The sensitivity state of the ancestors of this widget. A
widget is insensitive if either it or any of its ancestors
is insensitive. This resource should not be changed with
XtSetValues, although it may be queried.

background

A pixel value which indexes the widget’s
colormap to derive the background color of the
widget’s window.

backgroundPixmapThe
background pixmap of this widget’s window. If this
resource is set to anything other than
XtUnspecifiedPixmap, the pixmap specified will be
used instead of the background color.

borderColor

A pixel value which indexes the widget’s
colormap to derive the border color of the widget’s
window.

borderPixmap

The border pixmap of this widget’s window.
If this resource is set to anything other than
XtUnspecifiedPixmap, the pixmap specified will be
used instead of the border color.

borderWidth

The width of this widget’s window
border.

colormap

The colormap that this widget will
use.

cursor

The image that will be displayed as the pointer
cursor whenever it is in this widget. The use of this
resource is deprecated in favor of
cursorName.

cursorName

The name of the symbol to use to represent the
pointer cursor. This resource will override the
cursor resource if both are specified. (See
2.4.1)

depth

The depth of this widget’s
window.

destroyCallbackAll
functions on this list are called when this widget is
destroyed.

height

width

The height and width of this widget in
pixels.

insensitiveBorder
This pixmap will be tiled into the widget’s border if
the widget becomes insensitive.

international

This is a boolean flag, only settable at widget
creation time. While not utilized in this widget, it can and
should be checked by any subclasses that have behavior that
should vary with locale.

mappedWhenManaged
If this resource is True, then the widget’s
window will automatically be mapped by the Toolkit when it
is realized and managed.

pointerColor

A pixel value which indexes the widget’s
colormap to derive the foreground color of the pointer
symbol specified by the cursorName
resource.

pointerColorBackground
A pixel value which indexes the widget’s colormap to
derive the background color of the pointer symbol specified
by the cursorName resource.

screen

The screen on which this widget is displayed.
This is not a settable resource.

sensitive

Whether or not the toolkit should pass user
events to this widget. The widget will not get input events
if either ancestorSensitive or sensitive is
False.

translations

The event bindings associated with this
widget.

x

y

The location of the upper left outside corner of
this widget in its parent.

3.9. StripChart
Widget

Application Header
file<Xaw/StripChart.h>

Class Header file

<Xaw/StripCharP.h>

Class

stripChartWidgetClass

Class Name

StripChart

Superclass

Simple

The StripChart widget is
used to provide a roughly real time graphical chart of a
single value. For example, it is used by the common client
program xload to provide a graph of processor load.
The StripChart reads data from an application, and updates
the chart at the update interval
specified.

A list of event to action bindings to be executed
by this widget, even though the event occurred in another
widget. (See the X Toolkit Intrinsics — C Language
Interface for details).

ancestorSensitive
The sensitivity state of the ancestors of this widget. A
widget is insensitive if either it or any of its ancestors
is insensitive. This resource should not be changed with
XtSetValues, although it may be queried.

background

A pixel value which indexes the widget’s
colormap to derive the background color of the
widget’s window.

backgroundPixmapThe
background pixmap of this widget’s window. If this
resource is set to anything other than
XtUnspecifiedPixmap, the pixmap specified will be
used instead of the background color.

borderColor

A pixel value which indexes the widget’s
colormap to derive the border color of the widget’s
window.

borderPixmap

The border pixmap of this widget’s window.
If this resource is set to anything other than
XtUnspecifiedPixmap, the pixmap specified will be
used instead of the border color.

borderWidth

The width of this widget’s window
border.

colormap

The colormap that this widget will
use.

cursor

The image that will be displayed as the pointer
cursor whenever it is in this widget. The use of this
resource is deprecated in favor of
cursorName.

cursorName

The name of the symbol to use to represent the
pointer cursor. This resource will override the
cursor resource if both are specified. (See
2.4.1)

depth

The depth of this widget’s
window.

destroyCallbackAll
functions on this list are called when this widget is
destroyed.

foreground

A pixel value which indexes the widget’s
colormap to derive the color that will be used to draw the
graph.

getValue

A list of callback functions to call every
update seconds. This list should contain one
function, which returns the value to be graphed by the
StripChart widget. The following section describes the
procedural interface. Behavior when this list has more than
one function is undefined.

height

width

The height and width of this widget in
pixels.

highlight

A pixel value which indexes the widget’s
colormap to derive the color that will be used to draw the
scale lines on the graph.

insensitiveBorder
This pixmap will be tiled into the widget’s border if
the widget becomes insensitive.

international

This is a boolean flag, only settable at widget
creation time. While not utilized in this widget, it can and
should be checked by any subclasses that have behavior that
should vary with locale.

jumpScroll

When the graph reaches the right edge of the
window it must be scrolled to the left. This resource
specifies the number of pixels it will jump. Smooth
scrolling can be achieved by setting this resource to
1.

mappedWhenManaged
If this resource is True, then the widget’s
window will automatically be mapped by the Toolkit when it
is realized and managed.

minScale

The minimum scale for the graph. The number of
divisions on the graph will always be greater than or equal
to this value.

pointerColor

A pixel value which indexes the widget’s
colormap to derive the foreground color of the pointer
symbol specified by the cursorName
resource.

pointerColorBackground
A pixel value which indexes the widget’s colormap to
derive the background color of the pointer symbol specified
by the cursorName resource.

screen

The screen on which this widget is displayed.
This is not a settable resource.

sensitive

Whether or not the toolkit should pass user
events to this widget. The widget will not get input events
if either ancestorSensitive or sensitive is
False.

translations

The event bindings associated with this
widget.

update

The number of seconds between graph updates. Each
update is represented on the graph as a 1 pixel wide line.
Every update seconds the getValue procedure
will be used to get a new graph point, and this point will
be added to the right end of the StripChart.

x

y

The location of the upper left outside corner of
this widget in its parent.

3.9.2. Getting the
StripChart Value

The StripChart widget
will call the application routine passed to it as the
getValue callback function every update
seconds to obtain another point for the StripChart
graph.

Returns a pointer to a double. The application
should set the address pointed to by this argument to a
double containing the value to be graphed on the
StripChart.

This function is used by
the StripChart to call an application routine. The routine
will pass the value to be graphed back to the the StripChart
in the value field of this routine.

3.10. Toggle
Widget

Application Header
file<Xaw/Toggle.h>

Class Header file

<Xaw/ToggleP.h>

Class

toggleWidgetClass

Class Name

Toggle

Superclass

Command

The Toggle widget is an
area, often rectangular, that displays a graphic. The
graphic may be a text string containing multiple lines of
characters in an 8 bit or 16 bit character set (to be
displayed with a font), or in a multi-byte encoding
(for use with a fontset). The graphic may also be a
bitmap or pixmap.

This widget maintains a
Boolean state (e.g. True/False or On/Off) and changes state
whenever it is selected. When the pointer is on the Toggle
widget, the Toggle widget may become highlighted by drawing
a rectangle around its perimeter. This highlighting
indicates that the Toggle widget is ready for selection.
When pointer button 1 is pressed and released, the Toggle
widget indicates that it has changed state by reversing its
foreground and background colors, and its notify
action is invoked, calling all functions on its callback
list. If the pointer is moved off of the widget before the
pointer button is released, the Toggle widget reverts to its
previous foreground and background colors, and releasing the
pointer button has no effect. This behavior allows the user
to cancel the operation.

Toggle widgets may also
be part of a ‘‘radio group.’’ A
radio group is a list of at least two Toggle widgets in
which no more than one Toggle may be set at any time. A
radio group is identified by the widget ID of any one of its
members. The convenience routine XawToggleGetCurrent
will return information about the Toggle widget in the radio
group.

A list of event to action bindings to be executed
by this widget, even though the event occurred in another
widget. (See the X Toolkit Intrinsics — C Language
Interface for details).

ancestorSensitive
The sensitivity state of the ancestors of this widget. A
widget is insensitive if either it or any of its ancestors
is insensitive. This resource should not be changed with
XtSetValues, although it may be queried.

background

A pixel value which indexes the widget’s
colormap to derive the background color of the
widget’s window.

backgroundPixmapThe
background pixmap of this widget’s window. If this
resource is set to anything other than
XtUnspecifiedPixmap, the pixmap specified will be
used instead of the background color.

bitmap

A bitmap to display instead of the label.
The default size of the widget will be just large enough to
contain the bitmap and the widget’s internal width and
height. The resource converter for this resource constructs
bitmaps from the contents of files. (See Converting
Bitmaps for details.) If this bitmap is one bit deep
then the 1’s will be rendered in the foreground color,
and the 0’s in the background color. If bitmap
has a depth greater than one, it is copied directly into the
window.

borderColor

A pixel value which indexes the widget’s
colormap to derive the border color of the widget’s
window.

borderPixmap

The border pixmap of this widget’s window.
If this resource is set to anything other than
XtUnspecifiedPixmap, the pixmap specified will be
used instead of the border color.

borderWidth

The width of this widget’s window
border.

callback

A list of routines to be called when the
notify action is invoked.

colormap

The colormap that this widget will
use.

cornerRoundPercent
When a ShapeStyle of roundedRectangle is used,
this resource controls the radius of the rounded corner. The
radius of the rounded corners is specified as a percentage
of the length of the shortest side of the
widget.

cursor

The image that will be displayed as the pointer
cursor whenever it is in this widget. The use of this
resource is deprecated in favor of
cursorName.

cursorName

The name of the symbol to use to represent the
pointer cursor. This resource will override the
cursor resource if both are specified. (See
2.4.1)

depth

The depth of this widget’s
window.

destroyCallbackAll
functions on this list are called when this widget is
destroyed.

encoding

The encoding method used by the value of the
label resource. The value may be
XawTextEncoding8bit or XawTextEncodingChar2b.
When international is set to true this
resource is not used.

font

The text font to use when displaying the
label, when the international resource is
false.

fontSet

The text font set to use when displaying the
label, when the international resource is
true.

foreground

A pixel value which indexes the widget’s
colormap to derive the foreground color of the
widget’s window. This color is also used to render all
1’s in a bitmap one plane deep.

height

width

The height and width of this widget in
pixels.

highlightThickness
The thickness of the rectangle that is used to highlight the
internal border of this widget, alerting the user that it is
ready to be selected. The default value is 2 pixels if the
shapeStyle is rectangle, and 0 Pixels (no
highlighting) otherwise.

insensitiveBorder
This pixmap will be tiled into the widget’s border if
the widget becomes insensitive.

internalHeight

internalWidth

The minimum amount of space to leave between the
graphic and the vertical and horizontal edges of the
window.

international

This is a boolean flag, only settable at widget
creation time. A value of false signals the widget to
use pre-R6 internationalization (specifically, the lack
thereof), such as using fonts for displaying text, etc. A
value of true directs the widget to act in an
internationalized manner, such as utilizing font sets for
displaying text, etc.

justify

Specifies left, center, or right alignment of
graphic within the widget. This resource may be specified
with the values XtJustifyLeft,
XtJustifyCenter, or XtJustifyRight. A
converter is registered for this resource that will convert
the following strings: left, right, and
center. This resource only has noticeable effect when
the width of the widget is larger than necessary to display
the graphic. Note that when the graphic is a multi-line
label, the longest line will obey this justification
while shorter lines will be left-justified with the longest
one.

label

Specifies the text string to be displayed in the
widget’s window if no bitmap is specified. The default
is the name of this widget. Regardless of the value of
encoding or international, a single newline
character (1 byte) will cause a line break.

leftBitmap

Specifies a bitmap to display to the left of the
graphic in the widget’s window.

mappedWhenManaged
If this resource is True, then the widget’s
window will automatically be mapped by the Toolkit when it
is realized and managed.

pointerColor

A pixel value which indexes the widget’s
colormap to derive the foreground color of the pointer
symbol specified by the cursorName
resource.

pointerColorBackground
A pixel value which indexes the widget’s colormap to
derive the background color of the pointer symbol specified
by the cursorName resource.

radioData

Specifies the data that will be returned by
XawToggleGetCurrent when this is the currently
set widget in the radio group. This value is also
used to identify the Toggle that will be set by a call to
XawToggleSetCurrent. The value NULL will be returned
by XawToggleGetCurrent if no widget in a radio group
is currently set. Programmers must not specify NULL (or
Zero) as radioData.

radioGroup

Specifies another Toggle widget that is in the
radio group to which this Toggle widget should be added. A
radio group is a group of at least two Toggle widgets, only
one of which may be set at a time. If this value is
NULL (the default) then the Toggle will not be part of any
radio group and can change state without affecting any other
Toggle widgets. If the widget specified in this resource is
not already in a radio group then a new radio group will be
created containing these two Toggle widgets. No Toggle
widget can be in multiple radio groups. The behavior of a
radio group of one toggle is undefined. A converter is
registered which will convert widget names to widgets
without caching.

resize

Specifies whether the widget should attempt to
resize to its preferred dimensions whenever its resources
are modified with XtSetValues. This attempt to resize
may be denied by the parent of this widget. The parent is
always free to resize the widget regardless of the state of
this resource.

screen

The screen on which this widget is displayed.
This is not a settable resource.

sensitive

Whether or not the toolkit should pass user
events to this widget. The widget will not get input events
if either ancestorSensitive or sensitive is
False.

shapeStyle

Nonrectangular widgets may be created using this
resource. Nonrectangular widgets are supported only on a
server that supports the Shape Extension. If
nonrectangular widgets are specified for a server lacking
this extension, the shape is ignored and the widgets will be
rectangular. The following shapes are currently supported:
XmuShapeRectangle, XmuShapeOval,
XmuShapeEllipse, and XmuShapeRoundedRectangle.
A converter is registered for this resource that will
convert the following strings: rectangle, oval,
ellipse, and roundedRectangle.

state

Specifies whether the Toggle widget is set
(True) or unset (False).

translations

The event bindings associated with this
widget.

x

y

The location of the upper left outside corner of
this widget in its parent.

3.10.2. Toggle
Actions

The Toggle widget
supports the following actions:

•

Switching the Toggle widget between the
foreground and background colors with set and
unset and toggle

•

Processing application callbacks with
notify

•

Switching the internal border between highlighted
and unhighlighted states with highlight and
unhighlight

The following are the
default translation bindings used by the Toggle
widget:

<EnterWindow>:

highlight(Always)

<LeaveWindow>:

unhighlight()

<Btn1Down>,<Btn1Up>:toggle()
notify()

3.10.3. Toggle
Actions

The full list of actions
supported by Toggle is:

highlight(condition)
Displays the internal highlight border in the color
(foreground or background ) that contrasts
with the interior color of the Toggle widget. The conditions
WhenUnset and Always are understood by this
action procedure. If no argument is passed then
WhenUnset is assumed.

unhighlight()

Displays the internal highlight border in the
color (foreground or background ) that matches
the interior color of the Toggle widget.

set()

Enters the set state, in which
notify is possible. This action causes the Toggle
widget to display its interior in the foreground
color. The label or bitmap is displayed in the
background color.

unset()

Cancels the set state and displays the
interior of the Toggle widget in the background
color. The label or bitmap is displayed in the
foreground color.

toggle()

Changes the current state of the Toggle widget,
causing to be set if it was previously unset, and unset if
it was previously set. If the widget is to be set, and is in
a radio group then this procedure may unset another Toggle
widget causing all routines on its callback list to be
invoked. The callback routines for the Toggle that is to be
unset will be called before the one that is to be
set.

reset()

Cancels any set or highlight and
displays the interior of the Toggle widget in the
background color, with the label displayed in the
foreground color.

notify()

When the Toggle widget is in the set state
this action calls all functions in the callback list named
by the callback resource. The value of the call_data
argument in these callback functions is
undefined.

Note

When a bitmap of depth
greater that one (1) is specified the set(),
unset(), and reset() actions have no effect,
since there are no foreground and background colors used in
a multi-plane pixmap.

3.10.4. Radio
Groups

There are typically two
types of radio groups desired by applications. The default
translations for the Toggle widget implement a "zero or
one of many" radio group. This means that there may be
no more than one Toggle widget active, but there need not be
any Toggle widgets active.

The other type of radio
group is "one of many" and has the more strict
policy that there will always be exactly one radio button
active. Toggle widgets can be used to provide this interface
with a slight modification to the translation table of each
Toggle in the group.

<EnterWindow>:

highlight(Always)

<LeaveWindow>:

unhighlight()

<Btn1Down>,<Btn1Up>:set()
notify()

This translation table
will not allow any Toggle to be unset except as a
result of another Toggle becoming set. It is the
application programmer’s responsibility to choose an
initial state for the radio group by setting the
state resource of one of its member widgets to
True.

3.10.5. Convenience
Routines

The following functions
allow easy access to the Toggle widget’s radio group
functionality.

3.10.5.1. Changing the
Toggle’s Radio Group.

To enable an application
to change the Toggle’s radio group, add the Toggle to
a radio group, or remove the Toggle from a radio group, use
XawToggleChangeRadioGroup.
void XawToggleChangeRadioGroup(w, radio_group)
Widget w, radio_group;

w

Specifies the Toggle widget.

radio_groupSpecifies
any Toggle in the new radio group. If NULL then the Toggle
will be removed from any radio group of which it is a
member.

If a Toggle is already
set in the new radio group, and the Toggle to be
added is also set then the previously set
Toggle in the radio group is unset and its callback
procedures are invoked.

Finding the Currently
selected Toggle in a radio group of Toggles

To find the currently
selected Toggle in a radio group of Toggle widgets use
XawToggleGetCurrent.
XtPointer XawToggleGetCurrent(radio_group);
Widget radio_group;

radio_groupSpecifies
any Toggle widget in the radio group.

The value returned by
this function is the radioData of the Toggle in this
radio group that is currently set. The default value for
radioData is the name of that Toggle widget. If no
Toggle is set in the radio group specified then NULL is
returned.

Changing the Toggle
that is set in a radio group.

To change the Toggle that
is currently set in a radio group use
XawToggleSetCurrent.
void XawToggleSetCurrent(radio_group,
radio_data);
Widget radio_group;
XtPointer radio_data;

radio_groupSpecifies
any Toggle widget in the radio group.

radio_dataSpecifies
the radioData identifying the Toggle that should be
set in the radio group specified by the radio_group
argument.

XawToggleSetCurrent
locates the Toggle widget to be set by matching
radio_data against the radioData for each
Toggle in the radio group. If none match,
XawToggleSetCurrent returns without making any
changes. If more than one Toggle matches,
XawToggleSetCurrent will choose a Toggle to set
arbitrarily. If this causes any Toggle widgets to change
state, all routines in their callback lists will be invoked.
The callback routines for a Toggle that is to be unset will
be called before the one that is to be set.

Unsetting all Toggles
in a radio group.

To unset all Toggle
widgets in a radio group use XawToggleUnsetCurrent.
void XawToggleUnsetCurrent(radio_group);
Widget radio_group;

radio_groupSpecifies
any Toggle widget in the radio group.

If this causes a Toggle
widget to change state, all routines on its callback list
will be invoked.

Chapter
4

Menus

The Athena widget set
provides support for single paned non-hierarchical popup and
pulldown menus. Since menus are such a common user interface
tool, support for them must be provided in even the most
basic widget sets. In menuing as in other areas, the Athena
Widget Set provides only basic functionality.

Menus in the Athena
widget set are implemented as a menu container (the
SimpleMenu widget) and a collection of objects that comprise
the menu entries. The SimpleMenu widget is itself a direct
subclass of the OverrideShell widget class, so no other
shell is necessary when creating a menu. The managed
children of a SimpleMenu must be subclasses of the Sme
(Simple Menu Entry) object.

The Athena widget set
provides three classes of Sme objects that may be used to
build menus.

Sme

The base class of all menu entries. It may be
used as a menu entry itself to provide blank space in a
menu. ‘‘Sme’’ means
‘‘Simple Menu Entry.’’

SmeBSB

This menu entry provides a selectable entry
containing a text string. A bitmap may also be placed in the
left and right margins. ‘‘BSB’’
means ‘‘Bitmap String
Bitmap.’’

The SimpleMenu widget
informs the window manager that it should ignore its window
by setting the Override Redirect flag. This is the
correct behavior for the press-drag-release style of menu
operation. If click-move-click or
‘‘pinable’’’ menus are desired
it is the responsibility of the application programmer,
using the SimpleMenu resources, to inform the window manager
of the menu.

To allow easy creation of
pulldown menus, a MenuButton widget is also provided as part
of the Athena widget set.

4.1. Using the
Menus

The default configuration
for the menus is press-drag-release. The menus will
typically be activated by clicking a pointer button while
the pointer is over a MenuButton, causing the menu to appear
in a fixed location relative to that button; this is a
pulldown menu. Menus may also be activated when a
specific pointer and/or key sequence is used anywhere in the
application; this is a popup menu (e.g. clicking
Ctrl-<pointer button 1> in the common application
xterm). In this case the menu should be positioned
under the cursor. Typically menus will be placed so the
pointer cursor is on the first menu entry, or the last entry
selected by the user.

The menu remains on the
screen as long as the pointer button is held down. Moving
the pointer will highlight different menu items. If the
pointer leaves the menu, or moves over an entry that cannot
be selected then no menu entry will highlighted. When the
desired menu entry has been highlighted, releasing the
pointer button removes the menu, and causes any mechanism
associated with this entry to be invoked.

4.2. SimpleMenu
Widget

Application Header
file<X11/Xaw/SimpleMenu.h>

Class Header file

<X11/Xaw/SimpleMenP.h>

Class

simpleMenuWidgetClass

Class Name

SimpleMenu

Superclass

OverrideShell

The SimpleMenu widget is
a container for the menu entries. It is a direct subclass of
shell, and is should be created with
XtCreatePopupShell, not XtCreateManagedWidget.
This is the only part of the menu that actually is
associated with a window. The SimpleMenu serves as the glue
to bind the individual menu entries together into a
menu.

A list of event to action bindings to be executed
by this widget, even though the event occurred in another
widget. (See the X Toolkit Intrinsics — C Language
Interface for details).

ancestorSensitive
The sensitivity state of the ancestors of this widget. A
widget is insensitive if either it or any of its ancestors
is insensitive. This resource should not be changed with
XtSetValues, although it may be queried.

backingStore

Determines what type of backing store will be
used for the menu. Legal values for this resource are
NotUseful, WhenMapped, and Always.
These values are the backing-store integers defined in
<X11/X.h>. A converter is registered for this resource
that will convert the following strings: notUseful,
whenMapped, always, and default. If
default is specified (the default behavior) the
server will use whatever it thinks is
appropriate.

background

A pixel value which indexes the widget’s
colormap to derive the background color of the
widget’s window.

backgroundPixmapThe
background pixmap of this widget’s window. If this
resource is set to anything other than
XtUnspecifiedPixmap, the pixmap specified will be
used instead of the background color.

borderColor

A pixel value which indexes the widget’s
colormap to derive the border color of the widget’s
window.

borderPixmap

The border pixmap of this widget’s window.
If this resource is set to anything other than
XtUnspecifiedPixmap, the pixmap specified will be
used instead of the border color.

borderWidth

The width of this widget’s window
border.

bottomMargin

topMargin

The amount of space between the top or bottom of
the menu and the menu entry closest to that
edge.

children

A list of all this composite widget’s
current children.

colormap

The colormap that this widget will
use.

cursor

The shape of the mouse pointer whenever it is in
this widget.

depth

The depth of this widget’s
window.

destroyCallbackAll
functions on this list are called when this widget is
destroyed.

geometry

If this resource is specified it will override
the x, y, width and height of this widget. The format of
this string is
[<width>x<height>][{+ -}
<xoffset> {+
-}<yoffset>].

height

width

The height and width of this widget in
pixels.

label

This label will be placed at the top of the
SimpleMenu, and may not be highlighted. The name of the
label object is menuLabel. Using this name it is
possible to modify the label’s attributes through the
resource database. When the label is created, the
label is hard coded to the value of label, and
justify is hard coded as
XtJustifyCenter.

labelClass

Specifies the type of Sme object created as the
menu label.

mappedWhenManaged
If this resource is True, then the widget’s
window will automatically be mapped by the Toolkit when it
is realized and managed.

menuOnScreen

If the menu is automatically positioned under the
cursor with the XawPositionSimpleMenu action, and
this resource is True, then the menu will always be
fully visible on the screen.

numChildren

The number of children in this composite
widget.

overrideRedirectDetermines
the value of the override_redirect attribute of the
SimpleMenu’s window. The override_redirect attribute
of a window determines whether or not a window manager may
interpose itself between this window and the root window of
the display. For more information see the Interclient
Communications Conventions Manual.

popdownCallback

popupCallback

These callback functions are called by the Xt
Intrinsics whenever the shell is popped up or down (See X
Toolkit Intrinsics — C Language Interface for
details).

popupOnEntry

The XawPositionSimpleMenu action will, by
default, popup the SimpleMenu with its label (or first
entry) directly under the pointer. To popup the menu under
another entry, set this resource to the menu entry that
should be under the pointer, when the menu is popped up.
This allows the application to offer the user a default menu
entry that can be selected with out moving the
pointer.

rowHeight

If this resources is zero (the default) then each
menu entry will be given its desired height. If this
resource has any other value then all menu entries will be
forced to be rowHeight pixels high.

saveUnder

If this is True then save unders will be
active on the menu’s window.

screen

The screen on which this widget is displayed.
This is not a settable resource.

sensitive

Whether or not the toolkit should pass user
events to this widget. The widget will not get input events
if either ancestorSensitive or sensitive is
False.

translations

The event bindings associated with this
widget.

x

y

The location of the upper left outside corner of
this widget in its parent.

4.2.2. SimpleMenu
Actions

The SimpleMenu widget
supports the following actions:

•

Switching the entry under the mouse pointer
between the foreground and background colors with
highlight and unhighlight

•

Processing menu entry callbacks with
notify

The following are the
default translation bindings used by the SimpleMenu
widget:

<EnterWindow>:

highlight()

<LeaveWindow>:

unhighlight()

<BtnMotion>:

highlight()

<BtnUp>:

MenuPopdown() notify() unhighlight()

The user can pop down the
menu without activating any of the callback functions by
releasing the pointer button when no menu item is
highlighted.

The full list of actions
supported by SimpleMenu is:

highlight()

Highlight the menu entry that is currently under
the pointer. Only a item that is highlighted will be
notified when the notify action is invoked. The look
of a highlighted entry is determined by the menu
entry.

unhighlight()

Unhighlights the currently highlighted menu item,
and returns it to its normal look.

notify()

Notifies the menu entry that is currently
highlighted that is has been selected. It is the
responsibility of the menu entry to take the appropriate
action.

If the SimpleMenu widget
is to be used as a pulldown menu then the MenuButton widget,
or some other outside means should be used to place the menu
when it is popped up.

If popup menus are
desired it will be necessary to add the
XawPositionSimpleMenu and MenuPopup actions to
the translation table of the widget that will be popping up
the menu. The MenuPopup action is described in X
Toolkit Intrinsics — C Language Interface.
XawPositionSimpleMenu is a global action procedure
registered by the SimpleMenu widget when the first one is
created or the convenience routine
XawSimpleMenuAddGlobalActions is called.

Translation writers
should be aware that Xt does not register grabs on
‘‘don’t care’’ modifiers, and
therefore the left hand side of the production should be
written to exclude unspecified modifiers. For example these
are the translations needed to popup some of
xterm’s menus:

!Ctrl<Btn1Down>:
XawPositionSimpleMenu(xterm) MenuPopup(xterm)

!Ctrl<Btn2Down>:
XawPositionSimpleMenu(modes) MenuPopup(modes)

XawPositionSimpleMenu(menu)
The XawPositionSimpleMenu routine will search for the
menu name passed to it using XtNameToWidget starting
with the widget invoking the action as the reference widget.
If it is unsuccessful it will continue up the widget tree
using each of the invoking widget’s ancestors as the
reference widget. If it is still unsuccessful it will print
a warning message and give up. XawPositionSimpleMenu
will position the menu directly under the pointer cursor.
The menu will be placed so that the pointer cursor is
centered on the entry named by the popupOnEntry
resource. If the menuOnScreen resource is True
then the menu will always be fully visible on the
screen.

4.2.4. Convenience
Routines

4.2.4.1. Registering
the Global Action Routines

The
XawPositionSimpleMenu action routine may often be
invoked before any menus have been created. This can occur
when an application uses dynamic menu creation. In these
cases an application will need to register this global
action routine by calling
XawSimpleMenuAddGlobalActions:
void XawSimpleMenuAddGlobalActions(app_con)
XtAppContext app_con;

app_con

Specifies the application context in which this
action should be registered.

This function need only
be called once per application and must be called before any
widget that uses XawPositionSimpleMenu action is
realized.

4.2.4.2. Getting and
Clearing the Current Menu Entry

To get the currently
highlighted menu entry use
XawSimpleMenuGetActiveEntry:
Widget XawSimpleMenuGetActiveEntry(w)
Widget w;

w

Specifies the SimpleMenu widget.

This function returns the
menu entry that is currently highlighted, or NULL if no
entry is highlighted.

To clear the SimpleMenu
widget’s internal information about the currently
highlighted menu entry use
XawSimpleMenuClearActiveEntry:
Widget XawSimpleMenuClearActiveEntry(w)
Widget w;

w

Specifies the SimpleMenu widget.

This function unsets all
internal references to the currently highlighted menu entry.
It does not unhighlight or otherwise alter the
appearance of the active entry. This function is primarily
for use by implementors of menu entries.

4.3. SmeBSB
Object

Application Header
file<X11/Xaw/SmeBSB.h>

Class Header file

<X11/Xaw/SmeBSBP.h>

Class

smeBSBObjectClass

Class Name

SmeBSB

Superclass

Sme

The SmeBSB object is used
to create a menu entry that contains a string, and optional
bitmaps in its left and right margins. Since each menu entry
is an independent object, the application is able to change
the font, color, height, and other attributes of the menu
entries, on an entry by entry basis. The format of the
string may either be the encoding of the 8 bit font
utilized, or in a multi-byte encoding for use with a
fontSet.

ancestorSensitive
The sensitivity state of the ancestors of this widget. A
widget is insensitive if either it or any of its ancestors
is insensitive. This resource should not be changed with
XtSetValues, although it may be queried.

callback

All callback functions on this list are called
when the SimpleMenu notifies this entry that the user
has selected it.

destroyCallbackAll
functions on this list are called when this widget is
destroyed.

font

The text font to use when displaying the
label, when the international resource is
false.

fontSet

The text font set to use when displaying the
label, when the international resource is
true.

foreground

A pixel value which indexes the
SimpleMenu’s colormap to derive the foreground color
of the menu entry’s window. This color is also used to
render all 1’s in the left and right
bitmaps.

height

width

The height and width of this widget in pixels.
Keep in mind that the SimpleMenu widget will force the width
of all menu entries to be the width of the longest
entry.

international

This is a boolean flag, only settable at widget
creation time. A value of false signals the widget to
use pre-R6 internationalization (specifically, the lack
thereof), such as using fonts for displaying text, etc. A
value of true directs the widget to act in an
internationalized manner, such as utilizing font sets for
displaying text, etc.

justify

How the label is to be rendered between the left
and right margins when the space is wider than the actual
text. This resource may be specified with the values
XtJustifyLeft, XtJustifyCenter, or
XtJustifyRight. When specifying the justification
from a resource file the values left, center,
or right may be used.

label

This is a the string that will be displayed in
the menu entry. The exact location of this string within the
bounds of the menu entry is controlled by the
leftMargin, rightMargin, vertSpace, and
justify resources.

leftBitmap

rightBitmap

This is a name of a bitmap to display in the left
or right margin of the menu entry. All 1’s in the
bitmap will be rendered in the foreground color, and all
0’s will be drawn in the background color of the
SimpleMenu widget. It is the programmers’
responsibility to make sure that the menu entry is tall
enough, and the appropriate margin wide enough to accept the
bitmap. If care is not taken the bitmap may extend into
another menu entry, or into this entry’s
label.

leftMargin

rightMargin

This is the amount of space (in pixels) that will
be left between the edge of the menu entry and the label
string.

sensitive

Whether or not the toolkit should pass user
events to this widget. The widget will not get input events
if either ancestorSensitive or sensitive is
False.

vertSpace

This is the amount of vertical padding, expressed
as a percentage of the height of the font, that is to be
placed around the label of a menu entry.. The label and
bitmaps are always centered vertically within the menu. The
default value for this resource (25) causes the default
height to be 125% of the height of the font.

4.4. SmeLine
Object

Application Header
file<X11/Xaw/SmeLine.h>

Class Header file

<X11/Xaw/SmeLineP.h>

Class

smeLineObjectClass

Class Name

SmeLine

Superclass

Sme

The SmeLine object is
used to add a horizontal line or menu separator to a menu.
Since each SmeLine is an independent object, the application
is able to change the color, height, and other attributes of
the SmeLine objects on an entry by entry basis. This object
is not selectable, and will not highlight when the pointer
cursor is over it.

destroyCallbackAll
functions on this list are called when this widget is
destroyed.

foreground

A pixel value which indexes the
SimpleMenu’s colormap to derive the foreground color
used to draw the separator line.

height

width

The height and width of this widget in pixels.
Keep in mind that the SimpleMenu widget will force all menu
items to be the width of the widest entry. Thus, setting the
width is generally not very important.

international

This is a boolean flag, only settable at widget
creation time. While not utilized in this widget, it can and
should be checked by any subclasses that have behavior that
should vary with locale.

lineWidth

The width of the horizontal line that is to be
displayed.

stipple

If a bitmap is specified for this resource, the
line will be stippled through it. This allows the menu
separator to be rendered as something more exciting than
just a line. For instance, if you define a stipple that is a
chain link, then your menu separators will look like
chains.

4.5. Sme
Object

Application Header
file<X11/Xaw/Sme.h>

Class Header file

<X11/Xaw/SmeP.h>

Class

smeObjectClass

Class Name

Sme

Superclass

RectObj

The Sme object is the
base class for all menu entries. While this object is mainly
intended to be subclassed, it may be used in a menu to add
blank space between menu entries.

4.5.1.
Resources

The resources associated
with the SmeLine object are defined in this section, and
affect only the single menu entry specified by this object.
There are no new resources added for this class, as it picks
up all its resources from the RectObj class.
Name Class Type Notes Default Value
ancestorSensitive AncestorSensitive Boolean True
callback Callback XtCallbackList NULL
destroyCallback Callback XtCallbackList NULL
height Height Dimension 0
international International Boolean C False
sensitive Sensitive Boolean True
width Width Dimension 1

ancestorSensitive
The sensitivity state of the ancestors of this widget. A
widget is insensitive if either it or any of its ancestors
is insensitive. This resource should not be changed with
XtSetValues, although it may be queried.

destroyCallbackAll
functions on this list are called when this widget is
destroyed.

height

width

The height and width of this widget in pixels.
Keep in mind that the SimpleMenu widget will force all menu
items to be the width of the widest entry.

international

This is a boolean flag, only settable at widget
creation time. While not utilized in this widget, it can and
should be checked by any subclasses that have behavior that
should vary with locale.

sensitive

Whether or not the toolkit should pass user
events to this widget. The widget will not get input events
if either ancestorSensitive or sensitive is
False.

4.5.2. Subclassing the
Sme Object

To Create a new Sme
object class you will need to define three class
methods. These methods allow the SimpleMenu to highlight and
unhighlight the menu entry as the pointer cursor moves over
it, as well as notify the entry when the user has selected
it. All of these methods may be inherited from the Sme
object, although the default semantics are not very
interesting.

Highlight()Called
to put the menu entry into the highlighted
state.

Unhighlight()
Called to return the widget to its normal (unhighlighted)
state.

Notify()

Called when the user selects this menu
entry.

Other then these methods,
creating a new object is straight forward. Here is some
information that may help you avoid some common
mistakes.

1)

Objects can be zero pixels high.

2)

Objects draw on their parent’s window,
therefore the Drawing dimensions are different from those of
widgets. For instance, y locations vary from y to
y + height, not 0 to
height.

3)

XtSetValues calls may come from the application
while the Sme is highlighted, and if the SetValues method
returns True, will result in an expose event. The SimpleMenu
may later call the menu entry’s unhighlight
procedure. However, due to the asynchronous nature of X, the
expose event generated by XtSetValues will come
after this unhighlight.

4)

Remember that your subclass of the Sme does not
own the window. Share the space with other menu entries, and
refrain from drawing outside the subclass’s own
section of the menu.

4.6. MenuButton
Widget

Application Header
file<X11/Xaw/MenuButton.h>

Class Header file

<X11/Xaw/MenuButtonP.h>

Class

menuButtonWidgetClass

Class Name

MenuButton

Superclass

Command

The MenuButton widget is
an area, often rectangular, that displays a graphic. The
graphic may be a text string containing multiple lines of
characters in an 8 bit or 16 bit character set (to be
displayed with a font), or in a multi-byte encoding
(for use with a fontset). The graphic may also be a
bitmap or pixmap.

When the pointer cursor
is on a MenuButton widget, the MenuButton becomes
highlighted by drawing a rectangle around its perimeter.
This highlighting indicates that the MenuButton is ready for
selection. When a pointer button is pressed, the MenuButton
widget will pop up the menu named in the menuName
resource.

A list of event to action bindings to be executed
by this widget, even though the event occurred in another
widget. (See the X Toolkit Intrinsics — C Language
Interface for details).

ancestorSensitive
The sensitivity state of the ancestors of this widget. A
widget is insensitive if either it or any of its ancestors
is insensitive. This resource should not be changed with
XtSetValues, although it may be queried.

background

A pixel value which indexes the widget’s
colormap to derive the background color of the
widget’s window.

backgroundPixmapThe
background pixmap of this widget’s window. If this
resource is set to anything other than
XtUnspecifiedPixmap, the pixmap specified will be
used instead of the background color.

bitmap

A bitmap to display instead of the label.
The default size of the widget will be just large enough to
contain the bitmap and the widget’s internal width and
height. The resource converter for this resource constructs
bitmaps from the contents of files. (See Converting
Bitmaps for details.) If this bitmap is one bit deep
then the 1’s will be rendered in the foreground color,
and the 0’s in the background color. If bitmap
has a depth greater than one, it is copied directly into the
window.

borderColor

A pixel value which indexes the widget’s
colormap to derive the border color of the widget’s
window.

borderPixmap

The border pixmap of this widget’s window.
If this resource is set to anything other than
XtUnspecifiedPixmap, the pixmap specified will be
used instead of the border color.

borderWidth

The width of this widget’s window
border.

callback

A list of routines to be called when the
notify action is invoked.

colormap

The colormap that this widget will
use.

cornerRoundPercent
When a ShapeStyle of roundedRectangle is used,
this resource controls the radius of the rounded corner. The
radius of the rounded corners is specified as a percentage
of the length of the shortest side of the
widget.

cursor

The image that will be displayed as the pointer
cursor whenever it is in this widget. The use of this
resource is deprecated in favor of
cursorName.

cursorName

The name of the symbol to use to represent the
pointer cursor. This resource will override the
cursor resource if both are specified. (See
2.4.1)

depth

The depth of this widget’s
window.

destroyCallbackAll
functions on this list are called when this widget is
destroyed.

font

The text font to use when displaying the
label, when the international resource is
false.

fontSet

The text font set to use when displaying the
label, when the international resource is
true.

foreground

A pixel value which indexes the widget’s
colormap to derive the foreground color of the
widget’s window. This color is also used to render all
1’s in a bitmap one plane deep.

height

width

The height and width of this widget in
pixels.

highlightThickness
The thickness of the rectangle that is used to highlight the
internal border of this widget, alerting the user that it is
ready to be selected. The default value is 2 pixels if the
shapeStyle is rectangle, and 0 Pixels (no
highlighting) otherwise.

insensitiveBorder
This pixmap will be tiled into the widget’s border if
the widget becomes insensitive.

internalHeight

internalWidth

The minimum amount of space to leave between the
graphic and the vertical and horizontal edges of the
window.

international

This is a boolean flag, only settable at widget
creation time. A value of false signals the widget to
use pre-R6 internationalization (specifically, the lack
thereof), such as using fonts for displaying text, etc. A
value of true directs the widget to act in an
internationalized manner, such as utilizing font sets for
displaying text, etc.

justify

Specifies left, center, or right alignment of
graphic within the widget. This resource may be specified
with the values XtJustifyLeft,
XtJustifyCenter, or XtJustifyRight. A
converter is registered for this resource that will convert
the following strings: left, right, and
center. This resource only has noticeable effect when
the width of the widget is larger than necessary to display
the graphic. Note that when the graphic is a multi-line
label, the longest line will obey this justification
while shorter lines will be left-justified with the longest
one.

label

Specifies the text string to be displayed in the
widget’s window if no bitmap is specified. The default
is the name of this widget. Regardless of the value of
encoding or international, a single newline
character (1 byte) will cause a line break.

mappedWhenManaged
If this resource is True, then the widget’s
window will automatically be mapped by the Toolkit when it
is realized and managed.

menuName

The name of a popup shell to popup as a menu. The
MenuButton will search for this name using
XtNameToWidget starting with itself as the reference
widget. If the search is unsuccessful the widget will
continue up the widget tree using each of its ancestors as
the reference widget passed to XtNameToWidget. If no
widget of called menuName is found by this algorithm,
the widget will print a warning message and give up. When
the menu is found it will be popped up exclusive and
spring_loaded. The MenuButton widget does not copy the value
of this resource into newly allocated memory. The
application programmer must pass the resource value in
nonvolatile memory.

pointerColor

A pixel value which indexes the widget’s
colormap to derive the foreground color of the pointer
symbol specified by the cursorName
resource.

pointerColorBackground
A pixel value which indexes the widget’s colormap to
derive the background color of the pointer symbol specified
by the cursorName resource.

resize

Specifies whether the widget should attempt to
resize to its preferred dimensions whenever its resources
are modified with XtSetValues. This attempt to resize
may be denied by the parent of this widget. The parent is
always free to resize the widget regardless of the state of
this resource.

screen

The screen on which this widget is displayed.
This is not a settable resource.

sensitive

Whether or not the toolkit should pass user
events to this widget. The widget will not get input events
if either ancestorSensitive or sensitive is
False.

shapeStyle

Nonrectangular widgets may be created using this
resource. Nonrectangular widgets are supported only on a
server that supports the Shape Extension. If
nonrectangular widgets are specified for a server lacking
this extension, the shape is ignored and the widgets will be
rectangular. The following shapes are currently supported:
XmuShapeRectangle, XmuShapeOval,
XmuShapeEllipse, and XmuShapeRoundedRectangle.
A converter is registered for this resource that will
convert the following strings: rectangle, oval,
ellipse, and roundedRectangle.

translations

The event bindings associated with this
widget.

x

y

The location of the upper left outside corner of
this widget in its parent.

4.6.2. MenuButton
Actions

The MenuButton widget
supports the following actions:

•

Switching the button between the foreground and
background colors with set and
unset

•

Processing application callbacks with
notify

•

Switching the internal border between highlighted
and unhighlighted states with highlight and
unhighlight

•

Popping up a menu with
PopupMenu

The following are the
default translation bindings used by the MenuButton
widget:

<EnterWindow>:

highlight()

<LeaveWindow>:

reset()

<BtnDown>:

reset() PopupMenu(

4.6.3. MenuButton
Actions

The full list of actions
supported by MenuButton is:

highlight(condition)
Displays the internal highlight border in the color
(foreground or background ) that contrasts
with the interior color of the Command widget. The
conditions WhenUnset and Always are understood
by this action procedure. If no argument is passed,
WhenUnset is assumed.

unhighlight()

Displays the internal highlight border in the
color (XtNforeground or background ) that
matches the interior color of the MenuButton
widget.

set()

Enters the set state, in which
notify is possible. This action causes the button to
display its interior in the foreground color. The
label or bitmap is displayed in the background
color.

unset()

Cancels the set state and displays the
interior of the button in the background color. The
label or bitmap is displayed in the foreground
color.

reset()

Cancels any set or highlight and
displays the interior of the button in the background
color, with the label displayed in the foreground
color.

notify()

When the button is in the set state this
action calls all functions in the callback list named by the
callback resource. The value of the call_data
argument in these callback functions is
undefined.

PopupMenu()

Pops up the menu specified by the menuName
resource.

The MenuButton widget
does not place a server grab on itself. Instead, PopupMenu
is registered as a grab action. As a result, clients which
popup menus without using XtMenuPopup or MenuPopup or
PopupMenu in translations will fail to have a grab active.
They should make a call to XtRegisterGrabAction on the
appropriate action in the application initialization
routine, or use a different translation.

Chapter
5

Text
Widgets

The Text widget provides
a window that will allow an application to display and edit
one or more lines of text. Options are provided to allow the
user to add Scrollbars to its window, search for a specific
string, and modify the text in the buffer.

The Text widget is made
up of a number of pieces; it was modularized to ease
customization. The AsciiText widget class (actually not
limited to ASCII but so named for compatibility) is be
general enough to most needs. If more flexibility, special
features, or extra functionality is needed, they can be
added by implementing a new TextSource or TextSink, or by
subclassing the Text Widget (See Section 5.8 for
customization details.)

The words insertion
point are used in this chapter to refer to the text
caret. This is the symbol that is displayed between two
characters in the file. The insertion point marks the
location where any new characters will be added to the file.
To avoid confusion the pointer cursor will always be
referred to as the pointer.

The text widget supports
three edit modes, controlling the types of modifications a
user is allowed to make:

•

Append-only

•

Editable

•

Read-only

Read-only mode does not
allow the user or the programmer to modify the text in the
widget. While the entire string may be reset in read-only
mode with XtSetValues, it cannot be modified via with
XawTextReplace. Append-only and editable modes allow
the text at the insertion point to be modified. The only
difference is that text may only be added to or removed from
the end of a buffer in append-only mode.

5.1. Text Widget for
Users

The Text widget provides
many of the common keyboard editing commands. These commands
allow users to move around and edit the buffer. If an
illegal operation is attempted, (such as deleting characters
in a read-only text widget), the X server will
beep.

5.1.1. Default Key
Bindings

The default key bindings
are patterned after those in the EMACS text
editor:

Ctrl-a

Beginning Of Line

Meta-b

Backward Word

Ctrl-b

Backward Character

Meta-f

Forward Word

Ctrl-d

Delete Next Character

Meta-iInsert File

Ctrl-e

End Of Line

Meta-k

Kill To End Of Paragraph

Ctrl-f

Forward Character

Meta-q

Form Paragraph

Ctrl-g

Multiply Reset

Meta-v

Previous Page

Ctrl-h

Delete Previous Character

Meta-yInsert Current Selection

Ctrl-j

Newline And Indent

Meta-z

Scroll One Line Down

Ctrl-k

Kill To End Of Line

Meta-d

Delete Next Word

Ctrl-l

Redraw Display

Meta-D

Kill Word

Ctrl-m

Newline

Meta-h

Delete Previous Word

Ctrl-n

Next Line

Meta-H

Backward Kill Word

Ctrl-o

Newline And Backup

Meta-<

Beginning Of File

Ctrl-p

Previous Line

Meta->

End Of File

Ctrl-r

Search/Replace Backward

Meta-]Forward Paragraph

Ctrl-s

Search/Replace Forward

Meta-[Backward Paragraph

Ctrl-t

Transpose Characters

Ctrl-u

Multiply by 4

Meta-Delete

Delete Previous Word

Ctrl-v

Next Page

Meta-Shift DeleteKill Previous Word

Ctrl-w

Kill Selection

Meta-Backspace

Delete Previous Word

Ctrl-y

Unkill

Meta-Shift BackspaceKill Previous
Word

Ctrl-z

Scroll One Line Up

Ctrl-\

Reconnect to input method

Kanji

Reconnect to input method

In addition, the pointer
may be used to cut and paste text:

Button 1 Down

Start Selection

Button 1 MotionAdjust Selection

Button 1 Up

End Selection (cut)

Button 2 Down

Insert Current Selection (paste)

Button 3 Down

Extend Current Selection

Button 3 MotionAdjust Selection

Button 3 Up

End Selection (cut)

Since all of these key
and pointer bindings are set through the translations and
resource manager, the user and the application programmer
can modify them by changing the Text widget’s
translations resource.

5.1.2. Search and
Replace

The Text widget provides
a search popup that can be used to search for a string
within the current Text widget. The popup can be activated
by typing either Control-r or Control-s. If
Control-s is used the search will be forward in the
file from the current location of the insertion point; if
Control-r is used the search will be backward. The
activated popup is placed under the pointer. It has a number
of buttons that allow both text searches and text
replacements to be performed.

At the top of the search
popup are two toggle buttons labeled backward and
forward. One of these buttons will always be
highlighted; this is the direction in which the search will
be performed. The user can change the direction at any time
by clicking on the appropriate button.

Directly under the
buttons there are two text areas, one labeled Search
for: and the other labeled Replace with:. If this
is a read-only Text widget the Replace with: field
will be insensitive and no replacements will be allowed.
After each of these labels will be a text field. This field
will allow the user to enter a string to search for and the
string to replace it with. Only one of these text fields
will have a window border around it; this is the active text
field. Any key presses that occur when the focus in in the
search popup will be directed to the active text field.
There are also a few special key sequences:

Carriage Return:

Execute the action, and pop down the search
widget.

Tab:

Execute the action, then move to the next
field.

Shift Carriage
Return:Execute the action, then move to the next
field.

Control-q Tab:

Enter a Tab into a text field.

Control-c:

Pop down the search popup.

Using these special key
sequences should allow simple searches without ever removing
one’s hands from the keyboard.

Near the bottom of the
search popup is a row of buttons. These buttons allow the
same actions to to be performed as the key sequences, but
the buttons will leave the popup active. This can be quite
useful if many searches are being performed, as the popup
will be left on the display. Since the search popup is a
transient window, it may be picked up with the window
manager and pulled off to the side for use at a later
time.

Search

Search for the specified string.

Replace

Replace the currently highlighted string with the
string in the Replace with text field, and move onto
the next occurrence of the Search for text field. The
functionality is commonly referred to as
query-replace.

Replace-All

Replace all occurrences of the search string with
the replace string from the current insertion point position
to the end (or beginning) of the file. There is no key
sequence to perform this action.

Cancel

Remove the search popup from the
screen.

Finally, when
international resource is true, there may be a
pre-edit buffer below the button row, for composing input.
Its presence is determined by the X locale in use and the
VendorShell’s preeditType resource.

The widget hierarchy for
the search popup is show below, all widgets are listed by
class and instance name.

Text <name of Text
widget>

TransientShell search

Form form

Label label1

Label label2

Toggle backwards

Toggle forwards

Label searchLabel

Text searchText

Label replaceLabel

Text replaceText

Command search

Command replaceOne

Command replaceAll

Command cancel

5.1.3. File
Insertion

To insert a file into a
text widget, type the key sequence Meta-i, which will
activate the file insert popup. This popup will appear under
the pointer, and any text typed while the focus is in this
popup will be redirected to the text field used for the
filename. When the desired filename has been entered, click
on Insert File, or type Carriage Return. The
named file will then be inserted in the text widget
beginning at the insertion point position. If an error
occurs when opening the file, an error message will be
printed, prompting the user to enter the filename again. The
file insert may be aborted by clicking on Cancel. If
Meta-i is typed at a text widget that is read-only,
it will beep, as no file insertion is allowed.

The widget hierarchy for
the file insert popup is show below; all widgets are listed
by class and instance name.

Text <name of Text
widget>

TransientShell insertFile

Form form

Label label

Text text

Command insert

Command cancel

5.1.4. Text Selections
for Users

The text widgets have a
text selection mechanism that allows the user to copy pieces
of the text into the PRIMARY selection, and paste
into the text widget some text that another application (or
text widget) has put in the PRIMARY
selection.

One method of selecting
text is to press pointer button 1 on the beginning of the
text to be selected, drag the pointer until all of the
desired text is highlighted, and then release the button to
activate the selection. Another method is to click pointer
button 1 at one end of the text to be selected, then click
pointer button 3 at the other end.

To modify a currently
active selection, press pointer button 3 near either the end
of the selection that you want to adjust. This end of the
selection may be moved while holding down pointer button 3.
When the proper area has been highlighted release the
pointer button to activate the selection.

The selected text may now
be pasted into another application, and will remain active
until some other client makes a selection. To paste text
that some other application has put into the PRIMARY
selection use pointer button 2. First place the insertion
point where you would like the text to be inserted, then
click and release pointer button 2.

Rapidly clicking pointer
button 1 the following number of times will adjust the
selection as described.

Two

Select the word under the pointer. A word
boundary is defined by the Text widget to be a Space, Tab,
or Carriage Return.

Three

Select the line under the pointer.

Four

Select the paragraph under the pointer. A
paragraph boundary is defined by the text widget as two
Carriage Returns in a row with only Spaces or Tabs between
them.

All editing functions are
performed by translation manager actions that may be
specified through the translations resource in the
Text widget.

Insert Point Movement

Delete

forward-character

delete-next-character

backward-character

delete-previous-character

forward-word

delete-next-word

backward-word

delete-previous-word

forward-paragraph

delete-selection

backward-paragraph

beginning-of-line

end-of-line

Selection

next-line

select-word

previous-line

select-all

next-page

select-start

previous-page

select-adjust

beginning-of-file

select-end

end-of-file

extend-start

scroll-one-line-up

extend-adjust

scroll-one-line-down

extend-end

insert-selection

Miscellaneous

New Line

redraw-display

newline-and-indent

insert-file

newline-and-backup

insert-char

newline

insert-string

display-caret

focus-in

Kill

focus-in

kill-word

search

backward-kill-word

multiply

kill-selection

form-paragraph

kill-to-end-of-line

transpose-characters

kill-paragraph

no-op

kill-to-end-of-paragraph

XawWMProtocols

reconnect-im

Most of the actions take
no arguments, and unless otherwise noted you may assume this
to be the case.

5.2.1. Cursor Movement
Actions

forward-character()

backward-character()These
actions move the insert point forward or backward one
character in the buffer. If the insert point is at the end
or beginning of a line this action will move the insert
point to the next (or previous) line.

forward-word()

backward-word()

These actions move the insert point to the next
or previous word boundary. A word boundary is defined as a
Space, Tab or Carriage Return.

forward-paragraph()

backward-paragraph()These
actions move the insert point to the next or previous
paragraph boundary. A paragraph boundary is defined as two
Carriage Returns in a row with only Spaces or Tabs between
them.

beginning-of-line()

end-of-line()

These actions move to the beginning or end of the
current line. If the insert point is already at the end or
beginning of the line then no action is taken.

next-line()

previous-line()

These actions move the insert point up or down
one line. If the insert point is currently N characters from
the beginning of the line then it will be N characters from
the beginning of the next or previous line. If N is past the
end of the line, the insert point is placed at the end of
the line.

next-page()

previous-page()

These actions move the insert point up or down
one page in the file. One page is defined as the current
height of the text widget. The insert point is always placed
at the first character of the top line by this
action.

beginning-of-file()

end-of-file()

These actions place the insert point at the
beginning or end of the current text buffer. The text widget
is then scrolled the minimum amount necessary to make the
new insert point location visible.

scroll-one-line-up()
scroll-one-line-down()
These actions scroll the current text field up or down by
one line. They do not move the insert point. Other than the
scrollbars this is the only way that the insert point may be
moved off of the visible text area. The widget will be
scrolled so that the insert point is back on the screen as
soon as some other action is executed.

5.2.2. Delete
Actions

delete-next-character()
delete-previous-character()
These actions remove the character immediately before or
after the insert point. If a Carriage Return is removed then
the next line is appended to the end of the current
line.

delete-next-word()

delete-previous-word()
These actions remove all characters between the insert point
location and the next word boundary. A word boundary is
defined as a Space, Tab or Carriage Return.

delete-selection()

This action removes all characters in the current
selection. The selection can be set with the selection
actions.

5.2.3. Selection
Actions

select-word()

This action selects the word in which the insert
point is currently located. If the insert point is between
words then it will select the previous word.

select-all()

This action selects the entire text
buffer.

select-start()

This action sets the insert point to the current
pointer location (if triggered by a button event) or text
cursor location (if triggered by a key event). It will then
begin a selection at this location. If many of these
selection actions occur quickly in succession then the
selection count mechanism will be invoked (see the section
titled Text Selections for Application Programmers
for details).

select-adjust()

This action allows a selection started with the
select-start action to be modified, as described
above.

select-end(name[,name,...])
This action ends a text selection that began with the
select-start action, and asserts ownership of the
selection or selections specified. A name can be a
selection (e.g., PRIMARY) or a cut buffer (e.g.,
CUT_BUFFER0). Note that case is important. If no
names are specified, PRIMARY is
asserted.

extend-start()

This action finds the nearest end of the current
selection, and moves it to the current pointer location (if
triggered by a button event) or text cursor location (if
triggered by a key event).

extend-adjust()

This action allows a selection started with an
extend-start action to be modified.

extend-end(name[,name,...])
This action ends a text selection that began with the
extend-start action, and asserts ownership of the
selection or selections specified. A name can be a
selection (e.g. PRIMARY) or a cut buffer (e.g
CUT_BUFFER0). Note that case is important. If no
names are given, PRIMARY is asserted.

insert-selection(name[,name,...])
This action retrieves the value of the first (left-most)
named selection that exists or the cut buffer that is not
empty and inserts it into the Text widget at the current
insert point location. A name can be a selection
(e.g. PRIMARY) or a cut buffer (e.g
CUT_BUFFER0). Note that case is
important.

5.2.4. The New Line
Actions

newline-and-indent()This
action inserts a newline into the text and adds spaces to
that line to indent it to match the previous
line.

newline-and-backup()This
action inserts a newline into the text after the
insert point.

newline()

This action inserts a newline into the text
before the insert point.

5.2.5. Kill and
Actions

kill-word()

backward-kill-word()These
actions act exactly like the delete-next-word and
delete-previous-word actions, but they stuff the word
that was killed into the kill buffer
(CUT_BUFFER_1).

kill-selection()

This action deletes the current selection and
stuffs the deleted text into the kill buffer
(CUT_BUFFER_1).

kill-to-end-of-line()This
action deletes the entire line to the right of the insert
point position, and stuffs the deleted text into the kill
buffer (CUT_BUFFER_1).

kill-paragraph()

This action deletes the current paragraph, if
between paragraphs it deletes the paragraph above the insert
point, and stuffs the deleted text into the kill buffer
(CUT_BUFFER_1).

kill-to-end-of-paragraph()
This action deletes everything between the current insert
point location and the next paragraph boundary, and stuffs
the deleted text into the kill buffer
(CUT_BUFFER_1).

5.2.6. Miscellaneous
Actions

redraw-display()

This action recomputes the location of all the
text lines on the display, scrolls the text to vertically
center the line containing the insert point on the screen,
clears the entire screen, and redisplays it.

insert-file([filename])
This action activates the insert file popup. The
filename option specifies the default filename to put
in the filename buffer of the popup. If no filename
is specified the buffer is empty at startup.

insert-char()

This action may only be attached to a key event.
When the international resource is false, this
action calls XLookupString to translate the event into a
(rebindable) Latin-1 character (sequence) and inserts it
into the text at the insert point. When the
international resource is true, characters are
passed to the input method via XwcLookupString, and any
committed string returned is inserted into the text at the
insert point.

insert-string(string[,string,...])
This action inserts each string into the text at the
insert point location. Any string beginning with the
characters "0x" followed by an even number of
hexadecimal digits is interpreted as a hexadecimal constant
and the corresponding string is inserted instead. This
hexadecimal string may represent up to 50 8-bit characters.
When theinternational resource is true, a
hexadecimal string is intrepeted as being in a multi-byte
encoding, and a hexadecimal or regular string will result in
an error message if it is not legal in the current
locale.

display-caret(state,when)
This action allows the insert point to be turned on and off.
The state argument specifies the desired state of the
insert point. This value may be any of the string values
accepted for Boolean resources (e.g. on, True,
off, False, etc.). If no arguments are
specified, the default value is True. The when
argument specifies, for EnterNotify or
LeaveNotify events whether or not the focus field in
the event is to be examined. If the second argument is not
specified, or specified as something other than
always then if the action is bound to an
EnterNotify or LeaveNotify event, the action
will be taken only if the focus field is True. An
augmented binding that might be useful is:

*Text.Translations: #override \

<FocusIn>:

display-caret(on) \n\

<FocusOut>:

display-caret(off)

focus-in()

focus-out()

These actions do not currently do
anything.

search(direction,[string])
This action activates the search popup. The direction
must be specified as either forward or
backward. The string is optional and is used as an
initial value for the Search for: string. For further
explanation of the search widget see the section on Text
Searches.

multiply(value)

The multiply action allows the user to multiply
the effects of many of the text actions. Thus the following
action sequence multiply(10) delete-next-word() will
delete 10 words. It does not matter whether these actions
take place in one event or many events. Using the default
translations the key sequence Control-u, Control-d
will delete 4 characters. Multiply actions can be chained,
thus multiply(5) multiply(5) is the same as
multiply(25). If the string reset is passed to
the multiply action the effects of all previous multiplies
are removed and a beep is sent to the display.

form-paragraph()

This action removes all the Carriage Returns from
the current paragraph and reinserts them so that each line
is as long as possible, while still fitting on the current
screen. Lines are broken at word boundaries if at all
possible. This action currently works only on Text widgets
that use ASCII text.

transpose-characters()
This action will swap the position of the character to the
left of the insert point with the character to the right of
the insert point. The insert point will then be advanced one
character.

no-op([action])

The no-op action makes no change to the text
widget, and is mainly used to override translations. This
action takes one optional argument. If this argument is
RingBell then a beep is sent to the
display.

XawWMProtocols([wm_protocol_name])

This
action is written specifically for the file insertion and
the search and replace dialog boxes. This action is attached
to those shells by the Text widget, in order to handle
ClientMessage events with the WM_PROTOCOLS atom in the
detail field. This action supports WM_DELETE_WINDOW on the
Text widget popups, and may support other window manager
protocols if necessary in the future. The popup will be
dismissed if the window manager sends a WM_DELETE_WINDOW
request and there are no parameters in the action call,
which is the default. The popup will also be dismissed if
the parameters include the string
‘‘wm_delete_window,’’ and the event
is a ClientMessage event requesting dismissal or is not a
ClientMessage event. This action is not sensitive to the
case of the strings passed as parameters.

reconnect-im()

When the international resource is
true, input is usually passed to an input method, a
separate process, for composing. Sometimes the connection to
this process gets severed; this action will attempt to
reconnect it. Causes for severage include network trouble,
and the user explicitly killing one input method and
starting a new one. This action may also establish first
connection when the application is started before the input
method.

5.2.7. Text Selections
for Application Programmers

The default behavior of
the text selection array is described in the section called
Text Selections for Users. To modify the selections a
programmer must construct a XawTextSelectType array
(called the selection array), containing the selections
desired, and pass this as the new value for the
selectionTypes resource. The selection array may also
be modified using the XawTextSetSelectionArray
function. All selection arrays must end with the value
XawselectNull. The selectionTypes resource has
no converter registered and cannot be modified through the
resource manager.

The array contains a list
of entries that will be called when the user attempts to
select text in rapid succession with the select-start
action (usually by clicking a pointer button). The first
entry in the selection array will be used when the
select-start action is initially called. The next
entry will be used when select-start is called again,
and so on. If a timeout value (1/10 of a second) is
exceeded, the the next select-start action will begin
at the top of the selection array. When XawselectNull
is reached the array is recycled beginning with the first
element.
XawselectAll
Selects the contents of the entire buffer.
XawselectChar
Selects text characters as the pointer
moves over them.
XawselectLine
Selects the entire line.
XawselectNull
Indicates the end of the selection array.
XawselectParagraph
Selects the entire paragraph.
XawselectPosition
Selects the current pointer position.
XawselectWord
Selects whole words as the pointer moves
onto them.

The selection array is
not copied by the text widgets. The application must
allocate space for the array and cannot deallocate or change
it until the text widget is destroyed or until a new
selection array is set.

5.3. Default
Translation Bindings

The following
translations are defaults built into every Text widget. They
can be overridden, or replaced by specifying a new value for
the Text widget’s translations
resource.

Ctrl<Key>A:

beginning-of-line() \n\

Ctrl<Key>B:

backward-character() \n\

Ctrl<Key>D:

delete-next-character() \n\

Ctrl<Key>E:

end-of-line() \n\

Ctrl<Key>F:

forward-character() \n\

Ctrl<Key>G:

multiply(Reset) \n\

Ctrl<Key>H:

delete-previous-character() \n\

Ctrl<Key>J:

newline-and-indent() \n\

Ctrl<Key>K:

kill-to-end-of-line() \n\

Ctrl<Key>L:

redraw-display() \n\

Ctrl<Key>M:

newline() \n\

Ctrl<Key>N:

next-line() \n\

Ctrl<Key>O:

newline-and-backup() \n\

Ctrl<Key>P:

previous-line() \n\

Ctrl<Key>R:

search(backward) \n\

Ctrl<Key>S:

search(forward) \n\

Ctrl<Key>T:

transpose-characters() \n\

Ctrl<Key>U:

multiply(4) \n\

Ctrl<Key>V:

next-page() \n\

Ctrl<Key>W:

kill-selection() \n\

Ctrl<Key>Y:

insert-selection(CUT_BUFFER1) \n\

Ctrl<Key>Z:

scroll-one-line-up() \n\

Ctrl<Key>\:

reconnect-im() \n\

Meta<Key>B:

backward-word() \n\

Meta<Key>F:

forward-word() \n\

Meta<Key>I:

insert-file() \n\

Meta<Key>K:

kill-to-end-of-paragraph() \n\

Meta<Key>Q:

form-paragraph() \n\

Meta<Key>V:

previous-page() \n\

Meta<Key>Y:

insert-selection(PRIMARY, CUT_BUFFER0)
\n\

Meta<Key>Z:

scroll-one-line-down() \n\

:Meta<Key>d:

delete-next-word() \n\

:Meta<Key>D:

kill-word() \n\

:Meta<Key>h:

delete-previous-word() \n\

:Meta<Key>H:

backward-kill-word() \n\

:Meta<Key>\<:

beginning-of-file() \n\

:Meta<Key>\>:

end-of-file() \n\

:Meta<Key>]:

forward-paragraph() \n\

:Meta<Key>[:

backward-paragraph() \n\

~Shift
Meta<Key>Delete:delete-previous-word() \n\

Shift
Meta<Key>Delete:backward-kill-word() \n\

~Shift
Meta<Key>Backspace:delete-previous-word()
\n\

Shift
Meta<Key>Backspace:backward-kill-word()
\n\

<Key>Right:

forward-character() \n\

<Key>Left:

backward-character() \n\

<Key>Down:

next-line() \n\

<Key>Up:

previous-line() \n\

<Key>Delete:

delete-previous-character() \n\

<Key>BackSpace:

delete-previous-character() \n\

<Key>Linefeed:

newline-and-indent() \n\

<Key>Return:

newline() \n\

<Key>:

insert-char() \n\

<Key>Kanji:

reconnect-im() \n\

<FocusIn>:

focus-in() \n\

<FocusOut>:

focus-out() \n\

<Btn1Down>:

select-start() \n\

<Btn1Motion>:

extend-adjust() \n\

<Btn1Up>:

extend-end(PRIMARY, CUT_BUFFER0) \n\

<Btn2Down>:

insert-selection(PRIMARY, CUT_BUFFER0)
\n\

<Btn3Down>:

extend-start() \n\

<Btn3Motion>:

extend-adjust() \n\

<Btn3Up>:

extend-end(PRIMARY, CUT_BUFFER0) \n

5.4. Text
Functions

The following functions
are provided as convenience routines for use with the Text
widget. Although many of these actions can be performed by
modifying resources, these interfaces are frequently more
efficient.

These data structures are
defined in the Text widget’s public header file,
<X11/Xaw/Text.h>.

typedef long
XawTextPosition;

Character positions in
the Text widget begin at 0 and end at n, where n is the
number of characters in the Text source widget.

typedef struct
{

int firstPos;

int length;

char *ptr;

unsigned long format;

} XawTextBlock, *XawTextBlockPtr;

firstPos

The first position, or index, to use within the
ptr field. The value is commonly zero.

length

The number of characters to be used from the
ptr field. The number of characters used is commonly
the number of characters in ptr, and must not be
greater than the length of the string in
ptr.

ptr

Contains the string to be referenced by the Text
widget.

format

This flag indicates whether the data pointed to
by ptr is char or wchar_t. When the associated widget
has international set to false this field must
be XawFmt8Bit. When the associated widget has
international set to true this field must be
either XawFmt8Bit or XawFmtWide.

Note: Previous versions
of Xaw used FMT8BIT, which has been retained for
backwards compatibility. FMT8BIT is deprecated and
will eventually be removed from the
implementation.

See section 5.4 for a
description of XawTextPosition. If redisplay is
enabled, this function highlights the text and makes it the
PRIMARY selection. This function does not have any
effect on CUT_BUFFER0.

To retrieve the text that
has been selected by this text widget use
XawTextGetSelectionPos:
void XawTextGetSelectionPos(w, begin_return,
end_return)
Widget w;
XawTextPosition *begin_return,
*end_return;

w

Specifies the Text widget.

begin_return
Returns the beginning of the text selection.

end_returnReturns
the end of the text selection.

See section 5.4 for a
description of XawTextPosition. If the returned
values are equal, no text is currently selected.

This function will not be
able to replace text in read-only text widgets. It will also
only be able to append text to an append-only text
widget.

See section 5.4 for a
description of XawTextPosition and
XawTextBlock.

This function may return
the following values:

XawEditDone

The text replacement was successful.

XawPositionError
The edit mode is XawtextAppend and start is
not the position of the last character of the
source.

XawEditErrorEither
the Source was read-only or the range to be deleted is
larger than the length of the Source.

The XawTextReplace
arguments start and end represent the text
source character positions for the existing text that is to
be replaced by the text in the text block. The characters
from start up to but not including end are
deleted, and the characters specified on the text block are
inserted in their place. If start and end are
equal, no text is deleted and the new text is inserted after
start.

Specifies the direction to search in. Legal
values are XawsdLeft and
XawsdRight.

text

Specifies a text block structure that contains
the text to search for.

See section 5.4 for a
description of XawTextPosition and
XawTextBlock. The XawTextSearch function will
begin at the insertion point and search in the direction
specified for a string that matches the one passed in
text. If the string is found the location of the
first character in the string is returned. If the string
could not be found then the value XawTextSearchError
is returned.

See section 5.4 for a
description of XawTextPosition. The
XawTextInvalidate function causes the specified range
of characters to be redisplayed immediately if redisplay is
enabled or the next time that redisplay is
enabled.

The XawTextDisplay
function forces any accumulated updates to be
displayed.

5.4.7. Resources
Convenience Routines

To obtain the character
position of the left-most character on the first line
displayed in the widget (the value of the
displayPosition resource), use
XawTextTopPosition.
XawTextPosition XawTextTopPosition(w)
Widget w;

w

Specifies the Text widget.

To assign a new selection
array to a text widget use XawTextSetSelectionArray:
void XawTextSetSelectionArray(w, sarray)
Widget w;
XawTextSelectType * sarray;

w

Specifies the Text widget.

sarray

Specifies a selection array as defined in the
section called Text Selections for Application
Programmers.

Calling this function is
equivalent to setting the value of the selectionTypes
resource.

To move the insertion
point to the specified source position, use
XawTextSetInsertionPoint:
void XawTextSetInsertionPoint(w, position)
Widget w;
XawTextPosition position;

w

Specifies the Text widget.

position

Specifies the new position for the insertion
point.

See section 5.4 for a
description of XawTextPosition. The text will be
scrolled vertically if necessary to make the line containing
the insertion point visible. Calling this function is
equivalent to setting the insertPosition
resource.

To obtain the current
position of the insertion point, use
XawTextGetInsertionPoint:
XawTextPosition XawTextGetInsertionPoint(w)
Widget w;

w

Specifies the Text widget.

See section 5.4 for a
description of XawTextPosition. The result is
equivalent to retrieving the value of the
insertPosition resource.

If visible is
False the insertion point will be disabled. The
marker is re-enabled either by setting visible to
True, by calling XtSetValues, or by executing
the display-caret action routine.

5.5. Ascii Text
Widget

Application Header
file<X11/Xaw/AsciiText.h>

ClassHeader file

<X11/Xaw/AsciiTextP.h>

Class

asciiTextWidgetClass

Class Name

Text

Superclass

Text

Sink Name

textSink

Source Name

textSource

For the ease of
internationalization, the AsciiText widget class name has
not been changed, although it is actually able to support
non-ASCII locales. The AsciiText widget is really a
collection of smaller parts. It includes the Text widget
itself, a ‘‘Source’’ (which supports
memory management), and a ‘‘Sink’’
(which handles the display). There are currently two
supported sources, the AsciiSrc and MultiSrc, and two
supported sinks, the AsciiSink and MultiSink. Some of the
resources listed below are not actually resources of the
AsciiText, but belong to the associated source or sink. This
is is noted in the explanation of each resource where it
applies. When specifying these resources in a resource file
it is necessary to use *AsciiText*resource_name
instead of *AsciiText.resource_name, since they
actually belong to the children of the AsciiText widget, and
not the AsciiText widget itself. However, these resources
may be set directly on the AsciiText widget at widget
creation time, or via XtSetValues.

A list of event to action bindings to be executed
by this widget, even though the event occurred in another
widget. (See the X Toolkit Intrinsics — C Language
Interface for details).

ancestorSensitive
The sensitivity state of the ancestors of this widget. A
widget is insensitive if either it or any of its ancestors
is insensitive. This resource should not be changed with
XtSetValues, although it may be queried.

autoFill

If this resource is True the text widget
will automatically break a line when the user attempts to
type into the right margin. The attribute has no effect on
files or text inserted into the text widget. It only checks
to see if the action should be taken when a user enters a
new character via the insert-character
action.

background

A pixel value which indexes the widget’s
colormap to derive the background color of the
widget’s window.

backgroundPixmapThe
background pixmap of this widget’s window. If this
resource is set to anything other than
XtUnspecifiedPixmap, the pixmap specified will be
used instead of the background color.

borderColor

A pixel value which indexes the widget’s
colormap to derive the border color of the widget’s
window.

borderPixmap

The border pixmap of this widget’s window.
If this resource is set to anything other than
XtUnspecifiedPixmap, the pixmap specified will be
used instead of the border color.

borderWidth

The width of this widget’s window
border.

bottomMargin

leftMargin

rightMargin

topMargin

The amount of space, in pixels, between the edge
of the window and the corresponding edge of the text within
the window. If there is a scrollbar active on this edge,
then this is the space between the text and the
scrollbar.

callback

The callbacks registered on this resource will be
called every time the text buffer changes, after the text
has been updated. This is a resource of the associated
source.

colormap

The colormap that this widget will
use.

cursor

The image that will be displayed as the pointer
cursor whenever it is in this widget. The use of this
resource is deprecated in favor of
cursorName.

cursorName

The name of the symbol to use to represent the
pointer cursor. This resource will override the
cursor resource if both are specified. (See
2.4.1)

dataCompressionThe
AsciiSrc uses an algorithm that may cause the text buffer to
grow to about twice the size of the actual text over time,
as the text is edited. On systems where CPU cycles are
cheaper than memory, it is helpful to spend some extra time
to compress this buffer back to its minimum size. If this
resource is True, the AsciiSrc will compress its data
to the minimum size required every time the text string is
saved, or the value of the string is queried. This is a
resource of the associated source.

depth

The depth of this widget’s
window.

destroyCallbackAll
functions on this list are called when this widget is
destroyed.

displayCaret

Whether or not to display the text insert
point.

displayNonprinting
If this resource is True, the Text widget will
display all non-printable characters as the string
^@. If False, the Text widget will just leave
a blank space where a non-printable character exists in the
text buffer. This is a resource of the associated
sink.

displayPositionThe
position in the text buffer of the character that is
currently displayed in the upper left hand corner of the
text display.