X Window System Libraries Reference Manual
Total Page:16
File Type:pdf, Size:1020Kb
The Mjølner BETA System X Window System Libraries Reference Manual Mjølner Informatics Report MIA 91-16(1.2) August 1994 Copyright © 1991-94 Mjølner Informatics ApS. All rights reserved. No part of this document may be copied or distributed without the prior written permission of Mjølner Informatics The X Window System is a trademark of MIT. UNIX is a registered trademark of AT&T. OPEN LOOK is a trademark of AT&T. OSF/MOTIF is a trademark of Open Software Foundation, Inc. Parts of this report are based on X Toolkit Intrinsic-C language Interface, by Joel McCormack, Paul Asente, and Ralph Swich, and X Toolkit Athene Widgets-C Language Interface, by Ralph Swich and Terry Weissman, both of which are copyrighted © 1985 - 1989 the Massachusetts Institute of Technology, Cambridge, 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 condi- tions: Permission to use, copy, modify and distribute this documentation (i.e. the original MIT and DEC 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 supporting documentation, and that the name of M.I.T. or Digital not be used in in advertising or publicity pertaining to distribution of the software without specific, written prior permission. M.I.T and Digital makes no representations about the suitability of the software described herein for any purpose. It is provided ``as is'' without express or implied warranty. Table of Contents 1 Introduction .................................................................................................................1 1.1 What is Xt?......................................................................................................1 1.2 The BETA interface to Xt et. al. .....................................................................2 1.3 Demo programs...............................................................................................2 1.4 Environment Variables ...................................................................................3 2 XtEnv...........................................................................................................................4 2.1 Using the XtEnv fragment ..............................................................................5 2.2 Basic XtEnv widget patterns...........................................................................5 2.2.1 Core ...................................................................................................5 2.2.2 Composite..........................................................................................7 2.2.3 Constraint ..........................................................................................7 2.2.4 Shell...................................................................................................8 2.2.5 WMShell ...........................................................................................8 2.2.6 ToplevelShell.....................................................................................8 2.2.7 TransientShell....................................................................................8 2.2.8 OverrideShell.....................................................................................8 2.2.9 VendorShell.......................................................................................8 2.3 Other XtEnv Objects and Patterns ..................................................................8 2.3.1 Toplevel.............................................................................................8 2.3.2 Display...............................................................................................9 2.3.3 Timer .................................................................................................9 2.3.4 WorkProc...........................................................................................9 2.3.5 TranslationTable................................................................................9 2.3.6 Accelerator Table ..............................................................................9 2.3.7 RegisteredAction ...............................................................................9 2.3.8 StringArray........................................................................................9 2.3.9 FallbackResources.............................................................................9 2.3.10 Options ..............................................................................................9 2.3.11 ErrorHandler......................................................................................9 2.3.12 WarningHandler ..............................................................................10 2.4 Examples using Xt widgets...........................................................................10 2.5 XtEnv Interface Description .........................................................................13 2.5.1 XtEnv Interface ...............................................................................13 2.5.2 Events Interface...............................................................................34 2.5.3 XSystemEnv Interface.....................................................................46 3 AwEnv.......................................................................................................................48 3.1 What is the Athena Widget set?....................................................................48 3.2 Using the AwEnv fragment...........................................................................48 3.3 Overview of AwEnv Widget Patterns...........................................................49 3.4 Simple Athena Patterns.................................................................................50 3.4.1 Simple..............................................................................................50 3.4.2 Label................................................................................................50 3.4.3 Command ........................................................................................50 3.4.4 ListWidget .......................................................................................51 3.4.5 StripChart ........................................................................................51 3.4.6 Toggle..............................................................................................51 3.4.7 Grip..................................................................................................51 3.4.8 Scrollbar ..........................................................................................51 3.5 Examples using simple Athena Widgets.......................................................52 i ii X Window System Libraries 3.5.1 Using Label .....................................................................................52 3.5.2 Using ListWidget ............................................................................52 3.5.3 Using Command .............................................................................53 3.5.4 Using StripChart .............................................................................54 3.5.5 Using Toggle...................................................................................55 3.5.6 Using ScrollBar...............................................................................56 3.6 Composite Athena Widgets ..........................................................................57 3.6.1 Box..................................................................................................58 3.6.2 Form ................................................................................................58 3.6.3 Dialog..............................................................................................59 3.6.4 Paned...............................................................................................59 3.6.5 ViewPort .........................................................................................60 3.7 Using composite Athena Widgets ................................................................60 3.7.1 Using Form .....................................................................................60 3.8 Cursors, Fonts and PixelMaps ......................................................................61 3.9 Menus ...........................................................................................................62 3.9.1 SimpleMenu ....................................................................................63 3.9.2 MenuButton ....................................................................................64 3.9.3 Sme..................................................................................................64 3.9.4 SmeBSB..........................................................................................64 3.9.5 SmeLine ..........................................................................................64 3.9.6 SmeCascade ....................................................................................64 3.10 Examples of using Menus.............................................................................64 3.10.1 A SimpleMenu example..................................................................64 3.10.2 Using cascading menus...................................................................66