7.16 Numeric Text Items 193
7.17 Multiline Text Items 193
7.18 Drop Target Items 194
7.18.1 Programming a Panel Drop Target Item 196
7.18.1.1 Create the drop target item 196
7.18.1.2 Specify the glyphs 196
7.18.1.3 Create the drag and drop object 197
7.18.1.4 Define the drop target item’s requestor 197
7.18.1.5 Controlling the glyphs 198
7.18.1.6 Dropping on the drop target 198
7.18.1.7 Dragging from the drop target item 198
7.18.2 Drop Target Notification 198
7.19 Advanced Panel Usage 199
7.19.1 Attaching Data to Panel Items 199
7.19.2 Using PANEL_REPAINT_PROC 202
7.19.3 Painting Panel Items 205
7.19.4 Panel Event Handling 205
7.19.5 Using an Interpose Function 207
7.19.6 Using PANEL_BACKGROUND_PROC 207
7.19.7 Using PANEL_EVENT_PROC 207
7.19.8 Event Handling Example 208
7.20 Panel Package Summary 209
Chapter 8 Text Subwindows 215
8.1 Creating Text Subwindows 216
8.2 Setting Text Subwindow Attributes 216
8.3 Text Subwindow Contents 216
8.4 Editing a Text Subwindow 217
8.4.1 Loading a File 217
8.4.2 Checking the Status of the Text Subwindow 218
8.4.3 Writing to a Text Subwindow 219
8.4.3.1 Setting the insertion point 219
8.4.4 Reading from a Text Subwindow 219
8.4.5 Deleting Text 220
8.4.6 Emulating an Editing Character 221
8.4.7 Replacing Characters 221
8.4.8 The Editing Log 222
8.4.9 Which File is Being Edited? 222
8.4.9.1 Interactions with the file system 223
8.5 Saving Edits in a Subwindow 223
8.5.1 Storing Edits 223
8.5.2 Discarding Edits 224
8.6 Setting the Contents of a Text Subwindow 224
8.6.1 TEXTSW_FILE_CONTENTS 224
8.6.2 TEXTSW_CONTENTS 225
8.6.3 TEXTSW_INSERT_FROM_FILE 225
8.7 Positioning the Text Displayed in a Text Subwindow 226
8.7.1 Screen Lines and File Lines 226
8.7.2 Absolute Positioning 226
8.7.3 Relative Positioning 227
8.7.4 Which File Lines are Visible? 227
8.7.4.1 Guaranteeing what is visible 228
8.7.4.2 Ensuring that the insertion point is visible 228
8.8 Finding and Matching a Pattern 228
8.8.1 Matching a Span of Characters 228
8.8.2 Matching a Specific Pattern 229
8.9 Marking Positions 230
8.9.1 Getting a Text Selection 231
8.9.2 Setting the Text Selection 232
8.10 Dealing with Multiple Views 232
8.11 Text Subwindow Destroy Confirmation 233
8.12 Notifications from a Text Subwindow 233
8.12.1 Text Subwindow Interposition 236
8.13 Text Subwindow Package Summary 236
Chapter 9 TTY Subwindows 241
9.1 Creating a TTY Subwindow 241
9.2 Driving a TTY Subwindow 242
9.3 Monitoring the Program in the TTY Subwindow 246
9.4 Talking Directly to the TTY Subwindow 247
9.5 TTY Subwindow Function Key Escape Sequences 249
9.6 TTY Package Summary 250
Chapter 10 Scrollbars 253
10.1 Creating Scrollbars 254
10.2 Relationship Between Scrollbars and Objects 256
10.3 An Example 258
10.4 Managing Your Own Scrollbar 263
10.4.1 Monitoring When Scrollbar Events Occur 264
10.4.2 Providing a Scrollbar Compute Procedure 266
10.4.2.1 Indicating scrollbar motion 268
10.4.3 Providing a Scrollbar Normalize Procedure 268
10.5 Scrollbar Package Summary 270
Chapter 11 Menus 273
11.1 Menu Types 273
11.1.1 Pop-up Menus 274
11.1.2 Pulldown Menus 274
11.1.3 Pullright Menus 274
11.2 Menu Items 276
11.2.1 Choice Items 276
11.2.2 Exclusive Items 276
11.2.3 Nonexclusive Items 277
11.3 Creating Menus 277
11.4 Displaying Menus 279
11.5 A Simple Program 280
11.6 Creating Menu Items 283
11.6.1 Using MENU_ITEM 283
11.6.2 Using MENU_ACTION_ITEM 284
11.6.3 Using MENUITEM 284
11.7 Adding Menu Items 285
11.8 Pullright Menus 285
11.9 Menu-generating Procedures 287
11.9.1 Parent Menus 290
11.9.2 Using MENU_GEN_PROC 290
11.10 Using Toggle Menus 291
11.11 Menu Layout 292
11.12 Making Pin-up Menus 292
11.13 Notification Procedures 294
11.14 Finding Menu Items 297
11.15 Initial and Default Menu Selections 297
11.16 Unpinned Command Frame Dismissal 298
11.17 Destroying Menus 298
11.17.1 Freeing Allocated Strings 299
11.17.2 Freeing Pullright Menus 299
11.17.3 Menu Client Data 300
11.18 Example Program 300
11.19 Menu Package Summary 304
Chapter 12 Notices 307
12.1 Creating and Displaying Notices 308
12.1.1 Notice Values and Status 311
12.2 Types of Notices 313
12.2.1 Standard Notices 313
12.2.1.1 Using a notice callback 315
12.2.1.2 Selecting the busy frames 316
12.2.2 Notices That Lock the Screen 316
12.2.2.1 Notice triggers 318
12.3 Destroying a Notice 320
12.4 Another Example 320
12.5 Notice Package Summary 323
Chapter 13 Cursors 327
13.1 Creating Cursors 327
13.1.1 simple_cursor.c 328
13.2 Predefined Cursors 330
13.3 The Hotspot and Cursor Location 330
13.4 Color Cursors 333
13.5 Support for Text Drag and Drop 334
13.6 Cursor Package Summary 335
Chapter 14 Icons 339
14.1 Creating and Destroying Icons 339
14.2 The Icon’s Image 340
14.2.0.1 Color icons 342
14.2.0.2 ICON_TRANSPARENT 343
14.2.0.3 ICON_MASK_IMAGE 344
14.2.1 The Icon Text 344
14.2.2 ICON_TRANSPARENT_LABEL 345
14.3 Icon Package Summary 345
Chapter 15 Nonvisual Objects 349
15.1 The Display 350
15.2 The Screen Object 350
15.2.1 Multiple Screens 351
15.3 The SERVER Package 353
15.3.1 Creating a Server (Establishing a Connection) 353
15.3.2 Connecting to Multiple Servers 354
15.3.3 Getting the Server 354
15.4 Server Images 355
15.4.1 Creating Server Images 356
15.5 The FULLSCREEN Package 359
15.5.0.1 Debugging and the FULLSCREEN package 361
15.6 Nonvisual Package Summary 362
Chapter 16 Fonts 367
16.1 Creating Fonts 368
16.1.1 Font Families and Styles 371
16.1.2 Font Sizes 373
16.1.3 Scaling Fonts 373
16.1.4 Fonts by Name 375
16.2 Font Dimensions 375
16.3 Font Package Summary 377
Chapter 17 Resources 381
17.1 Predefined Defaults 381
17.2 XView Resource Database Functions 385
17.2.1 Boolean Resources 385
17.2.2 Integer Resources 386
17.2.3 Character Resources 387
17.2.4 String Resources 387
17.2.5 Enumerated Resources 388
17.3 Creating Resource Instances 390
Chapter 18 Selections 393
18.1 The XView Selection Model 395
18.2 How Selection Works (Without a Selection Item) 396
18.2.1 Highlighting the Selection (Selection Owner) 397
18.2.2 Making the Selection (Selection Owner) 397
18.2.3 Requesting the Selection (Selection Requestor) 399
18.2.3.1 Specifying the target type (selection requestor) 400
18.2.3.2 SEL_REPLY_PROC (selection requestor) 400
18.2.3.3 Timeout for a selection response 401
18.2.3.4 Requesting the CLIPBOARD selection-blocking 401
18.2.3.5 Requesting the CLIPBOARD selection-non-blocking 402
18.2.4 Converting the Selection (Selection Owner) 403
18.2.4.1 The default conversion procedure 404
18.2.4.2 Sample selection owner with conversion procedure 404
18.2.5 Handling the Response (Selection Requestor) 406
18.2.5.1 Handling selection reply procedure errors 408
18.2.6 If the Selection is Lost (Selection Owner) 410
18.2.7 Cleanup - When the Selection Completes (Selection Owner) 410
18.3 How Selection Works (With a Selection Item) 411
18.3.1 The Selection Item 412
18.4 How to Send Data Incrementally (Selection Owner) 415
18.4.1 How to Handle Incremental Replies (Selection Requestor) 416
18.5 Requesting and Converting Multiple Targets 417
18.6 Additional Transfer Mechanisms (Selection Requestor) 418
18.7 Additional Transfer Mechanisms (Selection Owner) 418
18.8 Sample Selection Owner Program with a Selection Item 418
18.8.0.1 The notify procedure 421
18.8.0.2 The conversion procedure 422
18.8.1 The Done Procedure 423
18.8.2 The Lose Procedure 423
18.9 Sample Selection Requestor Program 424
18.9.0.1 Sample reply procedure 427
18.9.0.2 Sample error procedure 429
18.10 Selection Package Summary 430
Get Volume 7A: XView Programming Manual now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.