`
`TDA 1022 (Part 1 of 3)
`CBM of U.S. Pat. No. 7,533,056
`
`
`
`O'Reilly &
`Associates,
`Inc.
`
`0002
`
`
`
`Window ystem
`User's Guide
`
`0003
`
`
`
`Volume Thr e
`
`Window ystern
`User's Guide
`
`OSF!Motif 1.2 Edition
`
`by Valerie Quercia and Tim 0 'Reilly
`
`0' Reilly & Associates, Inc.
`
`0004
`
`
`
`X Window System User's Guide
`by Valerie Quercia and Tim O'Reilly
`
`Copyright© 1991, 1993 O'Reilly & Associates, Inc. All rights reserved.
`Printed in the United States of Ame1ica.
`
`Editor: Tim O'Reilly
`
`Printing History:
`
`September 1988:
`July 1989:
`October 1989:
`May 1990:
`January 1991:
`March 1992:
`January 1993:
`May 1993:
`August 1993:
`
`Athena First Edition.
`Athena Second Edition. Revised to reflect Release 3.
`Athena Edition. Minor corrections.
`Athena Third Edition. Revised to reflect Release 4.
`Motif First Edition.
`Motif Edition. Minor corrections.
`Motif Second Edition. Revised to reflect Release 5 and Motif 1.2.
`Motif Edition. Minor corrections.
`Motif Edition. Minor cmrections.
`
`Portions of this book, especially the reference pages in Part Three, are based on reference materials provided on the X 11 R5
`tape, which are copyright© 1985, 1986, 1987, 1988, 1989, 1990, 1991 the Massachusetts Institute of Technology, Cam(cid:173)
`bridge, Massachusetts, and Digital Equipment Corporation, Maynard, Massachusetts.
`
`We have used this material under the terms of its copyright, which grants free use, subject to the following conditions:
`
`"Permission to use, copy, modify and distribute this documentation (i.e., the original MIT, DEC, Tektronix
`and Sun material) 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 all copies,
`and that the names of MIT, Digital, Tektronix, and Sun Microsystems not be used in advertising or publicity
`pertaining to this documentation without specific, written prior permission. MIT, Digital, Tektronix and Sun
`Microsystems make no representations about the suitability of this documentation for any purpose. It is
`provided 'as is' without express or implied warranty."
`
`Note, however, that those portions of this document that are based on the original X11 documentation and other source
`material have been significantly revised and that all such revisions are copyright© 1992 O'Reilly & Associates, Inc.
`Inasmuch as the proprietary revisions cannot be separated from the freely copy able MIT source material, the net result is that
`copying of this document is not allowed. Sony for the doublespeak!
`
`Many of the designations used by manufacturers and sellers to distinguish their products are claimed as
`trademarks. Where those designations appear in this book, and O'Reilly and Associates, Inc. was aware of a
`trademark claim, the designations have been printed in caps or initial caps.
`
`While every precaution has been taken in the preparation of this book, the publisher assumes no responsibility
`for errors or omissions, or for damages resulting from the use of the information contained herein.
`
`@
`
`This book is printed on acid-free paper with 85% recycled content, 15% post-consumer waste. O'Reilly &
`Associates is committed to using paper with the highest recycled content available consistent with high quality.
`
`Motif Edition ISBN 1-56592-015-5
`
`[5/98]
`
`0005
`
`
`
`Table of Contents
`
`Page
`
`Preface
`
`.................................................................................................................................. xxv
`
`Do I Have To Read This WHOLE Book? ................................................................................ xxv
`A Quick Start Approach to X .................................................................................................... xxv
`Assumptions ........................................................................................................................... xxviii
`What's New in Release 5? ..................................................................................................... xxviii
`New Client Programs ..................................................................................................... xxviii
`Defunct Programs ............................................................................................................. xxix
`Clients that Work Differently in Release 4 and Release 5 ............................................ xxix
`Available Fonts .................................................................................................................. xxx
`Available Colors ................................................................................................................ xxx
`Screen-specific Resources ................................................................................................ xxx
`Bulk Sales Information .............................................................................................................. xxx
`Acknowledgements .................................................................................................................. xxxi
`Font and Character Conventions ............................................................................................ xxxii
`
`PART ONE: Using X .......................................................................................................... 1
`
`Chapter 1 An Introduction to the X Window System ........................................ 5
`
`Anatomy of an X Display .............................................................................................................. 6
`Standard X Clients versus Motif Clients ............................ : ....................................................... 15
`X Architecture Overview ............................................................................................................ 19
`The X Display Server .................................................................................................................. 21
`Clients ........................................................................................................................................... 21
`The Window Manager ........................................................................................................... 22
`The xterm Terminal Emulator ............................................................................................... 23
`The Display Manager ............................................................................................................ 23
`Other Standard X Clients ...................................................................................................... 24
`Customizing Clients .............................................................................................................. 25
`
`Chapter 2 Getting Started ............................................................................................ 29
`
`Starting X ..................................................................................................................................... 29
`Logging On in the Special xdm Window ............................................................................. 30
`Logging In at a Full Screen Prompt ...................................................................................... 32
`Starting X Manually .............................................................................................................. 33
`
`v
`
`0006
`
`
`
`Starting the mwm Window Manager ................................................................................... 34
`Typing In a Window Once mwm is Running ............................................................................. 35
`
`Chapter 3 Working in the X Environment ........................................................... 41
`
`Creating Other Windows ............................................................................................................. 41
`Using the Pointer ................................................................................................................... 43
`Managing Windows Using the mwm Frame ....................................................................... 44
`Converting a Window to an Icon ........................................................................................ 45
`Converting an Icon to a Window ........................................................................................ 46
`Maximizing a Window···········································.····························································· 47
`Raising a Window or Icon ................................................................................................... 49
`Moving a Window ............................................................................................................... 50
`Moving an Icon .................................................................................................................... 51
`Resizing a Window ................................................................................................................ 52
`Closing a Window: The Window Menu Button ................................................................. 55
`Exiting from an xterm Window .... .' ............................................................................................. 56
`Starting Additional Clients ......................................................................................................... 58
`Command-line Options ......................................................................................................... 59
`Window Geometry: Specifying Size and Location .......................................................... 59
`Running a Client on Another Machine: Specifying the Display .................................... 63
`The DISPLAY Environment Variable ................................................................................ 64
`Using -display ...................................................................................................................... 65
`Once You Run a Remote' xterm Using -display ................................................................ 66
`Logging In to a Remote System .......................................................................................... 67
`Monitoring the Load on a Remote System ........................................................................ 67
`Putting It All Together ................................................................................................................. 68
`Customizing a Program ......................................................................................................... 71
`Customizing the X Environment ........................................................................................... 72
`Where to Go from Here ............................................................................................................... 7 4
`
`Chapter 4 More About the mwm Window Manager ....................................... 77
`
`Using Special Keys ...................................................................................................................... 78
`Input Focus and the Window Manager ...................................................................................... 79
`Focusing Input on an Icon ..................................................................................................... 80
`Changing the Stacking Order with Keystrokes ................................................................... 80
`Transferring (Explicit) Focus with Keystrokes .................................................................... 81
`What To Do if mwm Dies and the Focus Is Lost ................................................................. 82
`A Quick Review of Frame Features ........................................................................................... 82
`Using the Window Menu ...................................................................................................... 83
`Invoking Window Menu Items ........................................................................................... 85
`Pointer Commands to Manage Icons .......................................... ~ ......................................... 86
`Using the Window Menu on Icons ....................................................................................... 87
`The Root Menu ............................................................................................................................ 88
`
`vi
`
`0007
`
`
`
`Chapter 5 The xterm Terminal Emulator ............................................................. 93
`Chapter 5 The xterm Terminal Emulator ........................................................... .. 93
`
`Terminal Emulation and the xterm Terminal Type .................................................................... 94
`Terminal Emulation and the xterm Terminal Type .................................................................. .. 94
`Resizing and Terminal Emulation .............................................................................................. 95
`Resizing and Terminal Emulation ............................................................................................ .. 95
`Running xterm with a Scrollbar .................................................................................................. 96
`Running xterm with a Scrollbar ................................................................................................ .. 96
`The Athena Scroll bar ............................................................................................................. 97
`The Athena Scrollbar ........................................................................................................... .. 97
`How to Use the Scrollbar ...................................................................................................... 98
`How to Use the Scrollbar .................................................................................................... .. 98
`Copying and Pasting Text Selections ....................................................................................... 100
`Copying and Pasting Text Selections ..................................................................................... .. 100
`Selecting Text to Copy ........................................................................................................ 100
`Selecting Text to Copy ...................................................................................................... .. 100
`Extending a Selection .......................................................................................................... 102
`Extending a Selection ........................................................................................................ .. 102
`Pasting Text Selections ........................................................................................................ 105
`Pasting Text Selections ...................................................................................................... .. 105
`The Text Selection Mechanism and xclipboard ...................................................................... 106
`The Text Selection Mechanism and xclipboard .................................................................... .. 106
`Saving Multiple Selections with xclipboard ..................................................................... 107
`Saving Multiple Selections with xclipboard ................................................................... .. 107
`Problems with Large Selections ....................................................................................... 111
`Problems with Large Selections ..................................................................................... .. 111
`Editing Text Saved in the xclipboard ............................................................................... 112
`Editing Text Saved in the xclipboard ............................................................................. .. 112
`The xterm Menus ....................................................................................................................... 112
`The xterm Menus ..................................................................................................................... .. 112
`The Main Options Menu ..................................................................................................... 114
`The Main Options Menu ................................................................................................... .. 114
`VT Options Menu ................................................................................................................ 117
`VT Options Menu .............................................................................................................. .. 117
`VT Fonts Menu .................................................................................................................... 119
`VT Fonts Menu .................................................................................................................. .. 119
`Tek Options Menu ............................................................................................................... 120
`Tek Options Menu ............................................................................... .{. ........................... .. 120
`
`Chapter 6 Font Specification ..................................................................................... 125
`Chapter 6 Font Specification ................................................................................... .. 125
`
`What’s New in Release 5? ................................................................................................ .. 126
`What's New in Release 5? .................................................................................................. 126
`If You Just Want to Pick a Font .......................................................................................... 127
`If You Just Want to Pick a Font ........................................................................................ .. 127
`Font Naming Conventions ........................................................................................................ 128
`Font Naming Conventions ...................................................................................................... .. 128
`Font Families ........................................................................................................................ 129
`Font Families ...................................................................................................................... .. 129
`Stroke Weight and Slant ...................................................................................................... 132
`Stroke Weight and Slant .................................................................................................... .. 132
`The Size of Bitmap and Outline Fonts ............................................................................... 133
`The Size of Bitmap and Outline Fonts ............................................................................. .. 133
`Other Information in the Font Name ................................................................................ .. 135
`Other Information in the Font Name .................................................................................. 135
`Font Name Wildcarding ............................................................................................................ 137
`Font Name Wildcarding .......................................................................................................... .. 137
`Specifying Scalable Fonts ......................................................................................................... 140
`Specifying Scalable Fonts ....................................................................................................... .. 140
`The Font Search Path ............................................................................................................... .. 140
`The Font Search Path ................................................................................................................. 140
`Modifying the Font Search Path ......................................................................................... 141
`Modifying the Font Search Path ....................................................................................... .. 141
`The fonts.dir Files .............................................................................................................. .. 143
`The fonts.dir Files ................................................................................................................ 143
`Font Name Aliasing ................................................................................................................... 144
`Font Name Aliasing ................................................................................................................. .. 144
`Making the Server Aware of Aliases ............................................................................... 146
`Making the Server Aware of Aliases ............................................................................. .. 146
`Utilities for Displaying Information about Fonts .................................................................... 146
`Utilities for Displaying Information about Fonts .................................................................. .. 146
`The Font Displayer: xfd ..................................................................................................... 146
`The Font Displayerz xfd ................................................................................................... .. 146
`Previewing and Selecting Fonts: xfontsel ......................................................................... 148
`Previewing and Selecting Fonts: xfontsel ....................................................................... .. 148
`Previewing Fonts with the xfontsel Menus ...................................................................... 149
`Previewing Fonts with the xfontsel Menus .................................................................... .. 149
`Selecting a Font Name ...................................................................................................... 152
`Selecting a Font Name .................................................................................................... .. 152
`Changing Fonts in xterm Windows .......................................................................................... 153
`Changing Fonts in xterm Windows ........................................................................................ .. 153
`The Great Escape ............................................................................................................... 153
`The Great Escape ............................................................................................................. .. 153
`The Selection Menu Item ................................................................................................ .. 154
`The Selection Menu Item .................................................................................................. 154
`Using the Font Server ................................................................................................................ 155
`Using the Font Server .............................................................................................................. .. 155
`The Font Server config File ................................................................................................ 156
`The Font Server config File .............................................................................................. .. 156
`
`vii
`
`0008
`
`
`
`Running the Font Server ..................................................................................................... 156
`Adding a Server to the Font Path ...................................................................................... 157
`Font Server Clients .............................................................................................................. 158
`
`Chapter 7 Graphics Utilities ...................................................................................... 163
`
`Overview of the bitmap Editor ................................................................................................. 164
`Menu Bar .............................................................................................................................. 164
`Editing Command Buttons .................................................................................................. 164
`Editing Area ......................................................................................................................... 165
`Image Size Versus Window Size ........................................................................................ 167
`What's New in Release 5 .......................................................................................................... 168
`bitmap Editing Commands ........................................................................................................ 169
`Pointer Commands to Draw ................................................................................................ 169
`Bitmap Command Buttons .............................................................................. : ................... 170
`Undo ................................................................................................................................... 170
`Drawing: Point, Curve, Line, Rectangle, Circle ........................................................... ~. 170
`Filling in a Shape: Flood Fill ........................................................................................... 175
`Clear, Set, and Invert .......................................................................................................... 177
`Marking an Area for Editing or Pasting ........................................................................... 178
`Copying or Moving an Area Within the Bitmap Window .............................................. 181
`Rotating or Moving with Arrow Buttons ......................................................................... 183
`Setting and Clearing a Hot Spot ....................................................................................... 185
`Using the Menus ........................................................................................................................ 185
`Dialog Boxes and Command Buttons ................................................................................ 186
`The File Menu ...................................................................................................................... 188
`Inserting a File ................................................................................................................... 190
`The Edit Menu ..................................................................................................................... 191
`Transferring Bitmap Images Using the Edit Menu ............................................................ 193
`Magnifying Portions of the Screen: xmag .............................................................................. 196
`Selecting an Area to Magnify ............................................................................................. 197
`xmag Command Buttons ..................................................................................................... 198
`Magnifying A Different Source Area: replace or new .................................................. 198
`Copying and Pasting Images: select and paste ............................................................... 199
`What xmag Shows You ..................................................................................................... 200
`Removing an xmag Window: close ................................................................................. 201
`Creating a Bitmap from a Cursor ....................................................................................... 201
`The Portable Bitmap Toolkit ............................................................................................... 204
`
`Chapter 8 Other Clients ............................................................................................... 209
`
`Redrawing the Screen: xrefresh ............................................................................................... 210
`Desk Accessories ....................................................................................................................... 210
`Clock Programs: xclock and oclock .................................................................................. 211
`Removing an xclock or oclock ......................................................................................... 214
`A Scientific Calculator: xcalc ............................................................................................ 215
`
`viii
`
`0009
`
`
`
`Terminating the Calculator ............................................................................................... 216
`Terminating the Calculator ............................................................................................. .. 216
`Mail Notification Client: xbiff ........................................................................................ .. 216
`Mail Notification Client: xbiff .......................................................................................... 216
`Monitoring System Load Average: xload ......................................................................... 217
`Monitoring System Load Average: xload ....................................................................... .. 217
`Browsing Reference Pages: xman ..................................................................................... 218
`Browsing Reference Pages: xman ................................................................................... .. 218
`The xedit Text Editor ........................................................................................................... 222
`The xedit Text Editor ......................................................................................................... .. 222
`Printing Utilities: xwd, xpr, xdpr ............................................................................................. 229
`Printing Utilities: xwd, xpr, xdpr ........................................................................................... .. 229
`Killing a Client Window with xkill .......................................................................................... 231
`Killing a Client Window with xkill ........................................................................................ .. 231
`Problems with Killing a Client ........................................................................................... 232
`Problems with Killing a Client ..............................
`......................................................... .. 232
`Window and Display Information Clients ............................................................................... 233
`Window and Display Information Clients ............................................................................. .. 233
`Displaying Information About a Window: xwininfo ....................................................... 233
`Displaying Information About a Window: xwininfo ..................................................... .. 233
`Examining the Window Hierarchy ................................................................................... 236
`Examining the Window Hierarchy ................................................................................. .. 236
`Listing the Currently Running Clients: xlsclients ............................................................ 239
`Listing the Currently Running Clients: xlsclients .......................................................... .. 239
`Generating Information About the Display: xdpyinfo ..................................................... 240
`Generating Information About the Display: xdpyinfo ................................................... .. 240
`User-contributed Clients ........................................................................................................