volume six motif programming manual - gbv · 2019. 2. 22. · motif programming manual by...
TRANSCRIPT
Volume Six
Motif Programming Manual
by Dant-eller
Reference Appendices by Daniel Gilly
O'Reilly &Associates, Inc.
Volume Six
. . ' . '
Motif Programming Manual
by Danl'Heller
Reference Appendices by Daniel Gilly
0 'Reilly & Associates, /nc.
Table of Contents
Page
Preface ' .. • „ •• ,••••••••••••••••••••••••t••••••••,·•·•·••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••._ •••••••••• , ••••••• XXVll
The Plot .„.„„„.„ .•.... „ ...... „ .. „ ....... „ ............. „ ..............• „ .....•. „„„ ... „„.„ ..... „ .. „ •..... „„ .. -.„.„„„ xxvii Stories Not 1'old „.„: .. „:„.„„.„„„ ... „.„ ......... „ ..... „.„ ... „.:„„ •. „.„„.„ .••••.• „ •. „.„.„.„„„.-„„.„ ..... xxviii Alternatives to the Motif Toolkit .„.„„„„„„„„.„ „„„.„„ .... „ .. „ .... „ ... „.„ .. „ •.. :; .•. „ •.• „ •... „ ••.. „„ .. xxix
User-interface Languages ...................................... „ .... „„ .... „ .. „.„ .. _.„ ..•.. „ •.•. „ •• „ •. m •• „ .•..... xxx UIMS Packages ........ „.„„ ...... „ ......... „ ................. „„ ..• „ .... „ .. „„„„„„ •• „ •. _.„ .• „ .. „.„ .. „.„.„„ ... xxxi
Assumptions „„„ ....... „„ ..... „ ........... „ ... „ ........................... „„ •••. „.„ ...... „„„„„„ ••. „„„„„ .• 1„„.„ ..... xxxi How This Book Is Organized „„ ... „.„„ .... „ ...• „„ .... „ .. 1.w::.:„„ .... „ ..• ; •.• „„.„„ .••. „„.„.„ •. „.„ ..• „ .. xxxii Conventions Used in This Book .. „„.„ ... „.„„.„ .• „ .. „„:.„„ •.. „„.„„.„.„„„„.„.„.„„„„„„„.„„„„„ xxxv Request for Comments ..... „ ........ „.„ ......... „ .... „.„ .............. „ ..•... „„„ .•.. „._ .••..•....... - •. „„ ..• „.„ .. xxxv Obtaining Motif ...... „ ....... „ .......... „ ...... „ ... „ .......... „ ..... „.„„ .. „.„ .. „ .•. „ ........ „ ...•.••• „ ...... „ .•. „ ..• xxxvi Obtaining the Example Programs ..... „ ................. „ .... „ .... „„„ •.•....... „„„ •.. „.,„„.„ ..... „ ........... xxxvi
FTP ................ „ .. „ ...... „ ............ „ .... „ .•........ „ ........ „ ................ „ ......... „ .• „„ ••.•• „.„,„, .. ~„ •. ,„. xxxvi FfPMAil'... ~„„.„„.„ ......... „,.„ ...... „„ •............ „ .. „.„ •..•..... „ ........ „„ ... „ .. „ .. „„„„ .•.. „ .• „ .... „-.. „ xxxvii BITFfP ...••. „ ... „ ........... „ ........ „ ..... „ .......... „„ ...•.............. „ ... „.„.„„„„ .... „„ ... „ .. „ .... „„.„„„. xxxviii UUCP ••• „ ..•..... „ .... „ ......... „ ••... , .....•. „ ............. „ ........... „ .. „ .....• „ ... „.„.„.„ ....•.. „.„.„„ .•. „„„„ xxxviii Copyright ...... :.„„ ... „~ ..• „:.„~„„„ ....... „ ....... „ ......... „„„.„ ••.. ._„.„., ... „„.„.„ •.. „ .•. „.„ ••• „.„_,„ xxxix
Notes on Z-Mail „ .. „„.„„.„.„„ .... „.~.„: ......... „.„„ .•. :.„„.„„.„„ .. „„.„.„„ ..... „„„.„ ••.•. „.„„„„.„ •.• xxxix Use of Sexist Language .................................. „.„ ...... „ .. „ ....... „ •• „ •• „„ •• „„„.„.„„.„ •••• _,,,_,,,„„.„. xi Acknowledgements ............... : ... „.„ ......•.... „ .... „ .. „ ......... „ .. „.„.„.„„„„„„.„„„ ..••• „„.„„„„.„„ ••.• „ xli
Chapter 1 You, Motif, and Everything „„„„„.„„„„„„„.„„ .„„„„.„ „ „.„„„.„ „.„ „„„„ 3
1.1 A True Story „ .. „„„„„„: ..... „„ ... „ ..... „ .. „„„„„.„„ ... „ .... „„ .. „„.„„ .... „ ••• „„.„ .••.•. ~-·~„ ..... „.„„ 3 1.2 Basic User-interface Concepts ' '..„ ....... „ .. „ ........ „„.„ ... „.„ ... „.„ .. „ ..... „.„„.„„ •. „„„ .• „„ .•... „,„ 6 1.3 What Is Motif? „„„ ........ „ .... „.„ ............ „ ... „.„„„„„„.„ .. „ ... „„„„ .. „„„„.„„.„„„„„„ •• „„„ •. ,.„„. 7 1.4 Designing User Interfaces „ ... „ .. „„.,„„.„„„„„„„„.„.„.„.„„„.„„„„.„ .. „.„ „„„„„„„ .. „„„„„„. 10
Chapter 2 The Motif Programming Model .„ „„.„„.„„ .„ .. „.„„„„.„.„.„ .. „„„„ .. „ •. 15
2.1 Basic X Toolkit Terminology and Concepts „ .. „„.„.„„.„.„.„„„.„„„.„„„ „„ .. „„„„ „ ... „„.„ .. 15 2.2 Motif and Xt Libraries .„„.„„„„„„.„„„„„„ .. „„ ... „„„„„ .. „„ .. „.„.„, •. „.„ •. „ ..•• „„„„„.„„„„„„. 18 2.3 Programming Using Xt and Motif .„„.„„ „„ ... „ „ ... „ .. „ .. „„„„.„„„„ .. „„„„„.„„.,„.„„„„„.„.„ 19
2.3.1 Header Files .„ ...... „ •...•.... „ ....... „ ................ „ .... „ ... „ ... „„.„„.„.-„„„„„.„ .... „ •.. „ .... „.„.„. 20 2.3.2 Initializing the 1'oolk1t · „„„„.„„ .. „„„„„„.„.„.„„.„ .. „„.„„„„„„„„._.„ •. „„„„ .• „.„.„.„„„„ 22 2.3.3 Creating Widgets .. „„„ ... „ ............ „ .......... „ .. „ ... „ ......... „„.„ .• „.„.„ ••• „.„„„„„„.„„„.„„„. 25
V
2.3.4 Setting and Getting Widget Resources „„. „ ..... „.„ ... „ .. „.„„.„ ......... „„ •..... „.„„„ ... „.„. 27 2.3.5 Using Argument Lists .„„.„„„.„ .. „.„„ .. „„.„ ••. „ .. „.„.„.„ •. „ .. „„ ..•. „„ •....... „„ .•.....•...•• , .• „ 31 2.3.6 Event Handling for Widgets .„„„„ .• „.„„~„ .. „.„.„„„„.„.„.„„„.„„ ..•• „„„„„„„„ .... „„„.„. 33 2.3.7 Event Specifications „.„.„.„.„ ... „~····~·„„„ •. „„ .. „ .. „ ...... „„.„„ .••. „.~-.-.~„„ .•.. „„„.„.„ •• 35
2.4 Summary .................................................................. „ •••••••• „ ••••••••••••••••••••••• - •• „ ..... „ •••......•..•... 40
Chapter 3 Overview of Motif Widgets „„„ .. „.„ .. „„„„„.„„ .... „.„„„„„„„„„„„.„.„„. 43
3.1 The Motif Style .„ .. „„„„„„.„„„.„„ .. „.„ ... „„.„„ ..... „.„„ .. „.„„„.„„„ •• „„„.„„„„„ .. „„.„.„„„„„ 43 3.2 Giving Choices to ftie User „„„„ .. „.„.„„ .. „„„„„.„„„.~„.„.„.„„.„ .. „ .. „„„„„„„ •.•. „„.„.„ .... „. 45
3.2.1 The Primitive Widget Oass .. „.„„.„„.„.„ .. „.„ .. „.„„„ .. „.„ ..... „ .. „ ....... „ •.... „.„ ... „ ... „„ ... 46 3.2.2 Other Application Controls ...... „ ...... „ .. „ .. „.„.„.„.„ .... „.„ •... „.„.„„.„.„„„„ ... „„.„.„„.„. 53
3.3 Manager Widgets ..... „.„„ ........... „„.„.„.„ ...... „ ... „„„„„ .. „„.„„„.„„ .. „„.„„„.„.„.„„.„„.„„.„ •• 54 3.3.1 Manager Widget Classes .„.„„„„.„.„„.„.„.„.„„.„„„„„ ..• „.„„ ... „ .. „ .. „.„„ .. „„.„„„.„ .. „„ 58 3.3.2 Geometry Management „.„„ .... „.„.„.„„.„.„.„.„ ... „„„.„.„ ...• „„„ .... „.„ .. „„.„ .•. „„„„.;„„. 59 3.3.3 How Gadgets Are Managed .. „„ .. „.„„„„.„„.„.„„„„ .•.. „.„„.„.„.„„.„„.„.„„„„„„„„.„„ .. 61 3.3.4 Keyboard Thaversal and Tab Groups ....... „„.„ .. „.„ ... „ •... „ .. „„.„„„„„ .. „ .... „„ .. „.„:„.„„ 62
3.4 How an Application Hangs Together .„„„„ ....... „ ..... „ ... „.:„ .... „ ..... „ .... „.„ .. „ .. „„.„ ... „ .. „„„ 63 3.4.1 The Main Window „ .............•.....................•.•................•.. „.„ ...•.... „„„ .. „ .. „.„„.„ ..... „.„. 63 3.4.2 Menus ...... „ ......... „„ ........ „.„ ....... „ ......................... „ .. „ .......... „.„ ....... „.„ ................ „„„„ 67 3.4.3 The Role of the Window Manager .......... „ ........... „ .. „ ....... „ ... ~: .. „.„ .... „.„ ..• „ .. „ ••. „„„„ 68 3.4.4 Dialogs .„ ... „ ..... „.„.„.„.„„ ....... „.„ •.•. „ ...... „„ .. „.„.„.„.„.„.„„.„.„.„.„.„ .... „,.,.„.„.„„„.„„ 73
3.5 Summary ......... „ ................ „ ..... „ ... „.„.„„.„ .. :.„ .... „ .... „„.„.„ .. „„ ....... „.„.„.„ .. „„ ..•. „.„, •.... „„ 79
Chapter 4 The Main Window „„„„ .. „.„„„.„„„.„ .. „ .. „„„„.„ .• „„„„.„„„„„.„„„„„„„ ...• 83
4.1 Creating a MainWindow .„.„.„„„„.„„.„ ... „ .... „„ .. „.„.„ .... „.„.„„„„„.„.„.„.„.„„„„„„.„„ .... „ 84 4.2 MenuBars .......................... „ ... : ... „ ....... „ .... „ ......... „„.„.„ ............. „.„.„ ...... „ .. „ .. „„ .. „.„ •. „„ho 90
4.2.1 Creating dte PulIDown Menus „.„.„„„„ .. „ .. „.„„ ... „„„„„ .. „.„„„„.„ .. „„„„.„ •.... „„„„„. 92 4.2.2 SimpleMenu Callback Routines .„ •.. „ .... „.„.„„„„.„.„.„ .. „ ... „„„„„.„.„ .• „.„„, .•. „.„.„.„. 95 4.2.3 A Sample Application „ .. „ ..•. „.„.„ ......... „ .... „.„ ... „ .......... „„„„ .. „ .. „„ .... „„„ •• „.„.„„.„.„ 97
4.3 The Command and Message Areas .„„ ......... „„„„„„„.„.„ .. „„„„.„„„.„„„ •. „„.„„„„„„„„ .. 105 4.4 Using Resources .. „„.„„„ .. „.„.„„ .. „.„ ... „.„.„ .... „.„„.„.„„„„„„„„.„.„„.„, .•.•• „.„.„„.,„„„.„. 110 4.5 Summary ...... „.„.„„ ...... „„ ....... „„„„„ ... „ ..... „ ... „„„„.„„ ..... „ .. „.:„:„„ • ..__„.,.„.„.„„„.„„„„.„ 111 4.6 Exercises ........ „ .... ;„ ........ „„ .. „ ...... „.„.„„ ....... „ .... „.„.„ ......... „:.„.„v„: .. „„.„„.„„, .. „„ .. „„.„ 112
Chapter 5 Introduction to Dialogs .„.„„„ ..... „.„.„ .. „„„ ••.. „„„ .. „„ ..• „„ .. „„„.„„ ...... „ 115
5.1 The Dialog' s Main Purpose „„„„„.„ .... „.„„„ .. „„.„.„ .. „„.„„„„„ .. „.„„ •. „„„„.„ .. „ .. „ ... m .... „ . 116 5.2 Dialog Widget Anatomy „.„.„ .. „„„„„„„ ... „.„„„„„„ ....... „„„„„„„„„„„„„„.„ ..•• „ .. „„„.„„. 118
5.2.1 Action Area Buttons ......... „„.„.„.„ ... „ .. „ ... „ ......... „.„;„., .. „.„.„ ....... „.„.„„ .• „.„„„.,„„. 120 5.3 Creating Motif Dialogs ... „.„„ .. „.„„ ... „ .. „„.„.„.„„.„„„.„.„.„.„ .... „„.„„"'„,.„ .•• „„.„„„ .. „„ 121
5.3.1 Dialog Header Files „„ ...•.. „ ... „ .... „ ... „ .... „.„„ .. „.„„.„„ .• „ ••.. „.„.„.„.„„„ •• „ ... „„„.„„ .. „ 122 5.3.2 Creating the Dialog „.„ ............ „ ......... „.„ .... „ ...... „.„.„„ .. „„'.„ .. „, .. „.„ ...... „ .. „.„„ .. „„ .. 122 5.3.3 Setting Resources ..........•... „ •••• „ ........ „„ ..... „ ... „ .. „„„.„.„.„.„.„„ .. „„.„.„„.„.„ .. „„„„.„ 123
vi
5.3.4 Motif Dialog Management .................................... „ ......................... „ ........ „ .............. 125 5.3.5 Closing the Dialog „ .... „.„„ ..... „ ............................. „ ... „„„ ..... „ .•. „.„ ........... „ ..... „ ..... „. 129
5.4 Miscellaneous Resources for Dialogs .„.„.„ .... „ .. „„.„ .... „„ .. „„„„„„.„„„.„„„„„„ .. „.„„„„. 131 5.4.1 The Default Button „„„ ........ „ ...... „.„.„ ... „.„ .. „ .. „ ................... „ ....... „ ........ „ .. „ ..... „.„ .• 131 5.4.2 Button Sizes „ ..... „ ...................................•............... „ .. „ ..... „.„ ..•. „.„„ .. „„„ ..•• „.„.„ ...... 133 5.4.3 The Dialog Title .. „ .......•.. „ ... „ .............. „ ............ „ .... „.„.„„ .... „„„.„ .• „„„.„.„ ....... „.„„ 133 5.4.4 Dialog Resizing ............................. „ .. „ ........... „ .......... „ •.... „ .............. „ .... „.„„ ............. 134 5.4.5 Button Fonts „„„„„„ .. „ ... „ .. „ .... „ ...•. „.„„.„„.„„„.„„„.„ .. „ ... „„.„.„ .... „.„.„„ .... „.„.„„.„ 134
5.5 Piercing the Dialog Abstraction ... „.„ ........ „.„ ..... „„„ .. „.„„.„„ .. „ ...• „„ ....... „„ .. „.„„ ...... „„ 135 5.5.1 How Convenience Routines Work „ ......• „ ........... „„ ... „„ .. „„„.„ .. „„.„ ... „ ..... „„ .• „„.„. 135 5.5.2 DialogSheU Widgets ..... ~ ................................. „ ................ „„„ ..........•. „ .................. „ .. 137 5.5.3 Getting Widgets Interna! to Dialogs .............. „„ .. „ .. „„„„ ... „ ...•. „„.„„„.„.„„„„.„„„„ 139
5.6 Generalizing Dialog Creation ............................ „ ..................... „.„ ................. „ .• „ ••........... 140 5.6.l Dialog Callback Routines „„.„.„„„ ..... „ .••. „.„„„._„.„ .. „„.„„„„„„„.„„„„„„„ .. „„.„„„ 141 5.6.2 Callback Reasons ... „.„.„ ..... „ ....... „„.„„ ....................................................... „ ............. 143
5.7 Dialog Modality ... „ ............ „ .... „.„ ..... „ ....... „„.„ .. „.„.„ ..... „„.„ •...•. „„ ..•.. „„ .. „.„ ............ „ ... 145 5.7.1 Implementing Modal Dialogs .„ ................................. „ ............ „ ........ „„„ .... „ ............. 148 5.7.2 Immediate Response „.„ .... „ ........... „„ .... „ .. „ .. „ .. „„ .. „„.„.„.„„„ .. „.„„„„„ .... „„.„„„„ .. 151
5.8 Summary ............ „ ...................•............................... „ .. „ •......•...•........... „.„ ................. „ ... „„ 157
Chapter 6 Selection Dialogs .. „ .... „.„.„ .............. „ ........•........ „ ....... „.„ ......... „„„„„„„. 161
6.1 SelectionDialog Types ..... „ ... „ .................... „ .. „.„ ...... „„„.„ ..... „„„ .. „„„„ ... „„ ..... „.„ ... „ .... 161 6.2 PromptDialogs ..... „„ ..........•........................ „ .•.......•..•..... „ ................• „ •...... „ •............. „ ...... 162
6.2.1 SelectionDialog Callback Structure ............................................ „„ ......... „ ................ 165 6.2.2 The Prompt's Text ....... „ ..... „„„ .. „ ................... „ ............ „„ ...... „ ..• „„ ........................... 165
6.3 SelectionDialogs ...................... „ .......................•................ „ .. „ ............... „„ ..•............ „ ....... 166 6.4 CommandDialogs .. „ ...............................................•............... „.„„ ........•.. „ ........................ 171
6.4.1 Command Callback Routines ..... „ ............ „ .................... „ ... „ .... „ ............. „ ... „ .. „.„ ..... 171 6.4.2 Other Command Routines „ ......................... „ .. „ ... „„ .......... „ ..•. „ ......... „ ..................... 172
6.5 FileSelectionDialogs .... „ ... „ ........................ „ ...... „ ........ „ ............. „ ...• „ ....... „.„ ..... „.„ ........ 173 6.5.1 Creating FileSelectionDialogs „ ........ „ ........... „„„„.„„„„ .. „„„ ..... „„.„„ ... „ ... „ ... „.„ .... 174 6.5.2 FileSelectionDialog Callback Routines ..... „ ...•••...•••.•••••••••..••••••••....••••••...•.• „ ..•........ 176 6.5.3 File Searching .„ .. „ .•......... „ •... „„ ..... „ ....... „ ....................... „ .... „ ...•...........•................. „ 178 6.5.4 Directory Searching .................................... „.„ ...... „ .. „ .........•.•................................... 182 6.5.5 Miscellaneous Notes on Filesystem Searches .................... „ .. „ .....•............... „ .......... 183
6.6 Summary .•..... „ .. „ ... „ .......... „ .......... „.„ ..................••........................... „ .......... „„„ .. „ ..... „ .... 184
Chapter 7 Custom Dialogs „ .............. „.„ •....................... „.„„„ ..... „ ............... „ ............ 187
7.1 Modifying Motif Dialogs ......... „.„ ... „ ......... „.„ .............. „„„.„„„ ... „ .... „ ........................ „„ 187 7.2 Building New Dialogs „ .... „.„ ................ „.„„ ............... „„ ....... „ ..... „ .... „„.„ ...... „ ..•.. „„ .. „„. 192
7.2.1 Choosing and Creating a Shell ......... „ .. „„ ........ „„ .... „.„.„ ....... „ .. „„ ..... „ ........ „.„.„„„ 193 7.2.2 The Dialog's Manager Child .......... „ ..................... „ .. „ ............ „ ........•...•.. „.„.„ .... „ .... 194 7.2.3 Control Area ... „ .. „„ ............. „ ....... „ ....... „„ ......... „.„ .... „„„ .. „ ...... „ ........... „ .. „.„.„ ..... „ 195 7.2.4 Action Area .. „ ...................•.... : ....................................................... „ ...• „.„ •..•. „ •. „ ...... „ 195
vii
7.3 Building a Dialog „ ..•..•• „.„.„.„ .. „ .. „„.„ ••..• „ ... „ „ „ .„„.„ .. _„.„ .•. „„„ •• „„ •.••..••• „ •. „„„.„ .• „„ .• 198 7.3.1 Dialog Titles „.„.„„.„.„.„.„„ .. „ .. „.„„.„„ .. „„„.„„ •.• „.„.„„.„.„„ ..... „.„„ •• „„„ •. „„„ .• „„„ 205 7.3.2 DialogShell Children .„.„ .. „„ .... „ ... „ .......•.. „ .•. „ .... „.„„„ ..••.•• „.„.„ ....... „ .......... „ .......••• 206 7.3.3 The Action Area „„ •. „„.„.„„.„„„„ •. „„.„„ .. „„ .. „„„„ .. „ • .-....„ „ .1. .• u.-..... „ .... _.„„„ ... „„. 209
7.4 Generalizing the Action Area „„.„„ .. „„„„„.„„„ .. „.„.„.„„„„„„„„„„„.„„--„„-„„ ..• „„„„ 211 7.5 Using TopLevelShells as Dialogs „„ .. „„„„„ .. „.„„ .. „„.„„ ...... „„ .•.• „„.„ .•.....• „„ .... „ .• „ •• „„. 218
7.5.1 Using Motif Dialogs Within TopLevelShells .„.„.„.„ .. „„ .... „„.„ .... „„ .......... „ .„ .....• „ 219 7.6 Positioning Dialogs .• „„ ........ „ .. „ .•. „ ..• „ .„ •••. „ .„ .•.. „„ .. „ •.. „ .„ ....... „ •.• „ .• „ .. „.„ ...... „„:„ ••• _ 220
7.6.1 Popup Notification .„„.„„„.„„.„.„ .•. „ .. „.„„ .. „„„ .. „ .. „„„.„ ....••.. „„.„ . .••.. „ .... „ .••. „.t..4. 222 7.6.2 Popped Down or lconified? .„„„.„„„ .. „„ •..• „„„.~„„ ... „.„.„ .... „ •••• „.„.„ •. „ •..•....... „ •..•. ~ 223
7.7 Summary , ..•••......•. , .•.•...•....•••...................•.•.•........... „.: ........ „„i.".,. ......... ~ • ..,\.t„.-............. „ ••.• 223
Chapter 8 Manager Widgets „ •. „ „.„ ..•. „ .. „.„„„.„ .. „,„„.„„.„„„„„.„„„„„„„„„„.„„ .. „ 227
8.1 Manager Widget Types „ .... „„.„ ..•.... , .. „.„.„ •.•.•. „.„ ..•• „.„ ....•.• „„„ ..• „ .. „ ...... -„„„ ... „„." .... 227 8.2 Creating Manager Widgets .„.„.„„ .• „ ............... „ ..•. „ •. „„.„„ ..•• „.„.„ ....... „ .... „ ....... „ .••.• „ .... 229 8.3 The BulletinBoard Widget ....... „ .. „.„ •.....•.......... „ .•.•••.•.... „ •... „„ •• ,_ .. ,„ .• „„ ........ „ ...• „„ .. „ .• 231
8.3.1 BulletinBoard Geometry Management .. „ „„ ... „ ..... „„„ .. „.„ •...... „.„ .. „ .. „„ .. „„„ •....•.•• 232 8.4 The Form Widget „ .• „ .•....•..... „ .....•.. „ .... „ . .-„ ....•..••..••..••.... „„ ...• „ ••.. „ .••• - .••• „„ .. „.-··--r· 237
8.4.1 Form Attachments .. „„ ....... „ ... „„ •..•....... „.„.„„ .. „ ... „.„ ..•.•.•• „ ......... „ ..... „.„.-.... „„.„. 237 8.4.2 Attachment Offsets •• „„.„ .... „ •... „ ••.• „„ .... „ .. „.„„„.„„ •. „ .„.„m.„„ .•• „„ ... „ .„„ •• „~ .•. - ... „ 244 8.4.3 Extended Example .. „ ... „.„.„ .... „ ..• „.„ •.......•... „ ....... „ .... „„ •.•. „ .•.•.• - .•..• „.„„ .• „ •.. „ •••• „„ 247 8.4.4 Common Problems .„.„ .•.... „., .•......... „„ •. „.„„ ...•..•........••. „ .... „ .. „ ..... „ •••• „;„._: .• „, ... „„ .• 250 8.4.5 Form Positions ....... ,., .... „ ••••••• ,, •• ,.,.. •••••••••••• „ •• , •••••• , •• ••••••••••••••••••••• „ •••••• ~·· ····•.tt•.r..""-.„., ...... „ 251 8.4.6 Other Form Resources .„ •••. „„ .. „ .... „ ..• „ ..•..•. ~ ••... „„ ... „ ............ „.„: ...... ,.,. ... „.„ ••..... „ ...• 255
8.5 The RowColumn Widget „„„ •• „„.„ .. „„ .... „.„ .• „.„.„.„„.„.„„.„ •• „ .... „ .•. „.i .. „.„„„.„.„.„„ .. „ 255 8.5.1 Making Rows and Columns ..• „„„„„„„„„.„.„.„ •... „„„„.„ .. „„.„„ .. „.„„ ... „.„.„„.„.„ .• „ 259 8.5.2 Homogeneous RowColumn Children ...... „ .... „ ... „ „ ... „ •.... „ .... „ .. „ •.......•. „ ..•. „ ........... „. 263 8.5.3 RowColumn Callbacks ... „„.„„„„.„„„ .... „ .„ .. „„.„ „.„ ... „„.„.„ ..•. „ .„ ••..... - •• „.„~.4 .... 264
8.6 The Frame Widget .„.„.„„.„ .„ •• „„„„„ .. „„.„„ .. „„„„„ •..... „„.„.„„ .• „.„.„„ . .1. .... „.1... . •.. 267 8.7 The PanedWindow Widget .... „„ .. „ . ..•... „„ ....... „ .... „ ... „ .. „„.„ .. „.„„ ........ „ • ... „ ..... „.„.„ .. „„. 270
8.7.1 PanedWindows' Sashes .„„„ .. „„.„.„.„.„„.„ ... „.„„ .• „.„„ •• „„„„.„u.„.u • ..,. „„ •• „„.„„„ .• 275 8.8 Tab Groups .. „.„.„ ..• „ •. „„.„.„ •.. ._.„.„ ••. • ,.„„„.„„ ......•. „ .... „„ .. „ .... „~, ~-........ „ .. „ ••••••••••• 276
8.8.1 Tab Group Modification „.„ .... „ ... „ „ .. „„.„ .... „„„„„„„ •• „ ..... „ iu-• .i..„.~„.„„„ ....• „ •••. „ .. 279 8.8.2 Navigation Types •.•.. „ .• „„„.„ •...... „.„„ .... „ ....... „„ .. „„ .. „„„„„.,, „.„ ..• „„ ... „„„ .. „.„ ...•.. 281 8.8.3 Event Translations ... „„„.„ ....... „ ........ „ ••. „.„ •.•• „.„ •..• „.„„ ••... „„„„„.„ ..• „„ •.••.... „ •. „ „ .. „ . 282 8.8.4 Processing Traversal Manually .. „ •. „ .• „„„.„ •.. „ •• „.„ .• „ •. _ .. „.„„„„.„.„„.„„ .. „ .. „ .„ .•.. „ 284
8.9 Summary „.„ .... „.„ ...•.... 7
.. „ ........ „„.„ ............ „.„.„.„ ••... „ .: •. „„ .•. „„„„.„„.„ ......... „.„ •. „„.„. 287
Chapter 9 ScrolledWindows and Scrollbars .. „.„„„„.„„.„ ... „„.„.„ .•• „„ ..• „„.„ ... 291
9.1 ScrolledWindow Design Model „ ... „.„.„„.„ .. „„„„„.„„„ .... „.„„.„ ••. „„ .•. „;„,,..,,,_„,, .. _.„. 291 9.1.1 Automatie ScrolledWindows Model .. „ .... „ ..• „„ .. „ .. „ .„„.„ .•. „ .............. „„.„ ... „ .. „ ••. „ :. 292 9.1.2 Application-defined ScrolledWindow Model .„.„„„„ .. „.„.-.„.m„.„„„ .. „„„ .. „ ...•..... 293
9.2 Simple ScrolledWindows .„„ •..•.. „.,.„.„ ••.• „ ... „ .. „ •.. „ ... „ .•••• _„ ... _„.e..,~•·""•·········„···„·······„·· 295 9.2.1 Automatie Scrolling ... „.„„ ......... .,. ••.. „.„ .. .,..„ •••• -„ .. -„„„„.„ ....• „„„ ......... „ . ... „„ ....• „ 295
viii
9.2.2 Application-defined Scrolling „ ...........................•................•.•..•.............. „ ...........•...• 296 9.2.3 Other ScrolledWindow Resources .................. „ .. „ ..•.......................•. „ .•.....•.. „ ..•.•••.... 297 9.2.4 Automatie ScrolledWindow Example ....................................................................... 297
9.3 Working Directly with Scrollbars .„„ ... „ .............. „.„„ .. „ .......... „.„ ... „„ ... „„„„ •• „„.„„„ .... 302 9.3.1 Scrollbar Orientation ... „ ............................................................... „ .....................•....... 308 9.3.2 Scrollbar Callback Routines ....... „ .............................•.. „ ............... „ ........................... 308
9.4 True Application-defined ScrolledWindows ..................... „ ............................................. 312 9.4.1 Scrolling Text and List Widgets .„ •.•.•.•••.•••••••..••..••..••..•••••••••.••••• „.„.„„.„„ •. „ ••••.• „„ ..•• 326
9.5 Summary - .• „.„„ .••••....•••••••....... „ ........................................... „„.„ ••......•..•.• „ .••.• „ ..••.....••..•••• 327 9.6 Exercises .„ •• „„.„ •. „ •..•••• „ ..•• „ •......•...•..... „ ......•.....••... „ .•..••••. „ ... ~·················„ .•••.•...•. „„ .• „ ••• 327
Chapter 10 The DrawingArea Widget .. „ .. „„ ....... „.„ .. „„ .........•.. „„„„„„.„ •.... „ .... 331
10.1 Creating a DrawingArea Widget .„.„ •.•...........•.•.. „„„„ ..... „„ .. „ ..... „„„„.„.„ •. „„„„ ..•.....•• 332 10.1.1 Choices in DrawingArea Event Handling „ ....... „ .. „ •.•.• „ .. „„ ........•. „.„„ •... „„„„„„ .. 332 10.1.2 DrawingArea Callback Functions .. „.„„ .. „ .. „ ..............••••••.... „ .•.•.••..•..•...•... „.„.„ ..•.. 333 10.1.3 Redrawing a DrawingArea ... „ •.........•..............•..••........•.•....•.• „„„„„ •. „.„ .....••. „.„„ •. 338 10.1.4 DrawingArea Children ..................... „ ..............••••...•............•••••••.• „ .. „ •. „.„ .• „ .• „ •..••.. 341
10.2 Using Translations on the DrawingArea „ ••••.. „ .. „ ................•. „„„ .• „„ ..... „„.„ .• „„.„„.„„. 342 10.3 Using Colors „„ ........•.•......•. „ ...................•.•.••........•.....•.•.. „ •...•••• „„ •.•.•..... „.„„ •••••••....•...•. 349 10.4 Summary ... „ ...•.........................••..•............ „ .. „ ••.•.........•... „ •....• „ ••.•• „„.„.„.„„ •• „ .••. „.„.„ ... 354 10.5 Ex·ercises ............................................. „ ........................................ „„ .••.. „ .•..•.. „„ .•••• „„.„ •• 354
Chapter 11 Labels and Buttons ..... „ .• „„„ ... „ .........•.. „ ... „„„„„„ ..•.....•.. „.„ •• „.„„ ••• „. 359
11.1 Labels •...... „ ............................•... „ ...•••........•........•.••........••.•. „ •• „„.„„„ ..• „ .. „.„.„„„.„ .......• 360 11.1.1 Creating Labels ......... „ ... „ ............ „ .... „„„„„„.„ .• „ .. „ .. „„„„„„„„.„.„„.„„„.„.„„„„„„ 360 11.1.2 Text Labels .„ .•. „ ..•...•.....•...•.•.. „„ .•••..... „ •••••••••• „ .....• „ •..••..•....••.•.•.....•• „ ••• „„.„ •.•...••.•..• 361 11.1.3 Images as Labels ....... „ .... „„ ............ „ .. „.„„„„ .. „„„„ .•...•...... „ .• „„„.„ ••. „ .• „ •.. „„„„.„„ 362 11.1.4 Label Alignment ........... „ ... „ ..........................•.•.••.•••.••......•...••.•.•••...•.•.••..••..•..•.• „„.„. 365 11.1.5 Multilined and Multifont Labels .„„„.„„„„„„„ .. „„.„.„„„„„„„ •• „„ .• „ .. „.„.„„„.„ •. „. 366 11.1.6 Other Resources .......... „ ...........................................•....•....•.••.•..•..................••. „ ....... 370
11.2 PushButtons ... „ ........•.......••.••....•..•...•................ „„.„ ................•.•••••.•.............•..•• „ ••.••.•.. „. 371 11.2.1 PushButton Callbacks .. „„ .•.. „„„„„„„.„ •....•...•.. „„„.„„„„„ •• „„„„„„„„„„„.„„.„ •.. „„ 371 11.2.2 Multiple Button Clicks .„ •... „ •.• „ ••• „„ ......•.. „ .....•...••...•••.•. „„.„„„„„„„„„ .• ,„.„„„„.„. 374
11.3 ArrowButtons ......... „ .•...........••.......•...•..•..••••.............•...... „.„ •...••.•. „ •.••.•.•••• „ .....•..... „„ •.•. 377 11.4 DrawnButtons ... „„„ .. „„.„ .... „ ................•....................... „„ .. „ ....•..•. „ .• „„ .••..•..•.••••• „„„.„ .. 382 11.5 Pixmaps and Color lssues „ ..• „.„ ... „ ..•... „ ..... „„„„„„„ •...• „ •....•. „.„.„„.„„„„„„„.„„.„.„ .• „ 385
11.5.1 Installing Your Own Images ........ „ .•••••• „ ..•.•...•.•. „ .••. „ .•••••.••..•.•. „„ ...•.••....•••.•.•... „ .. „ 388 11.5.2 Color .. „ ••..•..• „ ...•.. „ ••••.•..••••.•••.....•...•••.•.•• „„.„ .••. „ •.... „ ••• „ .•. „„ •• „ .•...... „ .• „.„„„ ....•...••. 389
11.6 Summary ... „ ................ „ .. „ ............................ „ •..•.•......•...•.• „„ .•••.•• „ .•.•••..•..•...•.••••• „„„ ...... 393 11.7 Exercises „ ................................................................................................................ „ .•.. „. 393
IX
Chapter 12 Toggle Widgets .. „ ................... ~ ......•........ „ •....••.• „ .... „ ...... „„ •..•.... ~ .... „ „ .. 397
12.1 Creating ToggleButtons ..•...................... _„„ .•.•... „ ..... „ .... „„ •. „_.„,„ •••. „ .......... „ .. „.„ ••••... 398 12.2 ToggleButton Pixmaps ...•......•............... „ .•...... „ .„ .................. „ .. „ .„.,_ .•.... L.__ , „i„„ •. „ .... „ 400
12..3 ToggleButton Callbacks •m••···············································-·-·········,...····"···"-········"···· 402 12.4 Groups of ToggleButtons .......•.......................... „ ... „ ••. „ .........•...... „„.--... 1. ;. ...... „„"„ .... 404
12.4.1 RadioBoxes ··-·-·······················„·······•·······"···"-········"'······--···„ .. „.„ "···•+ :u. ..• „ .• 404 12.4.2 CheckBoxes „„ .... „.„ ................. „ .... „„ .......... „ ... 1 ..•.. .•.•. „ ...... „ „.„ ........ „ ........ „ .. n,-'„·· 408
12.5 Summary .............. „ .„„ .............. „ ... .. . ... .. .. „ ... „ ... ... ...... ... ... „ ........ „ •• •••••. „ • . . „ .. .. , ... .... .. „ . .... 412
Chapter 13 List Widgets ......... „ .„ .... „.„ . ....••.... „ .... „ •. „„ ..•. „ „ .•.•..• „ ........ „ .„ •.•. „ ..•..• „„ 415
13.1 Creating List Widgets .. „ .. „ „ ... „ ... „ .. „ ............ ... „„ ...... „.„ •..... „ ........ ... „.„.„ ......... „ ........ „ 417 13.2 Scrolling Lists .... „ •........ „ . . „ . ••. . • ....• „ .. „ „.„ . .. „.„„.„ .. „„ .„ „ .. „ .... „ .. . „. „ ... . „„„ .... ....... „ . .. . „. 419
13.2.1 Use of Color ..... - •..•. „ .... .... „.„„." „„„„ .. „ ........ „„„.„.„.„.„-.„.„ .. „ .. -~.„ .. .,. ....... „„ .... 422 13.2.2 Input Focus _ .... - ....... „ ....... „ ....• „ . ......... i „ •• i • •• • „ ....•.... „m·•···„····"'''·····„„ .. „ ...... „ .... 422
13.3 Adding Items .. . „ .„.„.„ .• ...... ...... ... „ .. „„„ .. „ .„ ... „ .. ... ,„ ..... „ .„ ... .. „ . ... ...... „ . „.„. „.„. „ .„ . . „„ ... 422 13.4 Finding Items _ ..: •. „ .. ~-········- ·· ····'"'· ···---··-···-··•·-'•··„„ ............ „ •..•• •.. „„ .. „ ....... „ .... 425 13.5 Replacing Items „ .. „ ..... .. „ ............. .. „ .... ... .. „ .. ... ... .. „ ... ... .. .. ...... „ . •.. ... . . „ .. ... .. „ ........ „ . . „ ... „ 427 13.6 Deleting Items .... ...... „ . .... . . „ ... „„„ „ .„ ...... „.„ . ... „ „ . .. „ ........ .. „ .„ ....• „ ..• „ .. „ .... .... „ ... .••.. . . „ ... 427 13.7 Selecting Items „ „.„.„ .„ .. „ ........ „ •. . „ „ .. „ .. „ ... „ .• . . „ .„.„ . .... „„ ...... „ .. „ . .. „ „ .„ ... „ . . „.„ .... „ .. . .. 428 13.8 Collective Example ........ „„. „ ..... . „ ... ... . „ .„ ...... „ • .. ... „.„„ ... „ ... .... „„„ . ... „ ... „ .„ •. „ . „ •.. „„„ .. 430 13.9 Positioning the List „ „ .. „ ........... „ ........ „ ..•.. „ ..•.. „.„ .. „ ...• „ .. „ .. „ •..•...•. „ ..• „ ••.••.• „ ....• „ .•.. „ .„ 435 13.10 List Widget Callback Routines „ .....• „ „ .•.• „ .... „ . „ ..•.• „ .......... . „„„„ .•.•.....•.•••.. ..•..• „ .•.•..•. 436
13.10.1 The Default Action ...... „.„ ••. • „ •••••. „ . . „ ...• „„„ „„ •• „ ... „ .•.• „„.„ ••••. .••.•• „ .....•. „„ ...... „„. 437 13.10.2 Browse and Single Selection Callbacks .. „ ...•. „ ..... „ ..• „ ••..••.•.••.. „ . „ .. „ •... .. „ .• „ .„ •.•• 438 13.10.3 Multiple Selection Callback .„ ..•.....•....•. „ .. „ . „ .•• „ •. - ... „.„. „ „ .••.. „ •.......•• „ .•.•• „ „ ••• 439 13.10.4 Extended Selection Callback .. „ .„.„.„ •........•••. „ .....• „ •.. „.„-.„ .••••..••..•..• „ .•.•. ,_ „ •. 441
13.11 Summary .„.„ •.•• „ .......• „ .... „ . . „„ ... „ .. „ •...•. „.„ .. „ .. „. „ ..• „ „„.„.„ „.„ .„ .. „„ .. „. „ „„ ... „.„„ .„ ... 442 13.12 Exercises .. „ . ... „ . ... . „ „ ...... .. „ •. ... „ .. „ .. .. „ ... „.„ .„ ........ „ .. „ .„. „ „„ ... „ „ .. „ ... „ . ... ... ... . „„ . .. „ . „. 442
Chapter 14 Scales „ .. „. „ .. „ ... „ ... . „ .... .•••..• „ .„ ....... „ „ .... ... „ .... ... „ . •••. . • „ . . „ „ . .. „„„ ......... „ . •.. 447
14.1 Creating Scale Widgets „ ... „ ......... „ . •.•••• . • „ .............. .. „ ....•. • - .....-.. „.„ ........ „ ................... 448 14.2 Scale Values •. '".„ •.• .•...• „ •••..•.•..•••.••.••... .••..••.•.••... .•....•.•. „ .„. 1.„1. . ..1 •• „.„ .. „ .• ~ ....• „ . „ ••.••..•• 450 14.3 The Scale's Label .............. „ •..... „ ............•..•.•.•...• „ .... .• „ .•..••. ---~·- ··-·„ ........................... „ 452 14.4 Scale Orientation and Movement .. „ •.. „ ....•••• „ .„.„ •. „ .•. -„.·-······„„ •...• „ . „ •.• „ .•••..••.•.. „.„ 452 14.5 Scale Callbacks „ .... „ ....• ... „ . . „ .. .... .. „.„.„ .. „ .. ... . „„ ....... . „ .. „ .„.„.„.„ .. „.„ .... „ .„ ... .... ...•.. „„ . . 453 14.6 Tick Marks .. „ .„ •••• •.•.•.•.•••.•. „ ....•.•• „„ ••..•.• "°„„ ••••• „ .. „ •. „ .•. „ ......... ........ „ •..••••• - ...... „„ •. „ . 456 14.7 Summary .. „.„ .. „ „ .. .. .. „ .. .. „ ... „ •. ..• . .. .. •. . • •.....•. . . „„ „ ... „„ .. „ . . „ ... . „ .„ ... „ .... „ . ...... „ .. . „ ... .. ... „„ 458
Chapter 15 Text Widgets ...... „ ••....... „ ... „ ....... „.„„ .•.• „ •..••.•••.••.•••.•• „ •... „ ... „ .... „ •.••.• „ •.• 461
15.1 The Text Interface Model ........ „ •••.. „ .•.... „.„ ... „ •• „„„ •. „ . „ •.• „ .. „.„ •.• „ .. ••........••. .....••......• „ 463 15.1.1 Selecting Text „ .„„ .....•... ..•...... „ .. „ .•....••..•. „ .„„„ •.. „ •.••..•. „ •... „ . „ ••. .•.••.••. .... „ •.••..•. „ .. „ 463
X
15.2 The Basics of Text Widgets .„.„.„.„ ...... „ ........ „ ..... „„-•. „ .. „ ... „.-„„;.„ ... ;....-„ ••• .::„.„„ •. :. 466 15.2.1 The Text Widget's Text .• „.„ ... „ .• „ .•.... „ ...... „.„ ... „.„ ...... „„„.„ ..• „ ....•.• „„_ ..•. „ .. „ ••••• 466 15.2.2 Editing Modes _„ ... „.„ •.......... ; .... „ ..•........•.............. „ .. „ ... „„;.„„.„ ... -„„„ •. „„„„.„„. 469 15.2.3 Scrollable Text ·--„.„.„ ... „ ....... „ •.....•.........•..• „.; .... „ .....• „ ....... „ •. „ ..... „.„ ... „.„.„ .. „. 470
15.3 Rudimentary Examples .~„ ... „ ................ „ .... „ ... „„„.„ ..... „ .. „ .........• „„„„ ........ „„„.„.„„„„ 473 15.3.1 A File Browser „,.,....J. •• „l ..... .-„: .......•. „ .. , .. „ ...••... „ ...• „ •• „.„„.„ ••• „„„.„ •... „„„ ... „ ... „„ •. 473 15.3.2 Line Wrapping and Scrollbar Placements .„„.„„„.„„.„.„.„ .. „ .... „ .. „.„„.„.„ ... „ .. „ .•. 478 15.3.3 Output-only Text Areas „„„ ....... „„ ...... „„ ..... „,„„„„ .. „ .. „.„„ .... „.„.„ ... „.:.„ •• „.„ .. „„.„ 479
15.4 Text Positions .• -„ ...•..• „.„ .. „ ....•. „ .. „ .......... „ ... „ ... „ ..... „„„„„.„„ .. „ .. „ •.. _„„„„.„ .... „ .. ;„. 482 15.4.1 Artificial Text Scrolling .„„ ... „.„„ ...... „„ ..... „ .. „„ ••.• „„ ........ „.„„„„ .... -.;.„„.„„.„ ... „ 486 15.4.2 Text Replacement ......•. „ ..•. ; ....... „ ..... „.„„ •• „ ... „„„ ...... „„„„.„„.J„;,;.~.-...... „„„„„. 486
15.5 Text Clipboard Functions .. „ ... „ ..... „ ... „ ........ „ .. „.„ ...... „ ... „.„.;...„„„„„„ .... ; ...... „.„„.„ .. „ ... 488 15.5.1 Text Selection Details ... „.„„„„ ..... „.„„„ .............. „.„ .. „„„„„„.„„.„„„.~ ... „ .. „ ... „„„. 492 15.5.2 Modifying the Selection Mechanism .. „ .. „ ... „„ ... „ ........ „"'„„„.„ ..... „„„ .. „ .. „„.„„ .•. 493
15.6 A Complete Editor „.„„ .... „„ •.... „„.„ .......•. „.„ ..•...... „„„ •.. „„.„„ .. „ .... „ .. „„ .• „ .. ~ .. „ .. „ ..... „ .. 494 15.7 Single-line Text Widget Callbacks „„ .. „ ... „„„„.„„ ... _.„.„.„.„.„„.„.„„„.„.„.„„ .... „„.„„ 502
15.7.1 Activation Callbacks in Dialogs „ .. „„„„ ..• „„ .... „„„ ..... „„ .. „„,„ •. „„„.„„ •• „.„„.„„ .. „ 505 15.8 Text Modification Callbacks .„ ..... „„„.„„ •• „.„.„ ... „.„.„ ..•. „ .. „.„.„„ .. „ .•. „ .. „ .•• „.„ ... „„.„„ 505
15.8.1 The ModifyVerify Callback „„„.„.„„.„ .•. „„„„„„.„„„„„„ ... „„.„„„„„„.„„ .• „„„.„.„. 506 15.8.2 Vetoing a Text Modification „„ .• „„ •. „„„.„„.„„.„.„ .. „„„„.„.„.„.„„.„„„ .. „.„ •• „„„.„„ 509 15.8.3 Handling Text Deletion .... „ .. „ .... „ ......... „.„.„„„.„„.„ .. „.„.„„„„„.„„.„„„„ .. „!„ ..... „ .... 510 15.8.4 Extending Modifications andthe XmNvaiueChangedCallback .. „ .„ .. „ „ „.„„.„„„. 513
15.9 Cursor Movement Callback „.„.„„.„„„„„.„„„.„ ... „„.„„„„„.„.„„„„ .• „ .. „.„„.--„„ .• „.„. 516 15.10 Focus Callbacks -~„ ... „ .. „"'„„.„„ .. „ .. „ .. „.„.„„ ... „„ .. „.„ ..• „„.„„ .• „ .. „; .. „ .. „.„„.„ ...• „„„. 518 15.11 Summary _„.,.._ .•.• w•••·„.„ ........ „ .... „„ .. „„.„.„.„„.„ .. „.„ .. „„.„„;.„„.„.„„„„.„„„.„.„„.„ .. 519 15.12 Exercises <n„.,„ .. ,„.„ •.... „.„ ..... „.„.: .• „„ .... „.„.„„.„„„„.„ .... .. .• :„ .• „„.„„. „ .„ .•• „ .. „„.„ .. „„.„ 519
Chapter 16 Menus .... „.„„ .. „„.„„„„.„„.„„ .•. ... „.„ .. „.„„ ... „.„ .. „„.„ ... „ .. „ .. „.„ .. „.„.„.„„.„ 523
16.1 Simple Menu Creation „.„„„„„„„„„„-.„„ •••• „.„„ •. „_„ .... „„„„:„.„.„„"' .... „.„„„ ••• „„. 526 16.1.1 Simple Popup Menus „.-.„„„.„„„.„.„.„„.„„„„.„.„„.„„„„„„„.„„.„„ .• „„„„„„„„„„. 527 16.1.2 Simple Cascading Menus „„.„„ .. „„.„„„ ... „ .. „.„.„._ ... „ .. „.„ .... _„.„„-„.„„.„„„„„„ 530 16.1.3 Simple Option Menus .. „„„„.„„„„„.„ .. „.„„„.„-„.„„.„„„;„ .• „.„·.„.„ ... „„,„„„„„.„„ 532 16.1.4 Summary of Simple Menu Routines .„„.„„„„„„„„„„„„.„ .. „„ .• „„„„„.„.„„„„.„„„„ 534
16.2 Advanced Menu Methods .„.„ .• „.„ .. „.„„„„ .„.„.„„.„.„ . . „„.„.„.„„ .. „„„„„„.„ •..• „„ .. „ . • • „ •. 535 16.2.1 Menu Titles .„ .... „„„ .... „.„ .. „„.„„.„ .... „ .„ ..... „ ... .. „„ ....... „ .. „ . . „.„ .... „.„ •... „„.„„.„ .. „„ 537 16.2.2 Menu Items •. „ ... „.„„„„„.„„ •.• „„ .. „„„.„.„„ •. „„ . .-1.„ ... -..;..„,.„.t.„.„ .• „ •. „~ .. „.„.„„ ... „ 538 16.2.3 Mnemonics „ •.• :.„„.„ .••. ;„„„.„.;„„„„.„„„.„.„„„„„„„„.:„.„ •• „.„ • ._..-.„.„ .. ..:„1..„:„ ... „ 538 16.2.4 Accelerators ................. :: ..... : .„ .„.„ .... „„ . .. .... „.„ ..•.... „.„„.„ .... „ .. „ •.•...•.... „ .. „.„ .......... 539 16.2.5 Help Titles „.„ ............ „.„„ ... „ ...... „.„.„ .. „.„ .. „ ... „„ .... „ .. „ .. „„.„„.„ .. „„„„„ ...... „.„„ .. „ 540
16.3 General Menu Techniques ._ ..... „.„ ....... „-.... „ ..... „ .... „.„.„.;„ •• „.„.„.„ .. :"„„.„.„ •.• „„.„„„ 543 16.3.1 Building Pullright Menus -.-.„„„ ... „„ .. „„;_„,,,_ .•• „„ ........ _;.„„ .. „.„ .. „ •• „_„„.„. 546 16.3.2 Building Popup Menus ...... „--.„„„„ ... „.„„„„ ... „„„.„.„„ .• „ •• „„.„ •• „ .. „„.„„„.„„.„ •.. 551 16.3.3 Using Popup Menus „·-·-····„„ ... „.„„„„.„.„ .. „ .... _,. __ ·-~··••···-··„·--„-·„ 554 16.3.4 Building Option Menus .. „.„.„ .•. . „ ... „.„.„„„„ .. „.„.„.„.„ .. „„„„ ..... „.„„ .. „„.„„.„.„ .... 561
xi
16.4 Menu and Menu Item Sensitivity „„„„„„„„„„„„„„„„„.„„.„.„ ••.• „ .• „ •••.••.•• „.„„„.„.„„„. 566 16.5 Summary ......... ....................... . „ ..............................................• „ ....• „ .. „ ..... „ .. „ .. „ ...... „ ....• 568 16.6 Exercises .......... „ ........................ ... ................ „ ........................• „„„ •• „.„ .• „.„ •• „„.„ .. „„ •.•... 568
Chapter 17 Interacting with the Window Manager „„„„„„„.„„„„.„.„.„„„.„ 573
17.1 Review ofConcepts „.„ „„„„„„„.„„„„„„„„„„„„.„.„„„„„.„.„„„„„.„„„„„.„.„„„.„.„.„„. 573 17.2 Common Shell Resources .„„„„„.„„.„ .. „„ ... „.„„.„ .. „ .„.„„.„„„.„.„„.„„.„„„„„„.„„„„„„ 575
17.2.1 Shell Positions „„ .. „.„„„.„.„.„.„ ... „„„„„„„.„.„.„.„„„„„ .. „„.„„ ... „„.„„„„ .. „„„.„.„„ 576 17.2.2 Shell Sizes „„„„ ....... „.„„„„„„.„ ...... „.„„.„„.„.„.„„.„„„„.„.„„„„„„„.„„„.„„„„.„„„„ 577 17.2.3 The Shell's Icon .„.„„.„„„„„„.„ ... „.„ .. „.„„„„.„.„.„„„„„„„„„„„„„.„„„„„.„„„„„„.„ 581
17.3 VendorSbell Resources .„„„„.„ ... „ ... „„„.„.„.„„.„„.„.„„.„„„„„.„„.„„„.„.„„ .• „ .. „„„.„„„ 584 17.3.1 Window Manager Decorations „.„„„„„„„„„ ...... „.„„„„„„„„.„„„„„.„„„„„„„.„„„„ 584 17.3.2 Window Manager Menu Functions „„„.„.„„„.„„„.„„„„„„„.„.„„.„„„ •.• „„„„„.„„„. 586
17.4 Handling Window Manager Messages „„„.„„„„„„„„„.„„„„„„„„.„.„„.„.„„„.„„„„„.„. 589 17.4.1 Adding New Protocols „„„„.„„.„„„„.„„.„„„„.„„.„.„„„„„„„„„„„„„„„.„„„„„„.„„. 591 17 .4.2 Saving Application State .... „.„ .. „„ ... „.„.„.„.„„„„.„„„.„„„.„.„„„„.„.„„„„.„.„.„.„„ 592
17.5 Customized Protocols „ .. „„„„„„.„„ .. „„„„„„„„„„ .... „.„.„.„„.„.„„.„.„„„.„„„„„.„.„„.„ .• 595 17.5.1 Now What? „„„ ... „.„„„„„ .... „ .... „.„„„„„.„.„.„ .. „„„„„.„.„„„„.„„.„„.„„„„„„„.„„.„. 598 17.5.2 Whatever You Like „„„„„„„„„.„.„„„„„„„.„„.„„„„„„„.„„„„„„„„„„„„.„„.„„„„.„. 599
17.6 Summary .. „„„„.„.„.„ .. „„„„„ .. „ .. „.„„„„„„„„.„ .... „„.„„.„„.„.„„„.„„.„„„„.„„„„„„„„„„. 599 17. 7 Exercises „ „„. „„„ ..... „ „ „ . „. „ .... „. „. „ .• „.„„. „. „. „„.„„„.„„„„„ ... „„„„ „„.„.„.„„„.„.„„.„„„ 600
Chapter 18 The Clipboard .„.„„„.„„.„ .. „„.„„„„.„.„.„„„„„ .. „.„„„„„.„„„„„„„„„.„„. 603
18.1 Simple Clipboard Copy and Retrieval „„.„„„„.„.„.„„.„.„.„.„„.„„.„„„.„„„„.„„„„„.„.„ 605 18.1.1 Undoing Copies „ .... „.„.„.„ ..... „ ..... „.„ ..• „ . . „ .. „ .. „.„.„.„.„ .. „„„„ .• „„„.„ .. „.„.„„„„„.„ 609 18.1.2 Incremental Retrieves .„„„ .. ..... „„.„ .. „„.„.„ ..... „„ .. „„„„„„.„„„„ •... „.„.„„„„.„„„„„. 610 18.1.3 Querying the Clipboard for Data Size „„.„„ .. „„„„„„„„.„„.„.„.„„„„.„.„.„„„„„ •• „. 612
18.2 Copy by Name .„„„ .. „.„„„„„„„.„ .. „„ .. „„„.„.„ .. „„„„„„„„„.„.„„„„„„„„„.„„„.„„„„.„„„ 613 18.2.1 Copying lncrementally „.„ •• „„.„„„„„ ... . „„ .. „.„„„„„„„.„.„.„.„„„„„.„.„.„.„„„„.„„. 616
18.3 Clipboard Data Formats „„„.„„.„.„„„„.„.„„.„„.„„„„„„„„„„„„,„„.„„.„„„.„„„„„.„„„„. 617 18.3.1 Inquiring About Formats „„„„„.„„„„.„„.„.„.„.„„„„„„„„„„„.„„„„„„„.„.„.„.„.„„„ 619
18.4 The Primary Selection and the Clipboard „„„„„„.„„„„„.„„„.„„„.„„„„„„„„„„.„„„„„. 619 18.4.1 Clipboard Functions with Text Widgets „„„„„„ .. „„„„.„„„„.„„.„.„.„.„.„„„„.„„„„ 620 18.4.2 Who Has the Selection? „.„„„„„„.„„„.„„„„„„„„.„„„„„.„„.„„.„„„„.„.„.„„„„.„„.„ 621
18.5 How lt Works :„„„„„.„„.„.„.„„.„„„„.„ .. „„„.„„„ ... „„„„„„„„„„„.„.„„„„.„„„.„„.„„„„„„ 622 18.6 Summary .. „„.„.„„.„.„ .... „„.„.„„ .. „ ... „.„„„„.„.„.„„„„„„„.„„.„.„ .. „„„„.„.„.„„„„„„„„.„. 624
Chapter 19 Compound Strings „„„„„„.„„.„„„„„„„„„„„„„„.„„„.„„„„„„„„.„„„„„ 627
19.1 Simple Compound Strings .„ ....... „„.„„„„„„„.„.„„„„„„„„„„„„.„.„„.„„„„„„„ .. „.„„ •• „„ 627 19.2 Character Sets and Font Lists „.„.„.„„„„.„.„.„.„.„„„„„.„.„„„„ .•.. „„„ .. „„„„.„„„„„„.„„ 630
19.2.1 The Default Character Set „„„„„„„„„„.„„„„.„„ .• „„„„„„„„.„„„„ .• „„„„„.„.„„„„„. 631 19.3 Creating Compound Strings .. „„„„ ... „„.„.„„„ . . „.„ .. „„.„.„.„„ •. „„.„ ..... „„„.„.„ •. „.„.„ .•... 633
xii
19.3.1 Compound String Segments „ .. „ ........... „„ ........... „.„„.„„ ..... „„„„„„.„„„ .. „ ... „„.„„. 635 19.4 Strings with Multiple Fonts ....... „„.„„ ...... „„„.„ ...... „.„.„„.„„ ..... „„.„„„„.„ ..... „„„„.„„„ 639
19.4.1 Creating Font Lists .„„„ ...... „.„„.„ ..... „ .. „„„ .. „ ..... „„„„„ .. „ ..... „„„„„.„ ......... „„„„„ .. 641 19.5 Manipulating Compound Strings „„.„ .... „„„„.„„„ ..... „.„„ .. „ .. „„ .. „.„„„„„„„„„„„.„„„„ 644
19.5.1 Motif String Functions „„„ .. „.„„„ ..... „.„„„„„ ...... „.„„„„ .. „.„„.„„„„„„„„.„ .. „.„ ... „. 645 19.5.2 Converting Compound Strings to Text .„ .. „„.„„„.„„„.„.„.„„„„„„„„„„„„.„„„„„„. 647
19.6 Advanced Material ...... „.„„„ ...... „„„.„ ...... „.„„„„„„„ ... „„„„„„.„ ...... „„„„.„„„ •. „„„ .. „„. 649 19.6.1 Querying Font Lists .„„„ ....... „„„„ .. „.~„.„„„ .. „ .. „ .... „.„„„.„„ ..... „.„„„„ ....• „ .. „ ..... „ .. 649 19.6.2 Rendering Compound Strings „„.„.„ ... „ .. „.„„„„ •.... „.„„ .. „ .. „ ... „.„„„„„„ .. „.„ •........ 651 19.6.3 Compound String Dimensions „„ .. „ ••....... „„„ .. „ ..... „.„„„„„ ...•.. „ .. „„ .. „„.„ .. „ ..•...... 653
19.7 Summary ..... „.„„.„ .. „ ..... „ .. „.„„ .... „„„„ ....... „.„„„ .. „„„ ...... „„„„„„ •....... „„„„„„„.„ ...... „. 654
Chapter 20 Signal Handling „„„„ .... „„„„„.„ .. „ ..... „.„„.„„„ ..•.. „ ..... „.„ ............ „„„ ... 657
20.1 Handling Signals with Xlib .„„.„ ..... „.„„ ........ „ ....• „„ .. „„ ...... „ ..... „„ ..• „ ..... „„.„ ... „ .. „.„ .. 659 20.2 Handling Signals in Xt-based Toolkits „„„„„„„„.„„„„„„„„„ ... „„„„„„„„„„„„„„„.„„„ 661 20.3 A More Complex Example „„„„„„„„.„„„„„„„„„„„„„„„„„„„„.„„„„„„.„„„„„„„„„„„. 663 20.4 Loose Ends „.„„„ ...... „ .. „„„ ..... „ .. „„„ ........ „„„ .. „„„ .... „„.„„„„„„„ .... „.„„„„„„„„ .....•. „.„ 668
Chapter 21 Advanced Dialog Programming „„„„.„„.„„ •• „„„„„.„ .. „.„„„,„„„„ 673
21.1 Help D_ialogs „„.„„ ... „„„.„ .. „ ....... „„ ...... „„ .... „.„ ... „ .. „„ .. „„„ ..... „ ... „„„„ •. „ .•.•.. „.„„„„ .. „ 673 21.1.1 Point-and-click Help .......................... „ .. „ .... „ ... „.„ .. „„„„„.„.„.„.„„„„„„ ..... „„.„„„. 681
21.2 WorkingDialogs „.„„„„.„„ ..... „ .. „„„ ........ „„„„ ......... „„ .. „.„„„„.„„„„.„.„.„„„.„ .... „.„ .•. „ 683 21.2.1 Using Work Procedures .... „„.„ ...... „„„„ ... „ .. „„„„.„„.„„ ...... „„.„„.„„ ........ „„.„„.„ .• 684 21.2.2 Using Timers ... „„ .. „„ ....... „„„.„ ..... „ .. „„„ ......... „ ... „„„„„ ...... „„„.„.„„ .......... „.„„„„. 689 21.2.3 Processing Events Yourself „.„„ ....... „.„.„ .......... „ .. „„ .. „ .. „ .... „.„„„„„„ ........ „„.„„„ 689 21.2.4 Caveats with XmUpdateDisplay() „„„.„.„„„ .. „.„„„.„„„„.„„„„„„„„.„„„„„„„„„„. 696 21.2.5 Avoid Using Forks „„ .. „ .. „„„.„„ .... „„„ .. „„„ ....... „.„„„„„„ .... „ .. „„„„„ .. „ ..... „.„„„„. 699
21.3 Dynamic MessageDialog Symbols ..... „.„„ .. „ ........ „ .. „„„„„„„ .. „„„„„ ... „ ... „.„ .. „„.„.„ .. 701 21.4 Summary .„„„„.„ .. „„„ .. „ ..... „ .. „.„„.„ ... „„„„.„ .. „.„ .. „„.„.„„„ .. „.„„„„„„„.„ ... „.„.„„„„.„. 707
Appendix A Motif Functions and Macros „.„„„„„.„„„„.„„„.„„„„„„„.„ •. „„.„„. 711
Appendix B Xt and Motif Widget Classes ......... „ ... „„ ....... „„„„„„„„ .. „„ .. „„ .. „„ 783
ApplicationShell „ ........ „ .. „ ..... ~·································································„ ............ „ ......... „ ...•.. 788 ArrowButton ......................................................................... „ ............•.... „ ..•.•..••••..•.•..••.• „„ •..... 789 ArrowButtonGadget „ ......... „„„„.„„ .. „„„„.„ ..... „„„„„„„ .. „.„.„.„„„.„ .. „„„„„.„.„.„ .. „ .. „.„„ .• „ 792 BulletinBoard ..................................................................................... „ ................... „ ................. 793 BulletinBoardDialog ........................................................................... „ ............. „ .. „ .. „ ..•.•...•.•.• 797 CascadeButton ..................................................................................... „ •. „ ..........•. „ ......•.... „.„ .. 797 CascadeButtonGadget ............................................................................................................ „. 800
xiii
CheckBox .............................. „ .....•...... „ ..•......... ... „ .. .. •.. „ ..•..•..•... „ .. ..••• „ •...•.. „ ..•.... „.„ .... „.„ ...... 801 Command .„ ...... „.„ .... „ ... ...... „ .„ ... „.„.„.„.„.„ ... „„ . . „ .... „.„.„ ............... „ ..• „ .. „ .. . „.„ .. „.„.„.„ .•.... . 801 Composite ........... „ .. ... . „.„„ ... ... . „ ... ... .... „ ........ „ .. „ ............ .......• „ .. „ ... ... .. .........• „ ... . „.„ ... .. „ .. ... ... 804 Constraint .„ ....•..•. „ ......•.... . „ ... „ ........•. „ ..• „ . . „ ...•• „ .. „ ....•....•............. •..•... „ ........ .. „ ... . „.„ ...... „ .„ .. 806 Core .........................•......................... , ..................................... J....6, .............. „., ..... ~ ... „ .•.•• ..ii ••• „ 807 DialogShell ......... „ ............ ... „ •••• . ••••••••••• •••••••• ••••••• ••••• •••••••• ••• .••• : ••••••••••••• „ .......... „ ... ..... „„ ......... .. 809 DrawingArea ..................... „.„ ........•.. „ .... „ ...•.. . „ ••. „ ...... „ .... „ .„ ....•....... . „ .... „ •... „ ... „.„.„ ....•.••.•... 811 DrawnButton .„ , ... „ .. ....... „.„ ... „ ... . „ ....... .. „ .„.„ ... . „ ..... . „.„ ...... . „ .... „„ ....... .. ... . „.„ ... ......• „„.„ ...... 813 ErrorDialog ............ „.„ .. „ ...... „ ... ... „.„ ......................•••. „ .„ ...• „.„.„ ..•..•.... „ .... „„ •.•...• „ .. „ .... „„ .•.. 816 FileSelectionBox „„ .......... „„ .•• „„„.„.„ ...... „.„„ .. „.„„.„.„„„„.i..„_._,„_ ...... „ ..... „.„ .• J •• „ ...... „_. 816 FileSelectionDialog .. „.„„ •• „ ... „ •.•• „.„ •.•• „ ......... „.„.„„„ .• „ ....... „ ••••••• ..._.,_,_„„ .................. „._._ •• 821 Form „ •....•••.. „ ..••.••.•.•..•••.... „ •.•..•..••...•••••••. „ .•.. „ ... „.„.„ .. „ .... „.„ ••• „.-.„·--·"""-··-···„-„„ .• „-. 821 FormDialog „ .. - .... „ •• „ .......... „.„ ..•• „ .„„ ••••.•. „ .•. „.„ ••• „„ •••••••.• „„„ •••••••• „.„ . .._„„ ........ _, ...... ".„„. 826 Frame .„ .„ ...... „ ...... . „ .„ ..•...... „ ... ... „ . ..... . „.„ ... ... „ .„ .............. , ... „ • • „ •... „.„.„.„ ... „.„„ .... „ ........ „„ ...... 826 Gadget .„.„.„ ••• „ •.. „ .• „.„.„.„„.„ .. „„.„.„„„ •• „.„.„.„„.„.„.„„„„.„.„.„„.„„ •. „„ •••• „„ ••. „„ ..•• „.„.„_. 827 InformationDialog .. ........................ „ •..• „.„ ... ... „.„ .... „ ... „ . ...... .. . „ ...... . „.„ •... „„„„.„.„.„.„ ............ 829 Label .............. „ .... ,.„...., ••••••• u.„ •••••••••••••••••••••••••.••••••••••••• „. __ •. , •• t,_'-9••••••••••••••u•••••uL. ••• .-........ ~.-··••__.- 830 LabelGadget ..... „~ •• ", ................ „.„ ............................. „ .......... ..,_.. •• ._ •• ,_.,,."'.,_._._ .... ,_ ••• „„ . .,. ........ .-.... „"·······„··-..... 834 List ............................. „ ........... „._..„ ....... 111..„ ••• „ . •• „ •••••• • •••• „ ••.• -,_· ..... „·-·····-··········„.„-... .u.9..._ ....... „ .... „ ....... „.~ 835 Main Window •• „.„.„ •.• „„„„ .••... „ .„„ •• „.„.„ .•.... „.„ .••.•. „.„ ••••.••• „„„„„.„ ••• .-.-.„"„-".„ ...... „_ ...... 843 Manager ........... „ •• 111 •••••••••• „ ••••••••••• •••••••••••••••••••••••• „ .~·····-·· ···· ······················--··---~-........ ,,._ ...................... 845 MenuBar .„ ............ ... ... „ .„ .„ ......... „ .... „.„ ...... „ ... ....... „„ . .. ... .......... „.„ ...... „.„ ... ...• „ .„ .... „.„ ... .. .... 849 MenuShell „.„„.„ ••.. „.„ .•••••... „ .. „ ... „.„„.„.„„ .. „ ... „ •..••.• „.„.„„.„.„ •. „„.„.„„ •• -„„ .. „._.„„-•• ·--· 849 MessageBox .... „„.„ ....•. . „ .... „ •. . •. •... „.„„ . ...... „.„ .... „ ... „ .... ........ „.„„.„ ..... „ . . •. •... „„ ..... „„.„ .......... 851 MessageDialog „ ...... ,„.„ •••••. ,M •. ,.._._.,..........., ..... ,...., •• -..-.....-. ...... "'" ............................ „ •• - ••••• „„ • .l • .-..~ ••••••••.•••. , ••••• ,_ ••••• 854 Object ... „ ... „ ....... „„ ... . „.„ .„ ...• „„ ....... „.„„ .• „„ .„ ... „.„ .• „ .............. „ .. „„ .... „ .„„.„.„ .. „ • ..• . „ .„ ..... „ .. 854 OptionMenu ..... „ ........................ „ .. ....... „.„ .„ ... „ .„ .... „ ..•. „.„„.„ ....... „ .„ . „ .... „.„ .. „„ .•.. . „ .. „ ... „ .... 855 OverrideShell .... „ .... „ ...... ..... ... ... . „ ... . „ .... „ ... „.„„.„.„.„ ....... „„ ...• „ .. „ ...... „ ... . „ .... „ .. „ .......... „ .... „ 855 PanedWindow ....... „ . . „.„ .......• „ ...• „.„ ..•..•. „ .•...... . „.„ ... •.• „ .„ ....... „ .... „ .„ ..• „.„ •. „ ..•..•.•... „ ...•.. „„ •. 856 PopupMenu .„ ....... „ .•. .... „.„„ ............ „ ... . „ . .•• „ ... ...... „.„ ... . „..,,.„ ... „. „ .. „ .... „„ ........ „„ ..... „„.„„.„. 859 Primitive .. „ .... „ ... ......... „ ......... „ .... „ .„.„ ... „ .......... „.„ ........ . „ .... „ .„ ....... „.„ ... . „.„ ...•.•. „ .„„ ... „.„.„ 859 PromptDialog .... „.„ ... „ .. „ ...... „ .„ .....• „ .„ ... ... „„.„ ...... „ .•. ....... „.„ ...•.. . „ •.. ..• „.„ ....•. . „ ......••... . „ .... „. 863 PulldownMenu ...... „ •.. • „ .... „„ ...... . „„ .... „.„.„ .... „ .„.„ ... ... „ ......... . „ ...... . „ .„.„.„„.„.„.„.„„ .... „.„.„ 863 PushButton .. , ... „ ...•. ..••• , ..•....•..•..••...•.••••• ..•.•.••. .•..••.•••• .•••.••.••• ._ •••.•.• „ ••• ..: ..... ~ ........ „„io ............ ................ 863 PushButtonGftdget „„ •••...•. „„ .... „ .•... „ •• „ ...• „.„„ •. „.-„„.„ •. „„.„„„ •• „„„„ • ..,„.„„.„ ..... „ .••• „ ... „ .„. 867 QuestionDialog ... „ .„ ............... . „.„ ... „ .. .. „ ........... .... „„ .... „.„.„ .... „ .„ ...... „.„ .......... „„ .... „ .. „ .. . „ . . 868 RadioBox ..... „ •• „ ... ..................... ..................... „ •• „ .... „„ ............... „ ..... ,~ ••••• _,. • .._. •••••• „ •• „ ••••••••••••••••••••••••••••••• 869 RectObj ..... „., •••••••.•.•••• „ ••••• , ••••••••• „ ••••.••••••••••••• •• ••••••• , •••••••• „,, .•••••• , •••••• -.„„ ....... ................................ 869 RowColumn '""'"'''"""'''·"''" ..... „„ •.......• .'.„.„ .... „ ••. „ .. „.„„.„„ •• „ ••.••• „ . „ ..........•..•.......•. „ „ „ .. „„. 870 Scale ..................... „ .... „ .„ .. ..... „ ... „ . ..• „ .. .... „.„ .„ .... „ ......... „„ . ..•... „.„ ....... „ .„ .....•. „.„ ... ..•. „.„ .... „ . 879 ScrollBar ... „„„„„„„.„.„.„ •.. „ •.•.... „ ..•• „ •.•• „ ...•.. „.„.„.„ .. „ .•.• „ .• „.„ ••• „„„„ •• „ .•.• „„„„.„„",..., ..... _; 882 ScrolledList ... „ .... „ .... „ ..... ....... „ ...... „ ....... „.„.„ .. .... „.„ .... „ ... .. ...... . „ .„ .... „ .......... „.„ .... „ .„.„ .. . „„ 887 ScrolledText .„„ .. „ .„ .•..... „ ....•.... „.„ ... . „„.:„ ... „.„.„ ...... „.„ ... .••. „ ....... „.„ ... •.• „.„ •... „ •. „„ .....• „ .„.„. 887 ScrolledWindow ... ... „ .„ .... „ .. .... .... „„ .... „ ............ „ .... „.„.„.„ •.. . „„.„ . .. . „.„.„ •. „ ... „.„.„„.„„.„.„ ... 888 SelectionBox ..... „.„ ... . „ •.•••••.. „.„ ....... „„ ... ... .... „ .„ ...... „ ......... . „ .„ .... „.„ ...... „.„.„ ......... „ .....•.. . „ . . 890 SelectionDialog .......... „ .•...... .. „ •.... . „ .„ ...... „ .„ ... ..•. „.„ ..•. „.„ •... „ .. . „ .... .. . „.„ ....... „ ..•... .. .• „„.„ .... „ 895 Separator .......... „ ............ „ ......... „ .„.„„ ..•. „ .... „„ . . „ .. . „.„.„ .... „ .„ .......... „ ... „.„.„ ...... „.„ ..• „.„.„ .... . 895 SeparatorGadget ... „.„ •... „ .„ ...... „.„.„ ... „.„.„ ...... . „ .......... „ ••. „.„.„ .•.•..... „ .„ •.•. „.„„ •. „„.„.„.„.„ ... 896
xiv
Shell - , „.„.„„.„„„.„„ ....................... „ .... „ ..... „ .................. „ .. „ ...... „„ .• „„ .. „ ..... „ ............ „ •. „ •. 897
Text -··••••••••u•u•••••••••••••••••••••••••••••„••••••••••••••••••••••••••••••••••••••••••"""""""'"'""'''"""'"""''"'"''"'"'''"' 898 TextField „„„„„ ... „ ........... „ .......................... „ ........... „„„ ........... „ .. „.„ ..... „ .. „„.„„ •... „.„ ........•. „. 910 ToggleButton „„ .. „.„„„ .........•. „ ............ „ ...•.....•... „ ................ „., .. „ ........... „.,„„„.„ ....• „ ..... „.„„„ 913 ToggleButtonGadget ..................................... „„„ .....•.... „.„ .. „ .... „„ ...... „„„„ ... „ .. „ ...... „„„.„ •. „ •. 917 Topl.eve!Shell .... „„.„ ...... „„ .. „ ..... „ .. „„ ..... „ ..•.. „ ..•... „„.„„ .... „ ........ „ ..• „ .•........ „„„.„.„ .. „„.„ •. „. 919 TransientShell „„„.„ ............... „ ................................ „ ........ „.„.„„.„„ •....... „.„„„ .•. „.„„„.„ ... „ .. „ 920 VendorShell .„.„ ...... „ •.. „„„„ .. „ ...................... „„ .......•.... „„ .... „.„„ ..... „.„.„„„„.„„ .•. „ .• „.„„„„.„. 922 WamingDialog ...• „.„ .............. „„„„ ............ „„ ............ „ .... „ ... „ ...•..• „„„.„ ..... „.„ .. „„ .. „„ •. „ ......... 925 WMShell „„ ......... „ ........ „„ .•............................ „ ........ „ .... „.„.„ .......... „„„„„„ .... „ .... „„„.„„„„ .. „ 925 WorkingDialog .......... „.„.„„ ........ „ ... „ ............ „„„„„ ....... „„„„ .. „„„.„ .•.. „„.„.„ .. „.„„.„„„.„„ •. „. 928
Appendix C Data 1'ypes „„„„„„„ ... „ .. „.„„„„„„„„„ .. „„„„„„„„.„„„„„ ....• „„„„„„„ ... „. 931
Appendix D Additional Example Programs .. „ .......... „„„„ ...... „„ .. „„„„„ .. „ .„„. 941
D.1 A Postcard Interface for Mail .... „„ .. „ .... „„ .. „„„.„„„„.„ .. „ ... „„ ..... „„.„.„.„„ •. „„„ .. „„.„„. 941 D.2 Displaying a List of Bitmaps ... „„ ...... „„ .. „„„.„„ .. „„ ........ „„„.„ .. „„ .• „ .. „„„„„„„ ..... „„„„ 949 D.3 A Memo Calendar „.„ .... „ ...... „ ...... „ ....... „ .•.. „ ..... „ .... „ .. „„„.„ ........ „.„„„„ .... „„ •.. „„.„„„„ 960 D.4 Setting Cri teria for a List „„„ .... „.„ ... „ ...... „ ............... „ ... „ ...•....•..... „„.„„„.„.„„„„„.„.„„. 967
XV