Wa fe{
A Tcl Interface to the X Toolkit or A Graphical Frontend for Applications in Various Programming Languages Version: 1.0.15 Gustaf Neumann, Stefan Nusser
[email protected],
[email protected] Wirtschaftsiuniversitat Wien Abteilung fur Wirtschaftsinformatik Augasse 2{6 A-1090 Vienna May 26, 1996 Abstract
Wa fe provides a exible and easy to use interface to the X Toolkit Release 4, 5 or 6 (Xt), the Athena widget set (Xaw) and (incomplete) to the OSF/Motif widget set Versions 1.1.x, 1.2.x or 2.0 (Xm). Wa fe is implemented using the embeddable command language Tcl. Wa fe allows access to Xt's functionality from all compiler and interpreter languages, provided that they can communicate unbuered over stdout and stdin. Furthermore, Wa fe can be used with Tcl scripts for easily creating new X Window Applications or user interfaces to existing Unix commands.
1
Contents 1 Introduction
1.1 Using Wa fe as a Frontend
1.2 Command Line Arguments
4 : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
2 Wa fe's Prede ned Variables
6 7
9
3 Widget Names and Widget References
10
4 Wa fe Commands
12
4.1 Widget Creating Commands 4.2 Basic Toolkit Commands 4.2.1 Setting and Retrieving Resource Values 4.2.2 Resource Management over Resource Database 4.2.3 Obtaining Type and Class Information, Testing for Existance 4.2.4 Managing, Mapping, Realizing and Destroying Widgets 4.2.5 Popup and Popdown Commands 4.2.6 Modifying Sensitivity 4.2.7 Raising and Lowering 4.2.8 Translating Coordinates and Obtaining Sizes 4.2.9 Locating Files 4.2.10 Terminating Wa fe 4.3 Callbacks and Actions 4.4 Widget speci c commands 4.4.1 Scrollbar 4.4.2 StripChart 4.4.3 List 4.4.4 Text 4.4.5 Tree 4.4.6 Form 4.4.7 Paned
: : : : : : : : : : : : : : : : : : : :
: : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
: : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
: : : : : : : : : : : : : :
: : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
: : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
: : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
: : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
: : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
2
12 14 14 14
16 17 18 19 19 20 21 21 21 27 27 28 28 31 35 36 36
4.4.8 Toggle 4.4.9 SimpleMenu 4.5 Communication, Handlers and Events 4.5.1 The echo command 4.5.2 Handlers 4.5.3 The additional communication channel 4.5.4 Suspending/delaying Execution in Wa fe, Event Processing 4.5.5 Communicating from an Application Program to Wa fe 4.6 The selection mechanism 4.7 Integration of the XPM image format : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
: : : : : : : : : : : : : : : : : : : : : : : : : :
: : : : : : : : : : : : : : :
: : : : : : : : : : : : : : : : : : : : : :
: : : : : : : : : : : : : : : : : : : : : : : : : : : :
: : : : : : : : : : :
: :
: : : : : : : : : : : : : : : : : : : : : : :
: : : : : : : : : : : : : : :
A Short Reference
A.1 X Tookit Widgets and Commands A.2 Xpm Library for multicolored images A.3 Athena Widgets and Commands A.4 Athena R5 Widgets and Commands A.5 Motif Revision 1.1 Widgets and Commands A.6 Motif Revision 1.2 Widgets and Commands A.7 Motif Revision 2.0 Widgets and Commands A.8 XmGraph Extension to Motif Widgets A.9 Plotter Widget and Commands A.10 HyperText (HTML) Widget and Commands A.11 Motif Tree Widget A.12 Xbae Widget and Commands A.13 Ghostview Widget and Commands A.14 Xew (EuroBridge) Widget Set and Commands A.15 Clock widget class A.16 Drag and Drop Commands A.17 Miscelaneous Additional Commands
49
: : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
: : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
: : : : : : : : : : : : : : :
: : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
: : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
: : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
3
37 37 38 38 38 41 42 43 44 47 49 67 68 79 80 97 99 101 103 107 111 111 122 123 124 125 125
1 Introduction Wa fe stands for widget (Athena) front end and provides an interface to the X Toolkit. The name Wa fe is a historical leftover and not fully appropriate since Wa fe supports not only the Athena Widgets but also the Plotter Widget Set1
and the OSF/Motif widget set. The OSF/Motif support in the current release is not complete, but should be sucient for most needs2 . In addition Wa fe supports
the Layout3 widget (for arranging widgets with TEX-like semantics using
boxes and glue) the XmGraph4 widget (for OSF/Motif version only, for arbitrary, directed or undirected graphs), Mosaic's Hypertext widget5 (based on WWW's html format), which can be used under Athena and OSF/Motif the Ghostview6 widget for displaying postscipt les; The Ghostview widget can be used together with the OSF/Motif and Athena widget sets). the Motif Tree Widget7 (requires Motif, as the name indicates) the Xbae Widgets8 (require Motif); the Xbae Widgets contain a widget for labeling purposes (XbaeCaption) and a spreadsheet like XbaeMatrix widget. the Xew (EuroBridge) Widgets9; the Xew Widgets are desinged for Multimedia Applications and contain support for Images, Videos, Audio and a muti-national Text widgets that supports embedding of the other widgets of this set.
The commands of the Plotter widget set supported by Wa fe are listed in section A.9 on page 103. 2 The commands of the OSF/Motif widget set supported by W fe are listed in sections A.5, a A.6 and A.7. 3 A paper describing the Layout widget class is available from the wafe home server as well as from other sites 4 The commands of the XmGraph widget supported by W fe are listed in section A.8 on a page 101. 5 The commands of the HTML widget supported by W f e are listed in section A.10 on page a 107. 6 The commands of the Ghostview widget supported by W f e are listed in section A.13 on a page 122. 7 The commands of the Motif Tree widget supported by W fe are listed in section A.11 on a page 111. 8 The commands of the Xbae widgets supported by W f e are listed in section A.12 on page a 111. 9 The commands of the Xew widgets supported by W fe are listed in section A.14 on page a 123. 1
4
the Clock Widget10; This separate version of th clock widget class is a
strict superset of the original code from Xaw3d of X11R5. It allows the widget to be used in Motif applications as well and can be used with Xaw of Xaw3d from X11R6 or newer. Several resources have been added to support setting of time osets, better handling of background pixmaps etc.
Furthermore Wa fe supports additional widespread packages such as XPM11 or RDD (Drag and Drop library for drag and drop between multiple applications12). Wa fe was also built and tested with various object oriented extensions of Tcl such as itcl (version 1.5) and OTcl (version 0.94). A sample script using OSF/Motif, the ghostview widget and OTcl is included in the Wa fe distribution. Wa fe can be used as a stand alone prototyping environment for X Toolkit applications (interactive or using scripts) or as a frontend to applications programs in various programming languages to provide a graphical user interface without facing the need to enhance the application languages with X Window and X Toolkit bindings. In addition Wa fe can be used from the C language it the Wa fe-environment is linked together with another application program replacing the standard Wa fe shell. The basic idea of the frontend approach is to start an application in two separate processes: one process is dealing purely with application matters, the other one is responsible for the user interface. The two processes communicate using sockets. The application process writes to stdout, its output is parsed and interpreted by the frontend. This way the application process sends send commands or procedures to the frontend process, which builds up the graphical user interface and handles the incoming events. The purpose of this manual is mostly to provide an overview of the commands available in the Wa fe environment. A deeper discussion of the design overview of Wa fe can be found in [4]. A more technical reference of the Widget sets and commands can be found in [5, 1, 3, 7]. For more details about the embeddable command language Tcl refer to [6]. The following section describes how to use Wa fe as a frontend and the the command line arguments of Wa fe. Section 4 describes the most important Wa fe commands (X Toolkit speci c commands, Athena Widget speci c commands, XPM [2] speci c commands). The Short Reference in appendix A on page 49 was generated automatically from the Wa fe sources and provides the complete set 10 The commands of the Clock widget supported by W f e are listed in section A.15 on page a 124. 11 The commands of Xpm library for colored icons and pictures supported by W fe are listed a in section A.2 on page 67. 12 The commands of the drag and drop library supported by W f e are listed in section A.16 a on page 125.
5
of Wa fe commands and the names of the X Toolkit or OSF/Motif counterparts. The Short Reference is a complete assembly of all Wa fe commands.
1.1 Using Wa fe as a Frontend
The way Wa fe communicates with the application process is controlled by various command line arguments. If none of the options --d, --e, --f or --v is speci ed, the application program will be started as a subprocess of Wa fe. If the Wa fe application is called myprog and a link from Wa fe to the name xmyprog is made, executing xmyprog starts Wa fe with myprog as a subprocess. ln -s /bin/X11/wafe xmyprog xmyprog
If the local Unix variant does not support symbolic links, a hard link may be used instead of the symbolic link in the example above. Wa fe searches all directories in the path in order to spawn the child-process myprog (the name is simply derived by removing the leading character "x"). Alternatively the name of the application program can be speci ed using the --p command line option. wafe --p myprog
The application myprog looses it's standard input and output streams, diagnostic output will be merged with Wa fe's stderr. Wa fe communicates with the application by reading it's stdout and writing to the stdin stream. Commands to Wa fe must be pre xed by a so called prompt character, defaulting to "%", otherwise they are just echoed to Wa fe's standard output. The prompt character can be changed with the --c command line option. Furthermore, if you want Wa fe to accept commands without prompt character, use the --n command line option (This means that the application completely looses its output stream). The application class is derivated from the link's name by capitalizing the "x" and the rst letter of the executable; any dots will be substituted by dashes. This is the name, under which X searches the application's defaults le. So, in our example, the class is XMyprog and the corresponding app-defaults le will be searched. The application instance name is the link's name with dots substituted by dashes. Command line arguments can be passed to the client with one restriction: They mustn't begin with the characters "--", since this is reserved for Wa fe's arguments. Thus the command line xmyprog filename --n
6
will cause Wa fe to spawn the process myprog with the argument lename. The "--n" is one of Wa fe's command line arguments, which are described in the next section.
1.2 Command Line Arguments The following command line options change the behavior of Wa fe's communication mechanism:
--cc This option simply allows the user to specify the prompt character which
is not used if --n is speci ed. It defaults to "%". --d Enter direct mode; this is a special mode, which is particulary useful for debugging or testing purposes. Wa fe can be used like a shell in this mode: wafe --d --n
Commands are now read from stdin, output is sent to stdout. Additionally, the option --n is recommended so that it is unnecessary to pre x every command with the prompt character. If Wa fe is called without any mode changing parameters or links, it will default to this interactive mode. --e Takes the next argument to be a valid Wa fe command string and executes it. Note that Wa fe doesn't terminate automatically in this mode. --f Run in le mode. The next argument after specifying --f must be the name of a le containing valid Tcl commands. The le will be executed by the Tcl source command. --i Switches to input mode, which means that Wa fe reads from stdin (which it normally doesn't) and forwards the commands to the client-application. Be aware that programs using input-mode can't be executed in the background! --n Turn of the prompt character mechanism. This causes Wa fe to regard every message it receives from the application as a Wa fe command. --p Specify name of client program explicitly. The next argument after -p must be the name of the program to be executed as client program. This option can be used alternatively to the standard link mechanism described above where the leading \x" is stripped to derive the client program's name. 7
--v Displays the current version of Wa fe and exits immediately. --CapplicationClassName If this option is speci ed Wa fe will use the provided string as Xt application class.
--Doption
Starts Wa fe in debug mode and passes the speci ed option to the debug library. The following example activates debugging and tracing (provided, wafe was compiled with the DBUG support enabled). wafe --Dd:t
The full set of debugging and pro ling options can be found in the documentation of the debug library.
--SsocketString
This command line option can be used to communicate to Wa fe (running typically as a subprocess of the application program) via sockets. Beginners my skip this point. socketString can be of the form 1.socketName Example: --S/tmp/wafe.1052-1 2.portNumber Example: --S8853 3.hostname:portNumber Example: --Smohegan:8853 If the --S option is used, Wa fe establishes during its initialization a socket communication determined by the socketString and connects its standard input and output to the created socket. 1.If socketString is of the form socketName, rst the application program is responsible to create a unique socket name. Then it calls Wa fe with the --S option, passing the socket name to Wa fe_Wa fe creates the speci ed unix domain socket (like a server) and waits, until the client application program connects. Wa fe will remove the named socket on exit. 2.If socketString is of the form portNumber, Wa fe binds the speci ed port (like a server) and waits for the application program to connect on it. Note, that the speci ed port is blocked on the host for the whole Wa fe session. 3.If socketString is of the form hostName:portNumber, a simple two phase communication protocol is used to establish the connection. 8
(a)In the rst phase the application program on host hostName binds the speci ed port number (like a server), spawns Wa fe (for example using remote shell) with the option:
--ShostName:portNumber Wa fe will connect to the speci ed host and port. (b)In the second phase Wa fe will obtain a new unique port number,
and establish itself as a sever listening on the new port. The Wafe will send the new obtained port number as a ASCII string to the application program over the primary socket. The application program reads the new port number form the primary socket and will connect to Wa fe on the new port number and release the original port number such that another Wafe process can use portNumber as well. A sample implementation of an application program exploiting all three types of socket connections is provided in:
wafe/apps/lang/sock.pl
--TcommunicationChannels
This option can be used to specify the le numbers of extra communication channel as a pair wafeSide/clientSide. See wafe/apps/util/wafe.pl for an example usage.
2
Wa fe's Prede ned Variables
During initialization Wa fe will set the Tcl variables ARGC , ARGV and env to the corresponding contents. ARGV is C's argument vector in form of a Tcl list, ARGC is its length. Starting with Version 0.96 Wa fe supports like tclsh argc , argv and argv0 . argv0 is the program (or script) name, argv is the argument list, argc is the length of argv . The older ARGC and ARGV will be dropped in future versions. The variable Argv0 holds the Xt application Class name. The variable tcl interactive indicates whether Wa fe is running in interactive mode or not (i.e. not in frontend mode, not as a script; commands are accepted from a terminal). The variable XVERSION is set to R4 or R5, depending under which version of X Wa fe was compiled. The variable WAFEVERSION keeps the version number of Wa fe. PACKAGES is a list of packages compiled into Wa fe. PID is the process id of current process (similar to [pid] in tcl7.3). CHILDPID is the process id of forked application program running as a coprocess of Wafe (or 0). The variable WAFELIB points to the location of the Wa fe library (usually /usr/lib/X11/wafe). 9
The Tcl variable FILESEARCHPATH is used locate bitmaps or pixmap les for StringToBitmap or StringToPixmap converter (and for bitmaps/pixmaps/ gif les in HTML documents, when compiled with Hypertext support). For example: set FILESEARCHPATH /usr/lib/X11/twm/%N:/usr/include/X11/%T/%N Command c topLevel bitmap ghostview.xpm realize
In this example the le 'ghostview.xpm' will be searched rst in /usr/lib/X11/twm and then in /usr/include/X11/bitmaps. If wafe/mofe is compiled without XPM support, only .xbm les will be converted. Wafe provides a reasonable default value for FILESEARCHPATH. If the environment variable XFILESEARCHPATH is set, its value will be used instead of the default. For a full documentation of the percent codes in the FILESEARCHPATH see XtResolvePathname in \X Toolkit Intrinsics Reference Manual"[1]. The global Tcl variable COLORCLOSENSS de nes the tolerance value during color conversions. If the colormap of the used display is full, another close color (that is already in the colormap) is tried. The default value is 40000, smaller values de ne less tolerance, larger values (up to 65535) increase the tolerance (colors diering substantially are accepted as well).
3 Widget Names and Widget References Developing an user interface with Xt means creating instances of widgets from a prede ned widget set and arrange and con gure these according to application speci c needs. Wafe supports the Athena widget set, the OSF/Motif widget set, and several additional widgets or widget sets (eg: Mosaic's HTML widget for hypertext applications (can be used together with the Athena or OSF/Motif widget set), the plotter widget set (linegraphs and bargraphs for Athena or OSF/Motif (see section A.9), the XmGraph widget (for arbitrary graph structures; OSF/Motif only). The created widgets can be composite or non-composite, whereas composite widgets are commonly used for geometry management (de ning the graphical layout of an application). A composite widget and all its children is commonly refered to as widget tree. When an instance of a widget is created, the widget class de nes its attributes (resources) and its methods (mostly callbacks and actions plus frequently additional procedures called the programmatic interface in Xt terms). 10
In Wa fe the creation of a widget is achieved through widget creating commands (see section 4.1). When a widget is created the user provides a name and speci es a parent widget to determine the position of new created widget in the widget trees of the applicaton. So called application shells are the roots of the widget trees and do not have parent widgets. In general the names which are provided at widget creation time do not have to be unique, but in many circumstances it is more conveniant if they are. There are many situations where a user might want to refer at a later time to a created widget:
to change attributes of a widget, to specify the position of a widget relative to another widget, to apply procedures of its progammatic interface, to delete a widget, and so on.
In order to refer to a widget, a widget reference is needed. The simplest widget reference it the widget name (the name provided at widget creation). However, since this name might be ambiguous, wafe provides the following types of widget references:
widget names widget paths widget IDs anchored widget paths
A widget path starts with a widget name or the character \*", followed by a widget name, followed optionally by \*" or \." and widget-name, where the optional part can be repeated several times. Each time a widget is created, a unique widget ID is returend, which can be used as wiget reference as well. Finally a anchored widget path can be used to refer to a widget with a speci ed name under a widget denoted by its widget ID: A anchored widget path starts with an widget ID followed by \*" or \." and a widget name where the part after the widget id can be repeated several times. Later in this text the term widget is commonly used instead of widget reference in argument descriptions.
11
4
Wa fe Commands
In addition to the standard Tcl commands, Wa fe makes several new commands available for the client. Please note that according to the very nature of the Tcl language and Wa fe's stream oriented communication mechanism, every argument's type has to be string. Widgets, for example, are always referenced by their names and conversions are done as necessary. For the description of the new commands, the following conventions will be kept: expression + means one or more occurrences of expression expression means zero or more occurrences of expression expression ? means one or zero occurrences of expression To apply these rules on several arguments, angle brackets h i are used. Terminal symbols are written in sans-serif and nonterminals in italic font style. Informal descriptions are typeset in the normal text font style. Commands, which are dierent from their Xt counterparts are described in detail, those which are added to Wa fe without changes only have a short and informal description; it is assumed that the user refers to the Xt programming and reference manuals for a detailed description [5, 1].
4.1 Widget Creating Commands The widget creating all have the following structure: widgetClass widgetName parentWidget unmanaged? hattribute valuei widgetClass ?! athensWidgetClass j motifWidgetClass j others widgetName ?! string name of instance parentWidget ?! widget reference to previously created parent widget j topLevel attribute ?! attribute of this widgetclass, please refer to a
documentation of the widget set (eg. [1] or [7] for a complete list of valid attributes). The Wa fe command showRes can be used to display the names and types of attributes for a created widget instance interactively value ?! type, corresponding to the chosen attribute The names of the available widget classes depend on the compile options of Wa fe. Below, only the names of the Athena widget classes are listed (mostly for historical reasons). 12
athenaWidgetClass ?! shell j simple j menu j text j composite j constraint motifWidgetClass ?! if Wa fe is compiled with OSF/Motif support, all its others
shell simple menu text composite constraint
widgets are supported. Please refer to sections A.5, A.6 and A.7 ?! depending on the compile options of Wa fe the plotter widget set (refer to section A.9), the XmGraph widget (refer to section A.8) and the HTML widget (refer to section A.10) might be supported
?! OverrideShell j TransientShell j TopLevelShell ?! Command j Grip j Label j List j Logo j Mailbox j Panner j Repeater j Scrollbar j Simple j StripChart j Toggle
?! SimpleMenu j Sme j SmeBSB j SmeLine j MenuButton ?! Text ?! Box j Porthole ?! Dialog j Form j Paned j Tree j Viewport
The de ned constant topLevel, is used to reference the application's top level widget, which is created automatically at startup.. For a list of possible attribute/value pairs and detailed information about a widget's functionality compare to [1] or [7]. If desired, a widget can be created without being managed by the parent by stating unmanaged after the parent's name. This can be advantageous if many widgets are created as children from the same parent or for dialog shells of the OSF/Motif widget set. They can be managed all together after the creation by using the manageChild command. For a full list of all widget classes supported by Wa fe see the short reference guide in appendix A on page 49. Starting with version 0.96 attribute value pairs can be speci ed as either as a Tcl list, or as separate arguments (like in earlier versions). Note that the following command is the only exception from this general structure of the widget creation commands. ApplicationShell widget display hattribute valuei display ?! string name of display
Use this command to create a new application shell widget on the speci ed display, which will be the top of a new widget tree. Note that this shell 13
widget can be iconi ed separately and is subject to the window manager's client decorations.
4.2 Basic Toolkit Commands This section describes Xt speci c commands. Most of these commands correspond to commands described in the \X Toolkit Intrinsics Reference Manual"[1], where the leading Xt or Xaw pre x was removed. The Wa fe developer might wish to consult the *Gen les in the src directory of the Wa fe distribution which are used as input to the C generator.
4.2.1 Setting and Retrieving Resource Values setValues widget hattribute valuei+ sV widget hattribute valuei+
Changes one or more attribute-value pairs of the speci ed widget. Conversion is done to the corresponding argument type. Note that some attributes, which have no string representations, can't be set by this command (eg the colormap attribute). This sort of attributes are either speci ed in [1] or have to be found out by trial and error. Wa fe allows the callback resource to be set to a Tcl command. Starting with version 0.96 resource value pairs can be speci ed as either as a Tcl list, or as separate arguments (like in earlier versions). value getValue widget attribute value gV widget attribute value ?! string, actual data type depending on queried
attribute
The counterpart of setValues is getValue, which allows a speci ed attribute to be queried. Note that Wa fe tries to convert the result to the best possible string representation suitable for Tcl; some attributes cannot be converted into a string.
4.2.2 Resource Management over Resource Database 14
mergeResources widget hresName valuei+ widget ?! widget to determine resource database resName ?! binding?hbinding componenti binding ?! "." j "*" component ?! "A"-"Z" j "a"-"z" j "0"-"9" j " " j "-"
This command can be used to write one or more resource speci cations into the resource database. It is useful to specify common resources of several widgets at the beginning of the application. Note that with mergeResources you can specify class names as well as instance names since the same syntax as in an application defaults le is used. Therefore the resource speci cation can, in contrast to the setValues command, be applied to several widgets in the application. Starting with version 0.96 resource value pairs can be speci ed as either as a Tcl list, or as separate arguments (like in earlier versions). fallbackResources widget hresName valuei+ widget ?! widget to determine resource database resName ?! binding?hbinding componenti binding ?! "." j "*" component ?! "A"-"Z" j "a"-"z" j "0"-"9" j " " j "-"
This command behaves like mergeResources exept in cases, where a matching ressource entry is already available in the resource database, the provided value in fallbackResources is ignored. FallbackResources have the lowest priority and can be used conveniantely together with resource les, which have an higher priority. They should be used to provide default resources. The command fallbackResources requires X11R5 or newer. combineFileDatabase lename widget override lename ?! le name of a resource le widget ?! widget to determine resource database override ?! true or false combineFileDatabase is similar to mergeResources or fallbackResources except that the resources are loaded form the speci ed le. If the override has the value false the resource le is used only for fallback resource, otherwise values in the resource database may be rede ned.
15
string getApplicationResource baseWidget resourceName resourceClass baseWidget ?! widget reference resourceName ?! user provided name of additional resource resourceClass ?! user provided class name of additional resource
This command can be used to obtain values from the Xt's resource database. The provided resourceName and resourceClass can be arbitrary, application speci c strings and must not interfere with the widget's resources provided by the toolkit. On success the return value is the resource value, on failure, an empty string is returned. Example: the following resources are used for myApp myApp*printCmd: mp | lpr -pPs
The application myApp issuses the following command: set cmd [getApplicationResource topLevel \ specificPrintCmd printCmd]
to obtain the value for printCmd.
4.2.3 Obtaining Type and Class Information, Testing for Existance string getClass widget
This function returns the class of a widget in form of a string. string getTypeOfAttribute widget attribute
Use this function to determine the type of the given attribute in the widgetclass of widget . If the widgetclass does not have an attribute with the given name, an empty string is returned. int isWidget widget
This function returns 0 if no widget with the given name (widget path) exists currently, otherwise non-zero. 16
Booelan isShell widget
This function tests whether the speci ed widget is of the shell widget class. widgetID nameToWidget widget widgetPath
The function nameToWidget returns the widget-ID of a widget with the name widgetPath speci ed in the 2nd argument in the widget tree under the speci ed widget (1st argument). If no such widget exists the command returns 0. string parent widget
This function returns the widget-ID of the parent widget of the speci ed widget. windowID window widget
returns the window id of the speci ed widget.
4.2.4 Managing, Mapping, Realizing and Destroying Widgets mapWidget widget+
This function maps all speci ed widgets to the associated display. unmapWidget widget
This command takes any number of widgets as arguments and unmaps them. manageChild widget
This command takes any number of widgets as arguments and brings them under parental management. This is only necessary, when the widget creating commands are used with the unmanaged argument, or the widget has been set explicitely to unmanaged. All widgets speci ed in the argument list have to have the same parent widget. 17
unmanageChild widget
This command takes any number of widgets as arguments and removes them from parental management. All widgets speci ed in the argument list have to have the same parent widget. realize
This command realizes all top level application shells. The application's main shell with the name topLevel is created automatically. realizeWidget widget+
This function realizes all speci ed widgets. This command should only be used in cases where it is necessary to realize widgets separately. unrealizeWidget widget
This command takes any number of widgets as arguments and unrealizes them. destroyWidget widget+
This command takes any number of widget references as arguments, destroys them completely and releases all allocated resources.
4.2.5 Popup and Popdown Commands popup popupShell grab grab ?! none j exclusive j nonexclusive
This command pops up an existing TransientShell or OverrideShell). The kind of grab used is speci ed with grab , which is the way how user events are constrained to the popup shell or its children. It can be one of the constants none, nonexclusive or exclusive.
18
popupSpringLoaded popupShell
This command displays the speci ed and previously created shell widget as a spring-loaded popup, which means that it is invisible to the window manager and disables user input to all windows except to the popup itself. popdown popupShell
The command popdown can be used to pop down a previously created and mapped popup shell. widgetList popupChildren widget
This command is similar to [gV Widget children] of a composite widget, but it returns the list of popup Shells (eg.: TransientShells) which are created as children of the given widget. Popup shells are not required to be children of composite widgets. If a widget has no popup children an empty list is returned.
4.2.6 Modifying Sensitivity setSensitive widget state
The command setSensitive sets a widget and its children sensitive or insensitive depending on the boolean state argument (for details see XtSetSensitive in \X Toolkit Intrinsics Reference Manual"[1]). setBusy widget state
The command setBusy sets a given widget (typically a shell widget) and its children busy or not depending on the boolean state argument. If a widget is set busy a busy-cursor is set and input is inhibited for all children widgets. The appearance of the children widgets will not change. If a shell is set busy and set non-busy some time later, all the sensitivity states before the setBusy command are reestablished.
4.2.7 Raising and Lowering 19
lowerWindow widget
The command lowerWindow lowers the window of the speci ed Widget in the stacking hierarchie of the window manager. For example lowerWindow topLevel raises the topLevel shell. The speci ed widget must be realized. raiseWindow widget
The command raiseWindow raises the window of the speci ed Widget . For example raiseWindow topLevel raises the topLevel shell. The speci ed widget must be realized.
4.2.8 Translating Coordinates and Obtaining Sizes translateCoords widget x y outX outY
This command translates x and y coordinates in the given widget into root window coordinates. After the execution the Tcl variables outX and outY are bound with the resulting values. int widthOfScreen widget
This function returns the width of the screen on which the speci ed widget is displayed in pixels. int heightOfScreen widget
This function returns the height of the screen on which the speci ed widget is displayed in pixels. int textWidth widget fontResource string
The function textWidth returns width of given string in pixels using font from the fontResource of the speci ed widget . This routine is necessary, as long we have no font to string converter. 20
int fontHeight widget fontResource
returns the height of a font in pixels. The font is taken is taken from the given fontResource of the given widget.
4.2.9 Locating Files string resolvePathname widget type lename sux path
This function returns the fully quali ed lename of a readable le with name lename and the speci ed sux on the given path. type is either empty or the kind of le (eg. bitmap or help) and can be referred to via percent codes in the path argument. See XtResolvePathname in the \X Toolkit Intrinsics Reference Manual"[1] for detailed information. If no matching le can be located at the given path, an empty string is returned.
4.2.10 Terminating Wa fe quit
To terminate Wa fe use quit. To ensure that the spawned application process will also terminate, Wa fe sends it the SIGTERM signal. This { of course { won't happen in le mode or direct mode. When a Tcl procedure with the name onExit is de ned by an application (without arguments), this routine will be executed whenever Wa fe exits.
4.3 Callbacks and Actions The X-toolkit provides two mechanisms to link widgets to application code: One of them are callbacks, easy to use for prede ned purposes, the other actions, which are more exible and con gurable but involve a more complicated handling. This section describes how these features are implemented in Wa fe, if your are not familiar with the basic concepts of callbacks and actions please refer to the Xt Programming Manual [5]. Callbacks which should be executed when certain widget speci c conditions occur (such as clicking with pointer button 1 in an Athena Command widget) can be speci ed directly as resources during widget creation or the sV command. 21
The content of the callback resources is a Tcl command which should be executed. The content of a callback resource can be retrieved using gV. When a callback is activated, printf-like % substitutions are performed in a rst step. In this way Wa fe provides the functionality of Xt 's call Data mechanism). The table below shows the %-codes for the Athena widget. Please refer to the short reference (in appendix A on page 49) for a complete summary of the %-codes. Widgets
all all List List Scrollbar Scrollbar
Callback
all all callback callback scrollProc jumpProc
Code Description
%w %W %i %s %p %p
name of widget widget ID index active element position percent
Type
string int int string int
oat
Please note that although dierent types are mentioned in the table, all of these codes will be substituted by a string. The resulting command string will be interpreted using Tcl eval. To avoid unexpected side eects due to the substitution, characters like backslash, dollar or square brackets, which have special meanings in Tcl are escaped in %s substitutions using a backslash. %s should be used inside double quoted strings. callback widget callbackResource type arg callbackResource ?! valid callback attribute of the speci ed widget type ?! none j exclusive j nonexclusive j popdown j position j positionCursor arg ?! additional arguments depending on type
This command sets the callback resource of the named widget to one of Wafe's prede ned Toolkit function. For valid types refer to the following table. Note that the execution of a Wa fe command can be registered with the callback resource of a widget with the setValues command. Type none exclusive nonexclusive popdown position positionCursor
Description
realize a popup-shell, grab-type none realize a popup-shell, grab-type exclusive realize a popup-shell, grab-type nonexclusive unrealize a popup-shell position a popup-shell relative to its parent position a popup-shell under the cursor
According to the type used, callback takes the following additional arguments. 22
Callback Types: none, exclusive, nonexclusive callback widget callbackResource none popupShell or callback widget callbackResource exclusive popupShell or callback widget callbackResource nonexclusive popupShell
These callbacks all take one additional argument: shell, specifying a popup-shell widget which will be realized with grab-type speci ed as none, exclusive or nonexclusive. Furthermore this callback will set the widget widget insensitive.
Callback Type: popdown callback widget callbackResource popdown popupShell enableWidget enableWidget ?! name of a widget to be enabled after popdown
This command registers a popdown callback for the speci ed widget. When the speci ed shell is popped down the widget enableWidget will be set sensitive.
Callback Type: position callback widget callbackResource position baseWidget:oset basis ?! string name of a widget
This command registers for the speci ed shell widget a popup callback that places the shell relative to another widget baseWidget and the speci ed oset. The full syntax of the last parameter is widgetname:xoset/yoset. If yoset (and the slash) is omitted, yoset is set to the value of xoset. If xoset is also omitted (no colon) xoset and yoset are set to the default value of 50. For example the command callback d1 popupCallback position mainWindow:10/20
registers a callback for a Dialog shell named d1 that will position this shell with the xoset 10 and the yoset 20 from the widget (of the same application) named mainWindow.
Callback Type: positionCursor 23
callback widget callbackResource positionCursor relPos
This command registers for the speci ed shell widget a popup callback that places the shell relative to the current cursor with the speci ed oset relPos . If relPos equals 0 the shell will be centered over the cursor position. For example the command callback d2 popupCallback positionCursor 40
registers a callback for a Dialog shell named d2 that will position this shell 40 pixel left and 40 pixel up above the cursor when d2 is popped up. action widget type translations type ?! augment j override j replace translations ?! string translation table { refer to the Xt Reference
Manual [1], Appendix F, for a detailed description.
This command allows the translations resource to be modi ed. The type argument speci es, how the new bindings are merged with the existing ones: override means that a translation speci ed for an existing event overrides the old action, augment de nes precedence for the existing values. The use of replace means the total replacement of the previous bindings by the translation table speci ed. If you are using the replace or override directives, you will need information about a widget's actions and default bindings in order to avoid con icts with your own translations. For a complete description including the new R5 widgets refer to the MIT documentation [7]. In addition to the standard Xt actions, Wa fe provides a feature for binding the execution of a Tcl command to an event. The globally registered action exec (string )
takes any number of strings as arguments, which compose together a valid Tcl command and arranges for it to be executed. Note that due to the way Xt handles arguments to actions, you must not use a comma (",") in the command, since it will be regarded as an argument separator and will not be passed to the action! Assuming an application with an Text widget named text, the following statement will arrange for the contents of the Text widget to be sent to the application by specifying a translation for a Key event. 24
action text override \ {Metas: exec(echo [gV text string])}
Whenever the key s is pressed while the Meta-key is held down inside the text widget, the contents of it will be sent to the application. One of the big advantages in using actions instead of callbacks is the possibility to access information from the event which triggered the execution. This feature is supported in a restricted fashion by the exec action with printf-like % codes. The valid events and the possible codes are
ButtonPress, ButtonRelease, MotionNotify KeyPress, KeyRelease EnterNotify, LeaveNotify ClientMessage Code Information
%t %w %W %x %y %X %Y %a %b %k %p %s %S
event type widget widget x-coordinate y-coordinate x-root-coordinate y-root-coordinate ascii-character number of button keycode protocol name keysym state
Valid Events
all of the above mentioned events all of the above mentioned events all of the above mentioned events all of the above mentioned events all of the above mentioned events all of the above mentioned events all of the above mentioned events KeyPress, KeyRelease ButtonPress, ButtonRelease KeyPress, KeyRelease ClientMessage KeyPress, KeyRelease ButtonPress, ButtonRelease, MotionNotify, KeyPress, KeyRelease
The user has to ensure by a corresponding binding in the translation table that a % substitution occurs only with a valid event type. The %t code will return unknown if the event is none of the above mentioned. With the following translation a string containing the keycode, character and keysym will be sent to the application any time a key is pressed in a text widget called text. action text override \ {: exec(echo K:%k C:%a KS:%s)}
25
installAccelerators destination source destination ?! widget in which events occur source ?! widget whose actions are invoked
Accelerators provide a facility by which actions de ned in one widget can be triggered by events in another widget (refer to the Xt Programming Manual [5]). The resource named accelerators of the source widget should be set to the accelerator table before this command is issued (eg. via the application default le). The command installAllAccelerators installs the accelerators from source and its children to destination. Note that two directives controlling the merging process can be speci ed as a part of the accelerator table: override means that the accelerators have precedence over the source widget's translations, augment means that existing bindings can't be overridden by the accelerators. callCallbacks widget callback htype datai callback ?! callback resource name type ?! oat data ?! string containing a value according to type
Callbacks can be called not only by the widget itself but also by the application using callCallbacks. If it is desired to pass a callData information to the callback procedure, this can be done by specifying type and data, otherwise the callData argument defaults to NULL. callActionProc widget eventInfo action arg eventInfo ?! "" j hbuttonEvent button i j hkeyEvent key i button ?! button1 j button2 j button3 j button4 j button5 key ?! string containing a key action ?! string name of an action procedure arg ?! string passed as argument for action procedure
This command can be used to explicitly invoke the action procedure named
action of widget with the string arguments arg. The contents of the event
union, which is passed to the action procedure, can be in uenced with the eventInfo argument. If this argument is empty, an XAnyEvent structure is passed to the action. If buttonEvent is speci ed with a certain button, 26
an XButtonEvent structure is passed. This structure contains as the button member the speci ed button, all other members are lled automatically. Alternatively, an XKeyEvent structure can be passed with the keycode member set according to the speci ed key. Please note that this command does not oer all the features of it's Xt counterpart, which is due to the very complex structure of the XEvent union. removeAllCallbacks widget callback
The command removeAllCallbacks is used to un-register all callback procedures currently associated with the callback resource callback of widget. Boolean setWMProtocols widget protocol widget ?! Name of a widget protocol ?! WM TAKE FOCUS j WM SAVE YOURSELF j WM DELETE WINDOW
Use this command to set the WM PROTOCOLS property of the speci ed widget's window (usually a shell widget) to one of the three prede ned values. The speci ed widget must be realized.
4.4 Widget speci c commands Besides of the commands which provide the basic functionality, Wa fe oers widget speci c commands { either for reasons of convenience or because some Xt features had to be implemented in a dierent manner. All of these commands are described in the following sections.
4.4.1 Scrollbar XawScrollbarSetThumb scrollbarWidget top shown scrollbarWidget ?! name of a Scrollbar widget instance top ?! string which contains a oat value shown ?! string which contains a oat value
27
This command is not more than a convenience function for accessing the top and shown attributes of a previously created Scrollbar widget. It moves the Scrollbar's thumb to a new position, where top speci es the position of the top and shown the length of the thumb, both as a fraction of the Scrollbar's total length. Using this command is saver than using setValues, because setting a oat attribute might cause problems on some systems. Note that this command doesn't work if called from a Scrollbar's jumpProc callback procedure.
4.4.2 StripChart The StripChart widget class provides a real time chart of a single value. It's functionality is made accessible by the following command. scSet stripChartWidget value stripChartWidget ?! name of a StripChart widget instance value ?! string, which contains a double value
This command is used to specify a stripChart widget's current value. The widget will plot a graph of this value by querying it every update seconds. The update resource can be changed with a call to setValues.
4.4.3 List XawListUnhighlight listWidget listWidget ?! name of a previously created List widget
This command unhighlights the highlighted element of a List widget. Only one element can be highlighted at a time, XawListChange unhighlights automatically the active element before performing the change. XawListHighlight listWidget index index ?! string containing an integer value
This command highlights the speci ed element.
28
val XawListShowCurrent listWidget val ?! name of a Tcl array variable, having the elements list index and string val(list index) ?! string containing an integer value val(string) ?! string value
Use XawListShowCurrent to get the currently highlighted element and its index. Note that within a callback procedure, you can use the %i and %s substitution speci ers. XawListChange listWidget nitems longest resize type arg+ listWidget ?! name of a previously created List widget nitems ?! string containing a signed int longest ?! string containing a signed int resize ?! 1 j 0 type ?! Arg j File j List arg ?! string depending on type
Use XawListChange to change the items of list . This command modi es the list, longest and nitems attributes. If nitems or longest contain a value less than one, the List widget will calculate the actual value. The new contents of the list widget can be speci ed in various ways depending on the value of the argument arg . XawListChange listWidget nitems longest resize File lename lename ?! valid Unix lename string
In this case the new contents of listWidget are read from the le lename where each line is taken to be one list element. The carriage-returns and line-feeds are discarded! XawListChange listWidget nitems longest resize Arg element+ element ?! string
Using the Arg type, the elements of the List widget can be speci ed as arguments to the XawListChange command. Each argument is regarded as one list element. XawListChange listWidget nitems longest resize List contents
29
contents
?! Tcllist
When List is speci ed as contents type, the elements of listWidget are speci ed in a Tcl list. Each element of the Tcl list is regarded as one element of the List widget. If the execution of a Tcl command is registered with the callback attribute called callback, the current element and it's index can be accessed with the %i and %s substitution codes (see also callback). The contents of a List widget can also be changed via setValues. Be sure that at any time the numberStrings resource is set to a value equal or lower to the number of strings in the list. Otherwise the List widget produces an unfriendly core dump. XawListAppend listWidget element+
This command can be used to append one or more elements to an existing list. It is no generic Athena command; the array of strings is merely rebuild with the new values appended and afterwards the value of the list resource is updated. The following program creates an instance of the List widget class, reads in the contents of the current directory and sends the name of the chosen le to the application. The rst solution is implemented using the list resource of the List widget: #!/usr/bin/X11/wafe --f List browse topLevel \ callback {sV topLevel title "Selected: %s"} \ list [split [exec /bin/ls -1] \n] realize
The second solution is implemented using XawListChange: #!/usr/bin/X11/wafe --f List browse topLevel \ callback {sV topLevel title "Selected: %s"} XawListChange browse 0 0 1 List [split [exec /bin/ls -1] \n]] realize
Assuming the user selects the le myprog with the pointer, the window title will change to \You selected: myprog". Note that split and exec are standard Tcl commands. For further information refer to the Tcl manual [6]. 30
4.4.4 Text One of the most important widget classes is the Text widget class. Note that a great part of Text's functionality can be accessed via actions { if you want them to be triggered by the application rather then by the user, use callActionProc. Note that not all of the functions begin with "XawText", since some of them are made available by Text's subparts. All of these command expect as rst argument an instance of the Text widget class (named textWidget below). Boolean XawAsciiSaveAsFile textWidget lename
This command saves the contents of textWidget to the speci ed le, regardless whether a le or a string is edited. Boolean XawAsciiSave textWidget
This command writes out the contents of an Text widget of type le, given that you made any changes since the last save. Boolean XawAsciiSourceChanged textWidget
Use this function to determine whether the source has changed since the last save. XawTextSinkSetTabs textWidget tab tab ?! string which contains an integer
Use this command to specify the distances between Text 's tabstops. The unit which is used to measure the distance is the width of a gure in the used font. XawTextSetSelectionArray textWidget selectType selectNull selectType ?! selectAll j selectChar j selectLine j selectParagraph j selectPosition j selectWord
This command is used to con gure the Text widget's behavior for multi click text-selections. Each selectType argument corresponds to one click, the last argument must be selectNull. If an internal timeout value is exceeded, the widget restarts counting. 31
textPosition XawTextSearch textWidget scanDir txt textPosition ?! string containing a long integer value scanDir ?! left j right txt ?! name of a Tcl array variable having the members rstPos, ptr and length txt( rstPos) ?! string containing an integer value txt(length) ?! string containing an integer value txt(ptr) ?! a string
Use XawTextSearch to search in the text displayed by the text widget for the beginning of the speci ed textBlock. This command returns a value less than 0 upon unsuccessful termination, otherwise the position of the beginning of the searched block. The following example searches in the text of an Text widget named text for the word example and moves the insertion Point to this location. set textBlock(ptr) "example" set textBlock(length) 7 set textBlock(firstPos) 0 textSetInsertPosition text \ [XawTextSearch text right textBlock]
In most cases, when a C-function takes a structure as an argument, we implemented the corresponding Wa fe command in this style. Usually the members of the Tcl array have the same names as the C-language structure members. read XawTextSourceRead textWidget begin txt length read ?! string containing a long integer value begin ?! string containing a long integer value length ?! string containing an integer value txt ?! name of a Tcl variable to be set as result; it will have the following members: rstPos, length and ptr txt( rstPos) ?! string containing an integer value txt(length) ?! string containing an integer value txt(ptr) ?! a string
32
Use XawTextSourceRead to read the text of the speci ed widget. It may take several calls to this function to read the requested amount of text; the number of characters actually read is returned and can be compared to the requested number. found XawTextSourceScan textWidget begin boundary direction count include found ?! string containing a long integer begin ?! string containing a long integer boundary ?! position j whiteSpace j EOL j paragraph j all direction ?! left j right count ?! string containing an integer include ?! true j false
Use this command to search the widget from begin on in the speci ed direction for one of the prede ned boundaries. XawTextInvalidate textWidget begin end begin ?! string containing a long integer value begin ?! string containing a long integer value
This function causes the speci ed range from begin to end to be redisplayed. lines XawTextSinkMaxLines textWidget height lines ?! string containing an integer value height ?! string containing a long integer value
This command returns the maximum number of lines that will t in a window with the speci ed height. height XawTextSinkMaxHeight textWidget lines height ?! string containing an integer value lines ?! string containing an integer value
Calculates the height that will taken by the speci ed number of lines. 33
XawTextEnableRedisplay textWidget
This function ushes any changes due to patched updates. XawTextDisableRedisplay textWidget
To disable redisplay while making several changes use XawTextDisableRedisplay. XawTextDisplay textWidget
This function forces redisplay of all accumulated updates. topPosition XawTextTopPosition textWidget topPosition ?! a string containing a long integer value
Obtain the character position of the left-most character of the rst line displayed. XawTextSetInsertionPoint textWidget insertPosition insertPosition ?! string containing a long integer value
Use this convenience function to set the value of the insertPosition resource. insertPosition XawTextGetInsertionPoint textWidget
Use this convenience function to get the value of the insertPosition resource. XawTextDisplayCaret textWidget trueFalse trueFalse ?! true j false
This convenience function can be used to modify the value of the displayCaret resource. 34
XawTextGetSelectionPos textWidget beginVar endVar beginVar ?! name of a Tcl variable endVar ?! name of a Tcl variable
Use this function to retrieve the text, which is currently selected. It will set the two Tcl variables as speci ed by the arguments. If the values are equal, nothing is currently selected! XawTextSetSelection textWidget begin end begin ?! string containing a long integer value end ?! string containing a long integer value
This function sets the PRIMARY selection buer from character position begin to position end and highlights this area. XawTextUnsetSelection textWidget
To unhighlight a previously highlighted text use XawTextUnsetSelection. result XawTextReplace textWidget begin end txt result ?! editDone j positionError j editError begin ?! string containing a long integer value end ?! string containing a long integer value txt ?! name of a Tcl array having the members rstPos, ptr, length txt( rstPos) ?! string containing an integer value txt(length) ?! string containing an integer value txt(ptr) ?! a string
Use this function to replace the text between start and end. XawAsciiSourceFreeString textWidget
This function frees the memory which is allocated after a getValue command in order to build up the string. Note that this memory is automatically freed with the next getValue call!
4.4.5 Tree 35
XawTreeForceLayout treeWidget treeWidget ?! name of previously created Tree widget instance
This command will force the Tree widget to recalculate its Layout and to arrange its children. If the autoRecon gure resource is set to false, this provides an ecient way to layout the tree.
4.4.6 Form XawFormDoLayout formWidget doLayout formWidget ?! name of previously created Form widget instance doLayout ?! 1 j 0
When making several changes to the children of a form, it might be desirable to set doLayout to 0 until after all changes have been made.
4.4.7 Paned XawPanedAllowResize panedChild allow panedChild ?! name of a Paned widget's child allow ?! 1 j 0
Equivalent to changing the allowResize constraint resource of the speci ed child. XawPanedSetMinMax panedChild min max min ?! string containing an integer max ?! string containing an integer
Equivalent to setting the min and max constraint resources of the speci ed child. XawPanedGetMinMax panedChild minVar maxVar minVar ?! name of a Tcl variable maxVar ?! name of a Tcl variable
Equivalent to querying the min and max constraint resources of the child. The speci ed Tcl variables will be set by the command. 36
XawPanedSetRe gureMode panedChild mode panedChild ?! name of a child widget of a Paned widget mode ?! 1 j 0
Use this command to enable and disable automatic recalculation of pane sizes and positions. num XawPanedGetNumSub panedWidget num ?! string containing an integer value panedWidget ?! name of a previously created Paned widget
This functions returns the number of children. Note that the Grip widgets are children of the Paned widget as well!
4.4.8 Toggle XawToggleChangeRadioGroup toggleWidget radioGroup toggleWidget ?! name of a previously created Toggle widget radioGroup ?! name of a previously created Toggle widget j NULL.
Use this command to add toggleWidget to an existing radio group (radioGroup can be any member widget of this group) or to remove a Toggle from a radio group (by specifying NULL as radioGroup . XawToggleUnsetCurrent radioGroup
Use this command to un-set all toggles in the speci ed radio group.
4.4.9 SimpleMenu entry XawSimpleMenuGetActiveEntry simpleMenuWidget entry ?! name of an Object simpleMenuWidget ?! name of a previously created SimpleMenu widget
This function returns the name of the currently active Object in the speci ed SimpleMenu widget 37
XawSimpleMenuClearActiveEntry simpleMenuWidget
This function un-highlights the currently selected entry.
4.5 Communication, Handlers and Events This section explains, how Wa fe's communication mechanism is used to transfer commands and data between Wa fe and the application and how it can be modi ed by handlers. Note that an essential part of this topic is the use of the dierent command line arguments, which were already described earlier.
4.5.1 The echo command echo string+ string
?! character string
Communication with the application is primarily facilitated by the command echo. It takes any number of strings as arguments, which are send to the application. In direct mode or le mode, echo will behave just like an ordinary print command, writing its arguments on standard output. (Refer eg to the action command in order to see an example).
4.5.2 Handlers Handlers oer the possibility to change Wa fe's communication mechanism. Normally, three streams are assigned to each application, which are redirected as described in the introduction. The stdout stream is echoed to the user, after being searched for commands (beginning with the prompt-character), stderr is merged with Wa fe's stderr and afterwards echoed to the user and the application's stdin is normally used to receive inputs of the frontend. An application running in input mode will furthermore receive the typed input from the associated terminal. This standard con guration can be changed by command line arguments and by using handlers. The latter provide a mean to register a certain command with Wa fe, which is to be executed whenever input is pending on the speci ed stream. The use of handlers is facilitated by the following commands.
38
register source command source ?! stdin j stdout j stderr j xioerr j term j quit j int j hup j pipe j usr1 j usr2 command ?! valid Wa fe command string
Use this command to install handler procedures, which are invoked under dierent conditions, as speci ed by the argument source . By specifying stdin, stdout or stderr as rst argument, command will be executed whenever data is pending on the corresponding stream. Before executing the command, Wa fe will update a global Tcl variable called STDIN, STDOUT or STDERR according to the handler registered, which will contain the pending data. Note that stdout and stderr are named as they are seen in frontend mode from an application running as an subprocess of Wa fe. If the application writes to stdout or stderr the corresponding handler will be activated. If the frontend accepts an additional input from the terminal, a stdin handler can be registered. The stdout handler is activated, when Wa fe is used in prompt mode, and Wa fe receives a buer on the channel connected with stdout of the subprocess that does not start with the prompt character. This type of handler is typically used when Wa fe is used as a frontend. The following example shows the behaviour of this handler. wafe --d %echo hi there! hi there! %register stdout {echo you typed } asdadasd you typed %quit
The stdin handler is has to be explicitely turned on by the --i command line option. Was this argument given, Wa fe will start listing at stdin and echo per default the incoming data to the client application (or to stdout if not running in frontend mode). Using the register command a Tcl handler can be speci ed. The stderr handler can be only used in frontend mode an listens to the client programs stderr output. Note that the registration of a handler procedure can change Wa fe's standard behavior: Registering an error-handler means that no error messages of the application will be echoed to the user's terminal. Wa fe allows XIO errors to be caught by using the constant xioerr as rst argument to the register command. Note that this is a fatal error condition 39
and that Wa fe will anyway try to kill the application program before exiting afterwards. This type of handler procedure facilitates therefore cleanup operations. The remaining handler types refer to signal for which handler can be speci ed as Tcl commands. For signal handlers it is also possible to specify IGNORE or DEFAULT in the command string which cause either to ignore a signal completely or to default to the standard system action (i.e. not using any Wa fe speci c signal handler). The command kill (see short reference guide in appendix A on page 49) support the same signal types. unregister source source
?! stdin j stdout j stderr j xioerr j term j quit j int j hup j pipe j usr1 j usr2
This command is used to unregister the corresponding handler, which means that the default handler will be reinstalled. Note that a handler procedure is called several times if the message consists of more than one line (Lines are separated by carriage returns). If more than one handler for the same input source is registered, the most recently created one will be used. Assuming that the application consists of an Text widget named text, the following code will popup a warning shell, whenever an error occurs in the application (Wa fe operates in frontend mode). TransientShell errorShell text Command errorMessage errorShell \ callback {popdown errorShell} \ background red callback errorShell popupCallback positionCursor 20 register STDERR { sV error label $STDERR popup errorShell exclusive }
Whenever the application writes something on stderr, the popupshell will pop up { positioned under the cursor { and display the error. Note that the error is displayed in a Command widget, which means that the shell can be dismissed by a button click.
40
inputID addInput leno handlerType tclVariable tclCommand inputID ?! handle, can be used to remove the input handler handlerType ?! read, write, except or none
This command can be used to add additional input handlers or exception handlers. If used with read as 2nd argument, each time when data is ready the data is read and APPENDED to the speci ed tclVariable and tclCommand is executed. addInput returns an inputId . Note that the amount of data read might depend on the buering of the operating system. If only the newly read data should be kept in the TclVariable, TclCommand should set it empty after processing its contents. If leno corresponds to an open le, a busy loop is likely to occur (see wafe/src/tcl/addInput.tcl for an example). As shipped, 16 additional input handlers can be added by the application program. Increasing this number needs recompilation. removeInput inputID
removes an input added by addInput. inputId is returned from addInput. integer leno tclFile readOrWrite readOrWrite ?! read or write
The function leno returns for the le opened by using Tcl's open command the le descriptor. For pipes the le descriptor might be dierent for reading or writing.
4.5.3 The additional communication channel Wa fe provides an additional facility which is used mostly to transfer large amounts of data from the application to the front end (eg the contents of an Text widget). When the application process is started, Wa fe creates an addi-
tional socket-based communication channel. The following commands provide access to this feature.
41
fd getChannel fd
?! string containing an integer value
This command returns the le descriptor to be used by the application, which is under UNIX a small integer referring to an open le. Note that this way of communication can only be used if the application is able to write directly to a le descriptor. This way how to achieve this depends on the particular interpreter or compiler of the application programming language. So before the additional communication channel is used, the le descriptor should be queried and the information be sent to the application. setCommunicationVariable varName length command varName ?! Valid Tcl variable name length ?! string containing an integer value command ?! valid Tcl command string
Use the command setCommunicationVariable to make the transferred data availaible for the user interface. As soon as the data with length number of bytes is received, Wa fe will create the Tcl variable varName , which will contain the transferred data, and execute command . If the variable already exists, the previous contents will be deleted. Note that this command does not depend on the data being already availaible { if the transfer is complete, command will be executed immediately, if length bytes of data are not yet received, the execution is delayed until the transfer is complete.
4.5.4 Suspending/delaying Execution in Wa fe, Event Processing Wa fe provides a simple means for suspending/delaying execution and synchronizing the handling of events via the procedure waitForVariable. waitForVariable varName varName ?! Valid Tcl variable name
This command can be used to \wait" in a Tcl command until a Tclvariable is set (eg from a callback or action routine). waitForVariable is commonly used for synchronization tasks. In a rst step, waitForVariable unsets the speci ed GLOBAL Tcl variable and enters a new event loop. This "inner" event loop will be left, when the 42
speci ed variable is set. The return value of waitForVariable is the value of the speci ed variable. For example, in a sequence cmd1; waitForVariable x; cmd2; ...
Wa fe suspends until the Tcl variable x is set (eg. via callback procedures, actions or handlers). When the variable x is set, the Wa fe commands cmd2
is executed.
processPendingEvents
The command processPendingEvents can be used within in a Tcl procedure to process all pending events and to continue later in the same point; for example, this can be useful for refreshing the screen while computing heavily in Tcl. Another application area for this command is wafeperl/mofeperl where the use can force screen refresh etc. while computing in Perl. Note, that also callback or actions procedures might be triggered by processPendingEvents, which might issue arbitrary Wa fe commands and alter global variables etc.
4.5.5 Communicating from an Application Program to Wa fe If Wa fe is used as a frontend, lines which are starting with the prompt character (usually \%") printed to stdout from an application program are interpeted as Wa fe (Tcl) commands. Therefore, the remainder of these lines must be valid Tcl statements, using the appropriate quoting and escaping of literals. In certain cases, the interpretation of the commands is undesired. Uninterpreted data transfer can be achieved using the communication channel explained above. However, for certain interpreted programming languages, writing to the communication channel hard to achieve, or complicated. Wa fe provides starting with version 0.95 means for uninterpreted assignment from client applications to Tcl variables. If the application program running under Wa fe writes %=myvar This will become the contents of myvar
to stdout, the Tcl variable myvar is set to the string starting with 'This' and ending with 'myvar'. The uninterpeted assignment works as follows: 43
If the rst character after '%' (or the character provided via the --c option)
is '=', the next space terminated token is used as a variable name, and the remainder of the line is assigned to the named Tcl variable. If the character after the '%' is a '+' followed by a space terminated token for the variable name, then the remainder is appended to the speci ed variable. If the character after the '%' is a '\' followed by a space terminated token for the variable name, then the remainder and a newline character are appended to the speci ed variable. If the character after the '%' is a '/' followed by a space terminated token for the variable name, then a newline character and the remainder of the line to the speci ed variable.
Using this mechanism, \virtual les" can be implemented, which write into
Tcl variables. An \open" command clears the speci ed variable, a \write" command appends to it, a \newline" command appends a newline and the \close" command just ushes stdout.
4.6 The selection mechanism X de nes an inter-program communication protocol (called ICCCM), which allows X-window based applications to exchange data. This facility is best known when text data is exchanged with the cut-and-paste mechanism. Wa fe provides simpli ed access to the exchange of text selections with the following three commands. Boolean ownSelection widget selection hNULL j lostComi hNULL j doneComi selection ?! character string lostCom ?! valid Wa fe command string doneCom ?! valid Wa fe command string
The command ownSelection claims the ownership of the PRIMARY selection for the speci ed widget . The speci ed string selection will be placed in the buer and be available for other applications. This means it can be "pasted" in a window of an application supporting this communication protocol. This command takes two additional arguments, both of them valid Wa fecommands. By specifying lostCom , a command can be registered, which will be executed when the widget looses ownership of the PRIMARY buer. If doneCom is speci ed, the registered command will be evaluated whenever 44
the selection transfer process is complete (which normally means a paste action). Specify the constant NULL if you do not want to use this feature. getSelectionValue widget selHandler selHandler ?! valid Wa fe command string
This command is the counterpart of ownSelection and is used, when a widget wats to retrieve the current contents of the PRIMARY selection buer. The registered command string will be executed as soon as the selection data is availaible. The global Tcl variable PRIMARY will be set to pass the requested information. This command can only be used if the speci ed widget is realized. disownSelection widget
This command can be used if a widget explicitly wants to disclaim its ownership of the PRIMARY buer. Note that the widget automatically looses the ownership, whenever an other widget claims to be the owner. A command registered with getSelectionValue will be invoked with an empty string if no data is currently selected. Execution will not be postponed until selection data is availaible! The selection mechanism shall be illustrated by the following example. The following Wa fe-script displays the current value of the primary selection buer using the label of a Command widget and allows the user to set the selection buer (Btn1) to the value of the label (eg. the user has slected in the meantime another content, and wants to set the selection buer to the old value of the label), read again the selection buer, set the label to the new value (Btn2) and to highlight the widget, while the button is pressed (this is achieved by the command widget action set(), or to quit the program (Btn3). #!/usr/bin/X11/wafe --f sV topLevel allowShellResize true Command sel topLevel action sel override {: \ exec(ownSelection topLevel [gV sel label]) set()}
45
action sel override {: \ exec(getSelectionValue topLevel {sV sel label $PRIMARY})} action sel override {: exec(quit)} realize getSelectionValue topLevel {sV sel label $PRIMARY}
At startup, the program shows whatever is selected at this moment. The user can make this text again the PRIMARY selection just by pressing the left pointer button within the window. The application is terminated by pressing the right button. Beside of those commands, which are the counterparts of the highlevel Xt functions, Wa fe oers also some of the lower level Xlib functions. They can be used to modify the primary selection buer as well as the seven cut buers. convertSelection widget targetBuer widget ?! widget to determine display targetBuer ?! 0 j 1 j 2 j 3 j 4 j 5 j 6
Use convertSelection to request the current value of the primary selection and place it in cut buer targetBuer for further use. selection fetchBuer widget cutBuer selection ?! string value widget ?! widget to determine display cutBuer ?! 0 j 1 j 2 j 3 j 4 j 5 j 6
This function retrieves the contents of the speci ed cut buer of the display of the speci ed widget and returns it. selection fetchBytes widget selection widget
?! string value ?! widget to determine display
Convenience function, which calls convertSelection and fetchBuer. The value of the primary selection is returned. Note that the contents of cutbuer-0 will get lost! 46
storeBuer widget value cutBuer widget ?! widget to determine display value ?! string value cutBuer ?! 0 j 1 j 2 j 3 j 4 j 5 j 6
Use storeBuer to make value the content of the speci ed cut buer.
4.7 Integration of the XPM image format Wa fe oers two commands, which provide { together with Arnaud Le Hors xpm
library { a means to include multi-colored images in your application (For details please refer to the Xpm documentation [2]). First of all, a new string-to-pixmap converter was registered. Note that most of the attributes which currently use bitmaps (eg the resource bitmap of the Label widget) are actually of type Pixmap . If a bitmap is speci ed, it is rendered using the foreground and background colors, which are speci ed as seperate resources. The new converter procedure rst attempts to convert the speci ed lename into a bitmap, using the standard Xt algorithm. If this conversion fails, it tries to interprete the le as an xpm image. Assuming that wafe.xpm is a le in valid xpm format located in the current directory, the following Wa fe-script will generate an instance of the Label widget class showing the image. #!/usr/bin/X11/wafe --f Label image topLevel bitmap wafe.xpm realize
Please note that this conversion allocates color cells, which won't be freed until the application terminates. The allocated resources are managed by Xt's caching mechanism, which means that a pixmap which is converted once, will be availaible for the application's lifetime. Furthermore, if the pixmap le is not located in the current directory, the lename has to be speci ed with an absolute path. changePixmap widget attribute lename attribute ?! an attribute of type Pixmap lename ?! UNIX lename string j None
Use changePixmap to set a attribute of type Pixmap to the speci ed image. Obviously, you could achieve the same result by using the following command 47
setValues widget attribute lename
The main dierence is that changePixmap keeps track of converted pixmaps by maintaining its own pixmap cache. A pixmap can be released by setting the attribute to another pixmap or to one of the following values: None, ParentRelative, or Unspeci ed. If there are no references to a pixmap, all resources (allocated memory as well as color cells) of the pixmap are released. So it is up to you wether you want the bene ts of Xt's caching mechanism or wether you prefer having the color cells again availaible. Additionally, changePixmap can handle shaped pixmaps signi cantly better then sV where Xt's cacheing mechanism can prevent shaping of windows. A special case is the command changePixmap topLevel iconPixmap lename
which can be used to change the icon pixmap for any shell widgets; please note, that if the window manager mwm (or a derivative of it) is used the icon pixmap must be set before the shell is realized, otherwise the window manager will provide it own (unaccesible) icon window. changePixmap with the resouce iconPixmap is a replacement for the obsolete command setIconPixmap. If error conditions occur changePixmap raises a Tcl exception, which can be caught by the Tcl command catch.
48
A Short Reference A.1 X Tookit Widgets and Commands The commands listed in this section are available in Motif or Athena versions of Wafe. f addTimeOut : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : XtAppAddTimeOut
Arguments: time interval in ms, Tcl command Return value: XtIntervalId The command addTimeOut creates a timeout and returns an identi er for it. The timeout interval is set in ms. The callback procedure (the speci ed Tcl command) is called when the time interval elapses, and then the timeout is removed.
f action
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Arguments: widget, override j augment j replace, translation table Return value: void The command action calls depending on its 2nd argument the Xt functions XtAugmentTranslations, XtOverrideTranslations or XtSetValues to update the translation table of the speci ed widget. If "augment" is speci ed the function nondestructively merges the new translations into the existing widget translations. If the new translations contain an event or event sequence that already exists in the widget's translations, the new translation is ignored. If "override" is speci ed the function destructively merges the new translations into the existing widget translations. If the new translations contain an event or event sequence that already exists in the widget's translations, the new translation is merged in and override the widget's translation. If "replace" is speci ed the function replaces the existing translation table completely with the speci ed table.
w ApplicationShell
::::::::::::::::::::::::::::::::::::::::::::::::::::
The ApplicationShell widget class is a subclass of TopLevelShell that is used for normal top level application window. Instead of the parent diget the third argument is interpreted as display string (eg unix:0.0). f bell XBell Arguments: widget to determine display, percent (-100 = o, 0 .. 100) Return value: void ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
49
The command bell rings the bell on the keyboard of the display of the speci ed widget, if possible. The speci ed volume is relative to the base volume for the keyboard. If the value for the percent argument is not in the range -100 to 100 inclusive, a BadValue error results. The volume at which the bell rings when the percent argument is nonnegative is: base - [(base * percent) / 100] + percent
The volume at which the bell rings when the percent argument is negative is: base + [(base * percent) / 100]
f callActionProc
Arguments:
::::::::::::::::::::::::::::::::::::::::::::::::::::::
widget, event structure, name of action procedure, parameters of action procedure Return value: void The command callActionProc can be used to call explicitely the speci ed action procedure of the given widget. CallActionProc searches for the named action routine in the same manner and order as translation tables are bound. If found, the action routine is invoked with the speci ed widget, event pointer, and parameters. Certain parts of the event structure can be speci ed via the 2nd argument.
f callCallbacks
::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Arguments: widget, callback, optional oat and value Return value: void The command callCallbacks calls each procedure that is registered in the speci ed widget's callback list. The optional constant " oat" and value should be used only for callback procedures that expect this in their CallData arguments (eg. the "jumpProc" callback in the athena Scrollbar widget class). f callback wafeCallbackCmdArgs Arguments: widget, callback resource, none j exclusive j nonexclusive j popdown j position j positionCursor, string (depends on third argument, widget reference for none j exclusive j nonexclusive j popdown) Return value: void The command callback can be used to set the callback resource of the named widget to one of Wafe's prede ned toolkit function. For the prede ned types refer to the following table. Note that the execution of a Wafe command can be registered with the callback resource of a widget with the setValues command. :::::::::::::::::::::::::::::::::::::::
50
none exclusive nonexclusive popdown position positionCursor
realize a popup-shell, grab-type none realize a popup-shell, grab-type exclusive realize a popup-shell, grab-type nonexclusive unrealize a popup-shell position a popup-shell relative to its parent position a popup-shell under the cursor
The contents of 4th argument depend on the prede ned callback types and is a widget reference, if the 3rd argment is "none", "exclusive", "nonexclusive" or "popdown". if the 3rd argument is "position", the 4th argument has the form "widgetreference:xoset/yoset", where the osets are optional. If the 3rd argument is "positionCursor" the 4th argument will be treated as a relative position. If it is 0 the widget will pop up centered over the cursor if possible.
f combineFileDatabase : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments: lename, widget to determine database, override Return value: Status Min. Requirements: R5 The command combineFileDatabase merges the contents of a resource le (1st argument) into the the resource database of the screen on which the speci ed widget (2nd argument) is being displayed. If the same resource speci er is used for an entry in both the resource le and the resource database, the entry in the le will replace the entry in the database if override (3rd argument) is true; otherwise, the entry in le is discarded. The le is parsed in the current locale. If the cannot be read a zero status is returned; otherwise a nonzero status is returned. The database entries are merged without changing values or types, regardless of the locale of the database. f destroyWidget XtDestroyWidget Arguments: widgets Return value: void The command destroyWidget takes any number of widget references as arguments, destroys these and releases all widget speci c allocated resources. ::::::::::::::::::::::::::::::::::::
f fallbackResources : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments:
widget to determine database, resource-speci cation value pairs Return value: void Min. Requirements: R5 The command fallbackResources can be used to specify default resource values within a Wafe application. The rst argument is used to determine 51
the resource database, the following arguments are attribute (resource speci cations)/value pairs. If a matching ressource entry is already available in the resource database, the provided value in fallbackResources is ignored. FallbackResources have the lowest priority and can be used conveniantely together with resource les, which have an higher priority. They should be used to provide default resources. Note that with fallbackResources one can specify class names as well as instance names in resource speci cations, the same syntax as in an application default les can be used. Therefore the resource speci cation can, in contrast to the setValues command, be applied to several widgets in the application. Note as well, that the resources will be evaluated typically when a widget is created; therefore fallbackResources does not change resources of already created widgets.
f fontHeight : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments: Widget, fontResource Return value: int The function fontHeight returns the height of a font in pixels. The font is taken is taken from the given fontResource (2nd argument) of the given widget ( rst argument). f x ush XFlush Arguments: Widget to determine display Return value: void The command x ush ushes the output buer from the client to X server connection. Most client applications need not use this function because the output buer is automatically ushed as needed by calls to XPending, XNextEvent, and XWindowEvent. Events generated by the server may be enqueued into the library's event queue. f getApplicationResource wafeGetApplicationResource Arguments: base widget, resource name, resource class Return value: String The function getApplicationResource can be used to obtain values from the Xt's resource database from the screen of the speci ed widget (1st argument). The provided resourceName (2nd argument) and resourceClass (3rd argument) can be arbitrary, application speci c strings dierent from with the widget's resources provided by the toolkit. On success the return value is the fetched resource value, on failure, an empty string is returned. For Boolean resources (the speci ed resource class is "Boolean"), 0 or 1 is returned. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:::::::::::::::
52
f getClass
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Arguments: widget Return value: String The function getClass returns the class of the speci ed widget in form of a string.
f getResourceList : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments: widget, variable name for output of list of resources Return value: int The command getResourceList returns the number of resources for a speci ed widget instance and the list of resources in the variable speci ed as third argument. Note that the returned list might contain inherited geometry constraint resources and the like. f getTypeOfAttribute wafeGetQTypeOfAttribute Arguments: widget, attribute Return value: String The function getTypeOfAttribute returns the type of the given attribute (2nd argument) for the speci ed widget ( rst argument). If the widget class does not have an attribute with the given name, an empty string is returned. :::::::::::::::::::::
f getValue
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Arguments: widget, attribute Return value: String The function getValue returns the resource value for a resource (2nd argument) of the the speci ed widget ( rst argument). Note that Wafe tries to convert the result to the best possible string representation suitable for Tcl; however, some attributes cannot be converted into a string. f grabKeyboard XtGrabKeyboard Arguments: widget, true j false, pointer mode (sync j async), keyboard mode (sync j async) Return value: int The function grabKeyboard establishes an active keyboard grab with the speci ed widget's window as the grab window. It returns on success "success" or on failure "alreadyGrabbed", "notViewable" or "frozen". When the keyboard is grabbed, all key events will be delivered to the speci ed widget, regardless of the location of the pointer. If the second argument owner events is false, all generated key events are reported. If the 2nd argument is true, the events are reported as usual. :::::::::::::::::::::::::::::::::::::
53
The 3rd argument controls pointer processing during the grab, the 4th keyboard processing. If the pointer mode (3rd argument) is "async" key event processing continues as usual, if it is sync the state of the pointer as seen by the application appears to be frozen. If the keyboard mode (4th argument) is async, keyboard event processing is unaected by the activation of the grab, if it is sync, the state of the keyboard as seen by the application appears to be frozen. The 5th argument con ne widget can be None or a widget reference. In the latter case, the pointer is restricted to stay in the window of the speci ed widget. f grabPointer XtGrabPointer Arguments: widget, owner events, pointer mode (sync j async), keyboard mode (sync j async), None j con ne widget Return value: int The function grabPointer establishes an active pointer grab with the speci ed the widget's window as the grab window. It returns on success "success" or on failure "alreadyGrabbed", "notViewable" or "frozen". When the pointer is grabbed, all pointer events will be delivered to the speci ed widget, regardless of the location of the pointer. If the second argument owner events is false, all generated pointer events are reported.If the 2nd argument is true, the events are reported as usual. The 3rd argument controls pointer processing during the grab, the 4th keyboard processing. If the pointer mode (3rd argument) is "async" pointer event processing continues as usual, if it is sync the state of the pointer as seen by the application appears to be frozen. If the keyboard mode (4th argument) is async, keyboard event processing is unaected by the activation of the grab, if it is sync, the state of the keyboard as seen by the application appears to be frozen. The 5th argument con ne widget can be None or a widget reference. In the latter case, the pointer is restricted to stay in the window of the speci ed widget. f installAccelerators XtInstallAccelerators Arguments: destination, source Return value: void The command installAccelerators merges the accelerator table from source (2nd argument) to destination (1st argument). Accelerators provide a facility by which actions de ned in one widget can be triggered by events in another widget. The resource named accelerators of the source widget should be set to the accelerator table before this command is issued (eg. via the application default le or sV etc.). After this call events in the destination widget will trigger actions in the source widget. ::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::
54
f installAllAccelerators
::::::::::::::::::::::
XtInstallAllAccelerators
Arguments: destination, source Return value: void The command installAllAccelerators installs the accelerators from source (2nd argument) and its children to destination (1st argument). Accelerators provide a facility by which actions de ned in one widget can be triggered by events in another widget. The resource named accelerators of the source widget should be set to the accelerator table before this command is issued (eg. via the application default le or sV etc.). After this call events in the destination widget will trigger actions in the source widget. f isWidget wafeCvtName2Widget Arguments: widget name Return value: WidgetID The function isWidget returns 0 if no widget with the widget reference exists currently, otherwise non-zero. ::::::::::::::::::::::::::::::::::::::
w Layout
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
The Layout widget class is a very powerful constraint widget with TeX like semantics. It can be used to de ne the gemoetry of a composite widget in terms of (stretchable) boxes and (tretchable) glue. In order to use this widget class, LAYOUT must be speci ed during compilation. f lowerWindow XLowerWindow Arguments: widget to be lowered Return value: void The command lowerWindow lowers the window of the speci ed widget in the stacking hierarchy of the window manager. The speci ed widget must be realized (it must have already a window assigned). f manageChild XtManageChildren Arguments: widgets Return value: void The command manageChild takes any number of widgets as arguments and brings them under parental (geometry) management. This is only necessary, when the widget creating command are used with the unmanaged argument or the widget has been set explicitely to unmanaged. All widgets speci ed in the argument list have to have the same parent widget. f mapWidget XtMapWidget Arguments: widgets :::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::
:::::::::::::::::::::::::::::::::::::::::::
55
Return value: void The command mapWidget maps all speci ed widgets to the associated display.
f mergeResources : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments:
widget to determine database, resource-speci cation value pairs Return value: void The command mergeResources can be used to specify resource values within a Wafe application. The rst argument is used to determine the resource database, the following arguments are attribute (resource speci cations)/value pairs. If a matching ressource entry is already available in the resource database, it will be replaced by the speci ed entry. Note that with mergeResources one can specify class names as well as instance names in resource speci cations, the same syntax as in an application default les can be used. Therefore the resource speci cation can, in contrast to the setValues command, be applied to several widgets. Note as well, that the resources will be evaluated typically when a widget is created; therefore mergeResources does not change resources of already created widgets. f nameToWidget XtNameToWidget Arguments: reference widget, partial widget name path Return value: WidgetID The function nameToWidget returns the widget-ID of a widget with the name (widget path) speci ed in the 2nd argument in the widget tree under the speci ed widget (1st argument). If no such widget exists the command returns 0. :::::::::::::::::::::::::::::::::::
w OverrideShell
:::::::::::::::::::::::::::::::::::::::::::::::::::::::
The widget class OverrideShell is a subclass of the Shell widget class that performs no interaction with the window manager. It is used for widgets (such as popup menues) that should bypass the window manager. If you want a shell that can be iconi ed, use a TopLevelShell. If you do want window manager interaction use a TransientShell. f parent ParentWidget Arguments: child widget Return value: WidgetID The function parent returns the widget-ID of the parent widget of the speci ed widget. :::::::::::::::::::::::::::::::::::::::::::::::::
56
f popdown
::::::::::::::::::::::::::::::::::::::::::::::::
XtPopdown
Arguments: shell widget Return value: void The command popdown pops a previously created and mapped popup shell down. f popup XtPopup Arguments: widget, none j nonexclusive j exclusive Return value: void The command popup pops an existing TransientShell or OverrideShel up. The kind of grab used is speci ed with the 2nd argument which is the way how user events are constrained to the popup shell or its children. It can be one of the constants none, nonexclusive or exclusive. ::::::::::::::::::::::::::::::::::::::::::::::::::::::
f popupChildren : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments: Return value: String The command popupChildren is similar to [gV Widget children] of a composite widget, but it returns the list of popup Shells which are created as children of the given widget. Popup shells are not required to be children of composite widgets. If a widget has no popup children an empty list is returned. f popupSpringLoaded XtPopupSpringLoaded Arguments: shell widget Return value: void The command popupSpringLoaded displays the speci ed and previously created shell widget as a spring-loaded popup. This means that the shell is invisible to the window manager and disables user input to all windows except to the popup itself. :::::::::::::::::::::::::
f processPendingEvents : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments: Return value: void The command processPendingEvents processes all currently pending events before continuing with the next tcl command. This can be useful for refreshing the screen while computing heavily in Tcl. Another application area for this command is wafeperl/mofeperl where the use can force screen refresh etc. while computing in Perl. Note, that by procedding pending events also callback or actions procedures might be triggered by this command, which might issue arbitrary Tcl commands and alter global variables etc. 57
f raiseWindow
f
f
f
f
f
::::::::::::::::::::::::::::::::::::::::
XRaiseWindow
Arguments: widget to be raised Return value: void The command raiseWindow raises the window of the speci ed widget in the stacking hierarchy of the window manager. The speci ed widget must be realized (it must have already a window assigned). realize realizeWidgets Arguments: Return value: void The command realize realizes all top level application shells (which is at least the automatically created main shell of the application with the name topLevel). During realize the computiation of the geometry of the widget under topLevel are performed and actual windows are associated with the widgets. realizeWidget XtRealizeWidget Arguments: widgets Return value: void The command realizeWidget realizes all speci ed widgets. This command should only be used in cases where it is necessary to realize widgets separately (sometimes needed for geometry management). removeAllCallbacks XtRemoveAllCallbacks Arguments: widget, callback name Return value: void The command removeAllCallbacks is used to un-register all callback procedures currently associated with the speci ed callback resource (2nd argument) of the speci ed widget (1st argument). removeTimeOut XtRemoveTimeOut Arguments: interval ID Return value: void The command removeTimeOut removes an timeout command speci ed by the speci ed interval ID. The interval ID was obtained by addTimeOut. resolvePathname XtResolvePathname Arguments: widget to determine display, type, lename, sux, path, substitutions, number of Substitutions, XtFilePredicate Return value: String ::::::::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::
:::::::::::::::::::::::::
::::::::::::::::::::::::::::::::
:::::::::::::::::::::::::::::::
58
The command resolvePathName returns the fully quali ed lename of a readable le of a certain type (2nd argument) with the speci ed lename (3rd argument) and the speci ed sux (4th argument) on the given path (5th argument). The type speci es the kind of le (eg. bitmap or help) and can be referred to via percent code %T, or it can be empty. If no matching le can be located at the given path, an empty string is returned. f setKeyboardFocus XtSetKeyboardFocus Arguments: from widget tree, to widget j None Return value: void The command setKeyboardFocus causes keyboard events that occur in the widget hierarchy rooted by the rst argument to be be dispatched in the widget speci ed as 2nd argument. f setSensitive XtSetSensitive Arguments: widget, sensitive true j false Return value: void The command setSensitive sets a widget and its children sensitive or insensitive depending on the boolean state argument (2nd argument) ::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::
f setValues
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Arguments: widget, attribute value pairs Return value: void The command setValues changes one or more attribute-value pairs of the speci ed widget. According to the argument type, Wafe has to perform dierent type conversions. Note that some attributes of some widgets cannot be set by this command (for example, there is no string representation of a Colormap). Wafe allows to set attributes of type Callback to be set to Tcl commands. f setWMProtocols XSetWMProtocols Arguments: Shell Widget, WM TAKE FOCUS j WM SAVE YOURSELF j WM DELETE WINDOW Return value: Boolean The function setWMProtocols sets the WM PROTOCOLS property of the speci ed widget's window (usually a shell widget) to one of the three prede ned values listed (2nd argument). The speci ed widget (1st argument) must be realized. The following example binds the close action of the mwm or similar window managers to a Tcl (Wafe) command. :::::::::::::::::::::::::::::::::
setWMProtocols topLevel WM_DELETE_WINDOW action topLevel override {WM_PROTOCOLS: exec(puts "hello world")}
59
f sync
XSync Arguments: Widget to determine display, Discard (Boolean) Return value: void The command sync ushes the request buer of the x server on the display of the speci ed widget. If the 2nd argument is set to true, all events in the input queue are discarded. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
f textWidth
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Arguments: Widget, font Resource, Text String Return value: int The function textWidth returns width of given string (3rd argument) in pixels using font from the speci ed font Resource (2nd argument) of the speci ed widget (1st argument). If the speci ed widget is a subclass of XmPrimitive, the font resource is expected to be a fontlist or rendertable, and String is treated like a XmString.
w TopLevelShell : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : The widget class TopLevelShell is used for additional shells in applications
having more than one top-level window (one of which serves as the root of a widget tree instance). The created shell can be separately iconi ed. If you do not want window manager interaction use a OverrideShell.
w TransientShell : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : The widget class TransientShell is used for pop up shell widgets such as
dialog boxes that do not bypass window management. Most window managers will not allow to iconify instances of the TransientShell widget class on it own, and may iconify it automatically if the window, for which the shell is transient for, is iconi ed. If you want a shell that can be iconi ed, use a TopLevelShell. If you do not want window manager interaction use a OverrideShell. f translateCoords XtTranslateCoords Arguments: widget, x coordinate in widget, y coordinate in widget, variable name for root window x, variable name for root window y Return value: void The command translateCoords translates the coordinates x and y coordinates in the given widget into root window coordinates. After the execution the Tcl variables speci ed in the 4th and 5th argument will be bound with the resulting values. f ungrabPointer XtUngrabPointer Arguments: widget with active pointer grab :::::::::::::::::::::::::::::::::
:::::::::::::::::::::::::::::::::::::
60
f
f
f
f
Return value: void The command ungrabPointer releases an active pointer grab. ungrabKeyboard XtUngrabKeyboard Arguments: widget with active keyboard grab Return value: void The command ungrabKeyboard releases an active keyboard grab. unmanageChild XtUnmanageChildren Arguments: widgets Return value: void The command unmanageChild takes any number of widgets as arguments and removes them from parental management. All widgets speci ed in the argument list have to have the same parent widget. unmapWidget XtUnmapWidget Arguments: widgets Return value: void The command unmapWidget takes any number of widgets as arguments and unmaps them. unrealizeWidget XtUnrealizeWidget Arguments: widgets Return value: void The command unrealizeWidget takes any number of widgets as arguments and unrealizes them. :::::::::::::::::::::::::::::::
:::::::::::::::::::::::::::::::
:::::::::::::::::::::::::::::::::::::
:::::::::::::::::::::::::::::::::
f waitForVariable : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments: variable name Return value: String The function waitForVariable can be used to "wait" in a Tcl command until a Tcl variable is set (eg. from a callback or action routine). While Wafe is waiting, other events can be processed. If the variable is set, waitForVariable returns the variables value. In a rst step, waitForVariable unsets the speci ed GLOBAL Tcl variable and enters a new event loop. This "inner" event loop will be left, when the speci ed variable is set. waitForVariable is commonly used for synchronization tasks.
f widgetId
alias; for arguments see: isWidget 61
f widgetName
f
f
f
f
::::::::::::::::::::::::::::::::::
wafeCvtName2Widget
Arguments: widget reference Return value: Widget The function widgetName returns the name of the speci ed widget. window XtWindow Arguments: widget whose window you want Return value: long The function window returns the window id of the speci ed widget. disownSelection XtDisownSelection Arguments: widget making the request Return value: void The command disownSelection can be used if a widget explicitly wants to disclaim its ownership of the PRIMARY selection buer. Note that the widget automatically looses the ownership, whenever an other widget claims to be the owner. The speci ed widget must be realized. getSelectionValue XtGetSelectionValue Arguments: widget making the request, Tcl command Return value: void The command getSelectionValue is used if a widget wants to retrieve the current contents of the PRIMARY selection buer. The registered command string will be executed as soon as the selection data is availaible. The global Tcl variable PRIMARY will be set to pass the requested information. The speci ed widget must be realized ownSelection wafeOwnSelectionCmd Arguments: widget that whiches to become owner of the selection, string to be put into selection, NULL j loseSelection TCL-command, NULL j doneSelection TCLcommand Return value: Boolean The function ownSelection claims ownership of the current PRIMARY selection buer for the speci ed widget (1st argument) and places the speci ed string (2nd argument) into the selection buer, such it can be "pasted" into another window. The function returns true, if the speci ed widget successfully became selection owner. The speci ed widget must be realized. This function takes two additional arguments, both of them valid Wafecommands or the constant NULL. The 3rd argument is a Wafe command to be executed, when the widget looses the ownership of the PRIMARY :::::::::::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::
:::::::::::::::::::::::::::::::::
62
f
f
f
f
buer. The 4th argument is a Wafe command which will be executed when the selection transfer process is completed (typically, when a a paste action is completed). The constant NULL means that no callback function is to be executed on these conditions. fetchBuer XFetchBuer Arguments: widget to determine display, buer number (1-7) Return value: String The function fetchBuer retrieves the contents of the speci ed cut buer of the display of the speci ed widget and returns it. fetchBytes XFetchBytes Arguments: widget to determine display Return value: String The function fetchBytes is a conveniance routine used to put the PRIMARY selection of the display of the speci ed widget into CUT BUFFER 0 and to returns it. convertSelection XConvertSelection Arguments: widget to determine display, target buer number (0 to 6) Return value: void The command convertSelection requests the current value of the PRIMARY selection and places it into the speci ed cut buer for further use. storeBuer XStoreBuer Arguments: widget to determine display, String, buer number (1-7) Return value: void The command storeBuer stores the speci ed string (2nd argument) into the speci ed cut buer (3rd arguemnt) on the display of the given widget (1st argument). ::::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::
:::::::::::::::::::::::::::::::::
:::::::::::::::::::::::::::::::::::::::::::::
f sV
alias; for arguments see: setValues
f gV
alias; for arguments see: getValue
f hooksOfDisplay
::::::::::::::::::::::::::::::::::
Arguments: widget to determine display Return value: WidgetID Min. Requirements: R6 63
XtHooksOfDisplay
The function hooksOfDisplay returns the widget ID of the Hook Object, which can be used for sV, gV, showRes etc. The speci ed widget determines the display.
f mapState
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Arguments: any widget Return value: MapState The function mapState returns the map state of the speci ed widget, which is either IsUnmapped, IsUnviewable or IsViewable. A return value of IsUnviewable indicates that the window of the speci ed widget is mapped but some ancestor is unmapped. f addWorkProc XtAppAddWorkProc Arguments: Tcl command Return value: XtWorkProcId The function addWorkProc adds the speci ed Wafe command as work procedure and returns its ID. Work procedures can be used to implement a simple form of backckground processing. Most application spend most of its time waiting for input. A work procedure can be registered which will be executed whenever Xt is idle. Unless the speci ed Wafe function returns 1, it will be restarted automatically when Xt is idle again. See Xt Intrinsics Manual for more details (XtAppAddWorkProc, XtWorkProc) f removeWorkProc XtRemoveWorkProc Arguments: work proc ID Return value: void The command removeWorkProc removes a work procedure with the speci ed ID, which was returned by the function addWorkProc. f isShell XtIsShell Arguments: widget Return value: Boolean The function isShell test whether the speci ed widget is a shell widget and returns the boolean value 0 or 1. :::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::::::
f getActionList
:::::::::::::::::::::::::::::::::::::::::::::::::::::::
Arguments: widget Return value: String Min. Requirements: R5 The function getActionList returns the names of the actions associated with the speci ed widget. f atomName wafeGetAtomName ::::::::::::::::::::::::::::::::::::::
64
f
f
f
f
f
Arguments: widget to determine display, atom Return value: String The function atomName return the name of an atom. It never creates a new atom. If the atom does not exist an empty string is returned. Currently, this function cannot be used to obtain names for invalid atom ids. atomId wafeStringToAtom Arguments: widget to determine display, atom Return value: AtomID The function atomId returns the atom ID of an atom. If the atom does not exist, a new atom with the given name is created. isAtom wafeStringToAtomChk Arguments: widget to determine display, atom Return value: AtomID The function isAtomId checks, whether an atom with the speci ed name exists. On failure the function returns 0. Currently, isAtomId function cannot be used to check invalid atom ids. motifWMRunning wafeMWMrunning Arguments: any shell widget Return value: Boolean The function motifWMRunning returns 1 when an OSF/Motif compliant window manager (eg mwm or dtwm is running), otherwise 0. The provided argument can be any shell of the application (eg. topLevel). reparentWindow XReparentWindow Arguments: widget to reparent, new parent, x coordinate, y coordinate Return value: void The procedure reparentWindow modi es the window hierarchy by placing the window of the widget speci ed as second argument under the window of the widget speci ed as second argument. The speci ed widgets must be realized. isManaged XtIsManaged Arguments: Widget Return value: Boolean The function isManaged determines whether the speci ed widget is currently managed by its parent or not :::::::::::::::::::::::::::::::::::::::::::
:::::::::::::::::::::::::::::::::::::::
:::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::
:::::::::::::::::::::::::::::::::::::::::::::
65
f getDomain
::::::::::::::::::::::::::::::::::::::::::
wafeGetDomain
Arguments: resource type Return value: String The function getDomain returns the domain (all possible values) for a resource Type (1st argument) with enumerable values. Currently this function is only available for Motif resources, but it is planned to extend this functionality for other resource types as well. The resource type of a resource is documented in the widget documentation (eg. man pages) and can be obtained dynamically using the command getTypeOfAttribute Widget attributeName. Additionally the command showRes Widget prints this information on the screen.
f screen
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Arguments: sub command, widget to determine display Return value: void The function screen returns various information about the display of the speci ed widget (2nd argument) depending on the speci ed sub-command (1st argument). Valid sub commands are: blackPixel cells height heightMM name planes rootWindow whitePixel width widthMM
f isClass
value of a black pixel max. number of color cells height of screen height of screen in millimeters name denoting screen (typically value of DISPLAY) number of planes window id of root window value of a white pixel width of screen width of screen in millimeters
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Arguments: command name Return value: Boolean The function isClass returns 1 when the speci ed argument refers to a currently available widget creating command that will create a widget of the given class. Note that for systems supporting dynamic loading only the currently available commands are taken into account. If the speci ed string does not refer to an available widget class the command returns 0.
f isClassComposite
:::::::::::::::::::::::::::::::::::::::::::::::::::
Arguments: command name Return value: Boolean The function isClassComposite returns 1 when the speci ed argument refers to a widget class which is available and composite. for more details see command isClass. 66
A.2 Xpm Library for multicolored images The commands listed in this section are available in Motif or Athena versions of Wafe. f changePixmap
::::::::::::::::::::::::::::::::::
wafeChangePixmap
Arguments: widget, resource, pixmap le Return value: void Min. Requirements: XPM The command changePixmap sets a attribute of type Pixmap (2nd argument) of a widget (1st argument) to the speci ed image (3rd argument). changePixmap keeps track of converted pixmaps by maintaining its own pixmap cache. A pixmap can be released by setting the attribute to another pixmap or to one of the following values: None, ParentRelative, or Unspeci ed. If there are no references to a pixmap, all resources (allocated memory as well as color cells) of the pixmap are released. changePixmap can handle shaped pixmaps signi cantly better then sV where Xt's cacheing mechanism can prevent shaping of windows. When the attribute name is iconPixmap the icon pixmap for any shell widget can be set; please note, that if the window manager mwm (or a derivative of it) is used the icon pixmap must be set before the shell is realized, otherwise the window manager will provide it own (unaccesible) icon window. If error conditions occur changePixmap raises a Tcl exception, which can be caught by the Tcl command catch.
f setBusy
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Arguments: shell widget, sensitive true j false Return value: void The command setBusy sets the given widget (typically a shell widget) and its children busy or not, depending on the boolean state argument (2nd argument). If a widget is set busy, a busy-cursor is set and input is inhibited for all children widgets. The appearance of the children widgets will not change. If a shell is set busy and set non-busy some time later, all the sensitivity states before the setBusy command are reestablished. Per default a watch is used as the busy cursor; the default busy cursor can be altered by the command setDefaultBusyCursor. In order to change only the cursor (for any widget) without prohibiting input, use the command setCursor.
f isBusy
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Arguments:
Widget to test 67
Return value: Boolean The function isBusy returns the busy state of the speci ed widget.
f setCursor
Arguments:
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
widget, cursor name, optional foreground, optional background Return value: void The command setCursor can be used to change the cursor in the speci ed widget. The name of the cursor (2nd argument) can refer to the name of a cursor in the cursor font (e.g. "pirate") or it can refer to a x bitmap le (.xbm- le). If there exists a mask le with the same name, and "msk" or "Mask" appended, in the same directory it is used as a mask for the cursor. An x bitmap le is searched along FILESEARCHPATH. Optionally the forground color of the cursor can be speci ed as third argument, the background color can be optionally speci ed as the fourth argument.
A.3 Athena Widgets and Commands In order to compile Wafe with support for the commands listed in this section use the ag ATHENA during compilation. w Text : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : The Text widget class can be used to display and edit one or more lines of
text. Options are provided to add Scrollbars, search for a speci c string and to modify the text in the edit buer.
f XawAsciiSave
:::::::::::::::::::::::::::::::::::::::::::::::::::::::
Arguments: ascii text widget Return value: Boolean The command XawAsciiSave saves the contents of the speci ed Athena Text widget into a le and returns on success 1 and on failure 0. This function only works, when the type resource of the speci ed Text widget is set to le, as lename the value of the resource string is taken. If the buer has not been changed, no action will be taken.
f XawAsciiSaveAsFile : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments: ascii text widget, le name Return value: Boolean The command XawAsciiSaveAsFile saves the contents of the speci ed Athena Text widget into a le and returns on success 1 and on failure 0. This function works, when the type resource of the speci ed Text widget is either set to string or to le. 68
f XawAsciiSourceChanged : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments: ascii text widget Return value: Boolean The command XawAsciiSourceChanged is used to gure out, whether the text buer has changed since it was saved the last time with XawAsciiSave or has been queried using XawAsciiSourceChanged. The internal change
ag is reset whenever the string is queried via getValue or the buer is saved via XawAsciiSave.
f XawAsciiSourceFreeString : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments: ascii text widget Return value: void The command XawAsciiSourceFreeString can be used to free the memory allocated by the Text widget explicitly during getValue for the string resource or whenever the widget is saved. Note, that this function is performed automatically whenever a next getValue for the string resource is performed or when the widget is destroyed. This function should only be called when the resource useStringInPlace is false.
w Box
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
The Box widget class is a geometry manager that packs its children as tight as possible in non-overlapping rows and columns. The children are rearranged when resizing events occur either on the Box or its children or when children are managed or unmanaged.
w Clock : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : The Clock widget class displays the current time either as analog clock or as time string depending on the value of the analog resource. w Command : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : The Command widget class is used for push buttons that, when selected,
may cause a speci c action to take place. This widget can display a multiline string or a bitmap or pixmap image.
w Dialog : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : The Dialog widget class is a commonly used composite widget to prompt
for auxiliary input from the user (such as a le name).
f XawDialogGetValueString
:::::::::::::::::::::::::::::::::::::::::
Arguments: dialog widget Return value: String The function XawDialogGetValueString returns the character string from the text input eld of a Dialog widget. 69
w Form : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : The Form widget class is a more sophisticated geometry manager that
allows its children to specify their positions relative to other children or to the edges of the form.
f XawFormDoLayout : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments: form widget, boolean Return value: void The command XawFormDoLayout is used to force or defer a re-layout of the Form widget.
w Grip : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : The Grip widget class provides a rectangle that, when selected, will cause
an action to take place.
w Label : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : The Label widget class provides a rectangle that can display a multi-line
string or a bitmap or pixmap image.
w List
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
c callback %i index c callback %s selection The List widget class is used to display a list of text strings in a row column format, where each text string can be individually selected. When an element is selected, an action may be provided to take place. f XawListAppend listAppend Arguments: list widget, items Return value: void The command XawListAppend can be used to append one or more list items to the elements already existing in a List widget. f XawListChange listChange Arguments: list widget, number of items, longest, resize, List list j Arg items j File lename Return value: void The command XawListChange changes the items of list widget. If the number of items (2nd argument) or the length of the longest item (3rd argument) contain a value less than one, the actual values will be computed automatically. If the 4th argument is the string List, a Tcl list of items is expected as next argument. If it is Arg, following arguments are treated as list items. If the 4th argument is File, the items are read from the le named by the 5th argument. :::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::
70
f XawListHighlight : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments: list widget, item number Return value: void The command XawListHighlight highlights (inverts) the nth list item indicated by the 2nd argument.
f XawListShowCurrent
::::::::::::::::::::::::::::::::::::::::::::::
Arguments: list widget Return value: XawListReturnStruct * The function XawListShowCurrent returns information about the currently selected list item. The command returns a lename of an associative array containing the element string and list index.
f XawListUnhighlight
::::::::::::::::::::::::::::::::::::::::::::::::
Arguments: list widget Return value: void The command XawListUnhighlight turns the highlight status of the current selected item o.
w Logo : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : The Logo widget class can be used to display an X logo in various sizes. w Mailbox : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : The Mailbox widget class can be used to watch the status of a le (typically
the mailbox) and to change a bitmap, when it is altered.
w MenuButton : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : The MenuButton widget class is used for push buttons that, when selected, will pop up the menu named in the resource menuName. This widget can
display a multi-line string or a bitmap or pixmap image.
w Paned : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : The Paned widget class allows children to be tiled vertically or horizon-
tally. Controls are also provided to allow the user to dynamically resize the individual parts.
f XawPanedAllowResize
:::::::::::::::::::::::::::::::::::::::::::::
Arguments: child of paned widget, boolean Return value: void The command XawPanedAllowResize is used to enable to disable a child's request for pane resizing. This command is equivalent to changing the allowResize constraint resource for the child. 71
f XawPanedGetMinMax
:::::::::::::::::::::::::::::::::::::::::::::
Arguments: child of paned widget, min, max Return value: void The command XawPanedGetMinMax is used retrieve the minimum and maximum height settings for a child pane. This command is equivalent to getting the min and max constraint resources for the child.
f XawPanedGetNumSub : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments: paned widget Return value: int The function XawPanedGetNumSub returns the number of panes in a paned widget,
f XawPanedSetMinMax
:::::::::::::::::::::::::::::::::::::::::::::
Arguments: child of a paned widget, min, max Return value: void The command XawPanedSetMinMax is used set the minimum and maximum height settings for a child pane. This command is equivalent to setting the min and max constraint resources for the child.
f XawPanedSetRe gureMode
:::::::::::::::::::::::::::::::::::::::
Arguments: paned widget, boolean Return value: void The command XawPanedSetRe gureMode enables or disables the automatic calculation of pane sizes and pane positions (e.g., when multiple changes are expected for child panes)
w Scrollbar : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
c scrollProc %p position of thumb (in pixel) c jumpProc %p oating position (0.0-1.0) The Scrollbar widget class provides a rectangular area containing a thumb that when slid among one dimension may cause a speci c action to take place. The Scrollbar may be oriented horizontally or vertically.
f XawScrollbarSetThumb : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments: Scrollbar widget, top, shown Return value: void The command XawScrollbarSetThumb sets the position and length of a Scrollbar thumb. The 2nd (top) and 3rd (shown) arguments are oats in the range between 0.0 and 1.0 to change its values. Either top or shown can be speci ed as -1.0 in which case the current value is left unchanged. 72
f scSet
alias; for arguments see: XawStripChartSet
w Simple : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : The Simple widget class provides a rectangular area with a set-able mouse
cursor and a special border. It is the base class of most of the Athena simple widget classes.
w SimpleMenu : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : The SimpleMenu widget class provides a container for menu entries. It
is a direct subclass of Shell, is the only part of a menu associated with a window and serves as a glue to bind individual menu entries together.
f XawSimpleMenuAddGlobalActions : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments: Return value: void The procedure XawSimpleMenuAddGlobalActions registers the global action routine XawPositionSimpleMenu which can be used to position a menu centered over the cursor. If the resource popupOnEntry of the SimpleMenuWidget is set, the menu will be placed so that the pointer is centered over the speci ed menu entry. Example translation: !Ctrl: XawPositionSimpleMenu(myMenu) MenuPopup(myMenu)
f XawSimpleMenuClearActiveEntry : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments: widget Return value: void The procedure XawSimpleMenuClearActiveEntry is used to clear the SimpleMenu widget's internal information about the currently highlighted menu entry.
f XawSimpleMenuGetActiveEntry : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments: widget Return value: WidgetID The function XawSimpleMenuGetActiveEntry returns the widget ID of the currently active menu entry (or 0, if none is active)
w Sme
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
The object class Sme is the base class of all menu entries. It can be used as a menu entry itself to provide a blank space in a menu. Sme stands for Simple Menu Entry. 73
w SmeBSB
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
The object class SmeBSB provides a select-able menu entry containing a text string. A bitmap may also be placed in the left and right margins. SmeBSB stands for 'Simple Menu Entry Bitmap String Bitmap'.
w SmeLine
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
The object class SmeLine provides a non select-able menu entry containing a separator line.
w StripChart : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : The StripChart widget class provides a real time data graph that will
automatically update and scroll.
f XawStripChartSet : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : stripChartSet
Arguments: strip chart widget, value Return value: void The command XawStripChartSet is used to specify a StripChart widget's current value. The widget will plot a graph of this value every n seconds, where n is the value of the update resource of the StripChart widget.
f XawTextDisableRedisplay
:::::::::::::::::::::::::::::::::::::::::
Arguments: ascii text widget Return value: void The command XawTextDisableRedisplay causes all changes to be batched until either XawTextDisplay or XawTextEnableRedisplay is called.
f XawTextDisplay
::::::::::::::::::::::::::::::::::::::::::::::::::::
Arguments: ascii text widget Return value: void The command XawTextDisplay forces all accumulated updates to be displayed (see also: XawTextDisableRedisplay).
f XawTextDisplayCaret : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments: ascii text widget, boolean Return value: void The command XawTextDisplayCaret is used to enable and disable the display of the insertion point marker. The same functionality can be achieved by setting the resource displayCaret or by the action routine display-caret.
f XawTextEnableRedisplay
Arguments:
::::::::::::::::::::::::::::::::::::::::::
ascii text widget 74
Return value: void The command XawTextEnableRedisplay is used to enable display of changes in the speci ed Text widget.
f XawTextGetInsertionPoint
::::::::::::::::::::::::::::::::::::::::
Arguments: ascii text widget Return value: XawTextPosition The function XawTextGetInsertionPoint returns the current position of the insertion point. The same functionality can be achieved by retrieving the resource value for insertPosition via getValue.
f XawTextGetSelectionPos
Arguments:
::::::::::::::::::::::::::::::::::::::::::
ascii text widget, variable name for start position, variable name for end position Return value: void The procedure XawTextGetSelectionPos returns the start and end position of the current selection of the speci ed text widget in the variables given in the second and third argument. If the returned values are equal, no text is currently selected.
f XawTextInvalidate
:::::::::::::::::::::::::::::::::::::::::::::::::
Arguments: ascii text widget, start position, end position Return value: void The procedure XawTextInvalidate causes the text in the speci ed range to be redisplayed immediately (if redisplay is disabled, this will happen when redisplay is enabled again; see also: XawTextDisableRedisplay);
f XawTextSearch
Arguments:
:::::::::::::::::::::::::::::::::::::::::::::::::::::
ascii text widget, scan direction ('left' or 'right'), text block Return value: XawTextPosition The function XawTextSearch searches from the position of the current insertion point for the text string passed in the text block (last argument) in the speci ed direction (2nd argument). If the search was successful, a value greater or equal 0 is returned. if the search was not successful, a negative value is returned.
f XawTextSetInsertionPoint : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments: ascii text widget, position Return value: void The procedure XawTextSetInsertionPoint moved the insertion point to the speci ed location. The same functionality can be achieved by setting the resource insertPosition via setValues. 75
f XawTextSetSelection : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments: ascii text widget, begin position, end position Return value: void The procedure XawTextSetSelection highlights the text between the speci ed positions and makes it as well the PRIMARY selection. This procedure has no eect on CUT BUFFER0.
f XawTextSetSelectionArray
::::::::::::::::::::::::::::::::::::::::
Arguments: ascii text widget, selection array Return value: void The procedure XawTextSetSelectionArray sets the selection array for the speci ed Text widget. The selection array determines the selection behavior on single, double, triple and so on clicks with the left mouse button in the text widget. The nth position in this array determines the behavior on the nth click. Possible values in this array are: selectAll, selectChar, selectLine, selectParagraph, selectPosition, selectWord and selectNull. The selection array is always terminated by selectNull. Example: XawTextSetSelectionArray $w selectLine selectPosition selectNull
f XawTextSinkFindDistance : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments:
ascii text widget, from position, reference location (in pixel), to position, resulting width (in pixel), distance in positions, resulting height (in pixel) Return value: void The procedure XawTextSinkFindDistance returns the position between text positions of the speci ed widget.
f XawTextSinkMaxHeight
:::::::::::::::::::::::::::::::::::::::::::
Arguments: ascii text widget, lines Return value: int The function XawTextSinkMaxHeight returns the height in pixel that will be taken up by the speci ed number of lines (2nd argument)
f XawTextSinkMaxLines : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments: ascii text widget, height Return value: int The function XawTextSinkMaxLines returns the number of lines that will t into the speci ed height.
f XawTextSinkSetTabs : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments:
ascii text widget, tabs 76
Return value: void The procedure XawTextSinkSetTabs sets the tab stops of the speci ed widget.
f XawTextSourceRead
Arguments:
:::::::::::::::::::::::::::::::::::::::::::::::
ascii text widget, position, variable name for text block, length Return value: XawTextPosition The function XawTextSourceRead is used to retrieve a portion of the text displayed by a ascii text widget. The 2nd argument speci ed the start position, the 4th argument the desired length of the text portion. The function returns the actual number of characters retrieved (which might be less the desired length, in which case another XawTextSourceRead request must be issued). The third argument returns the retrieved text block (the elds ptr, length and rstPos of the speci ed array name are lled out).
f XawTextSourceScan
Arguments:
::::::::::::::::::::::::::::::::::::::::::::::::
ascii text widget, position, boundary type, scan direction, count, include (boolean) Return value: XawTextPosition The function XawTextSourceScan is used to search the text for boundary types (position, whiteSpace, EOL, paragraph, all) in the speci ed direction (left or right). The 4th argument speci ed the number of boundaries to scan for, the 5th argument speci es, whether the boundary itself should be included in the scan. The function returns the text position of the desired boundary or the closest valid text position.
f XawTextTopPosition
:::::::::::::::::::::::::::::::::::::::::::::::
Arguments: ascii text widget Return value: XawTextPosition The function XawTextTopPosition returns the character position of the left most character of the rst line displayed in the speci ed widget. The same functionality can be achieved by retrieving the resource value for displayPosition via getValue.
f XawTextReplace
Arguments:
::::::::::::::::::::::::::::::::::::::::::::::::::::
ascii text widget, from position, to position, text block Return value: int The function XawTextReplace is used to modify edit-able text. The text of the widget between the start and the end position (2nd and third argument) will be replaced by the text form the speci ed text block (4th 77
argument). The function returns editDone when it was successful, positionError when the editMode is append and the from position is not the last position of the text or editError on other errors.
f XawTextUnsetSelection : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments: ascii text widget Return value: void The procedure XawTextUnsetSelection un-highlights previously highlighted text in the speci ed widget.
w Toggle : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : The Toggle widget class is used for push buttons that,contain a state
information (pressed or un-pressed). When a Toggle is selected a speci c action may take place. Toggles may also be used as radio buttons to implement one of many or 'zero or one of many' groups of buttons. This widget can display a multi-line string or a bitmap or pixmap image.
f XawToggleChangeRadioGroup
::::::::::::::::::::::::::::::::::::
toggle widget, NULL j any toggle widget of a radio group Return value: void The procedure XawToggleChangeRadioGroup can be used to change the radio group of a Toggle widget, to add a Toggle widget to a radio group or to remove a Toggle widget from a radio group (second argument NULL) Arguments:
f XawToggleGetCurrent
:::::::::::::::::::::::::::::::::::::::::::::
Arguments: any toggle widget of a radio group Return value: String The function XawToggleGetCurrent returns the radio data of the currently active widget of the speci ed radio group.
f XawToggleSetCurrent : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments: any toggle widget of a radio group, radio data Return value: void The procedure XawToggleSetCurrent locates the toggle widget to be set by matching the speci ed radio data for each toggle in the radio group. If more than one widget matches, one toggle widget will be chosen arbitrarily. If this procedure causes any toggle widget to change its state, the corresponding callback routines will be called. The callback routines for unset will be called before the routines for set. f XawToggleSetRadioData toggleSetRadioData Arguments: toggle widget, radio data ::::::::::::::::::::::
78
Return value: void The procedure XawToggleSetRadioData sets the radio data for the speci ed widget.
f XawToggleUnsetCurrent : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments: any toggle widget of a radio group Return value: void The procedure XawToggleUnsetCurrent unsets all toggles in a radio group. If this procedure causes any toggle widget to change its state, the corresponding callback routines will be called
w Viewport : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : The Viewport widget class provides means to view a larger window in a
smaller area. It consists of a frame, one or two Scrollbars and an inner window. The inner window will be clipped by the frame with the Scrollbars controlling which section of the inner window is current visible.
f XawViewportSetCoordinates : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments: Viewport Widget, x position, y position Return value: void Min. Requirements: R5|XAW3D The procedure XawViewportSetCoordinates is used to set the x and y position in a Viewport widget. argument two and three are pixel coordinate values.
f XawViewportSetLocation : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments: Viewport Widget, x oset, y oset Return value: void Min. Requirements: R5|XAW3D The procedure XawViewportSetLocation is used to set Viewport location. the speci ed values are in the range between 0.0 and 1.0, where 0.0 is the minimum value (pixel value 0) and 1.0 is the maximum value (maximum pixel height or width).
A.4 Athena R5 Widgets and Commands In order to compile Wafe with support for the commands listed in this section use the ag ATHENA during compilation. w Panner : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : The Panner widget class provides a retangular area containing a slider
that may be moved in two dimensions. The noti cation of changes may be continuous or discrete. 79
w Porthole : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : The Porthole widget class allows viewing of a managed child which is as
large as or larger than its parent, typically under the control of a Panner widget.
f XawTalk
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Arguments: panner, porthole, managed widget Return value: void The command XawTalk is used to put a typically large window (3rd argument) under the control of a Panner (1st argument) and Porthole widget (2nd argument), where the Panner functions as two dimensional scrollbar.
w Repeater : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : The Repeater widget class is used for push buttons that tigger an action
at an increasing rate when selected. This widget can display a multi-line string or a bitmap or pixmap image.
w Tree : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : The Tree widget class provides geometry management of widgets arranged
in a tree structure.
f XawTreeForceLayout
:::::::::::::::::::::::::::::::::::::::::::::::
Arguments: tree Widget Return value: void The command XawTreeForceLayout is used to force a re-layout of the Tree widget. This command should be used when the resource autoRecon gure of the Tree widget is set to false.
A.5 Motif Revision 1.1 Widgets and Commands The Commands described in this section are available in versions for Wafe compiled with Motif Version 1.1 or newer. In order to compile Wafe with support for the commands listed in this section use the ag MOTIF during compilation. f XmAddTabGroup
Arguments: Return value:
w XmArrowButton
::::::::::::::::::::::::::::::::::::::::::::::::::
widget to be added void :::::::::::::::::::::::::::::::::::::::::::::::::::
c activateCallback
w XmArrowButtonGadget
%c
click count
:::::::::::::::::::::::::::::::::::::::::::
80
c activateCallback
%c
click count
w XmBulletinBoard : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : w XmBulletinBoardDialog : : : : : : : : : : : : : XmCreateBulletinBoardDialog
for callbacks and functions see: XmBulletinBoard
w XmCascadeButton : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : w XmCascadeButtonGadget : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : f XmCascadeButtonGadgetHighlight : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments: Return value:
cascadeButtonGadget to be highlighted, highlight (bool) void
Arguments: Return value:
widget to be highlighted, highlight (bool) void
f XmCascadeButtonHighlight : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : w XmCommand
:::::::::::::::::::::::::::::::::::::::::::::::::::::::
c commandChangedCallback
commandEnteredCallback %s f XmCommandAppendValue
command string
::::::::::::::::::::::::::::::::::::::::
Arguments: Return value:
command widget, command string void
f XmCommandError
:::::::::::::::::::::::::::::::::::::::::::::::::
Arguments: Return value:
command widget, error message void
Arguments: Return value:
command widget, child reference WidgetID
f XmCommandGetChild : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : w XmDialogShell : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : w XmDrawingArea : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
c exposeCallback
inputCallback resizeCallback
%i
occured
w XmDrawnButton
id of the window where event
:::::::::::::::::::::::::::::::::::::::::::::::::::
c activateCallback
%c 81
click count
c exposeCallback
resizeCallback
%i
occured
w XmErrorDialog
id of the window where event
:::::::::::::::::::::::::::::::
for callbacks and functions see: XmMessageBox
XmCreateErrorDialog
w XmFileSelectionBox : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
c okCallback
noMatchCallback applyCallback leSearchProc dirSearchProc c okCallback noMatchCallback applyCallback leSearchProc dirSearchProc c okCallback noMatchCallback applyCallback leSearchProc dirSearchProc c okCallback noMatchCallback applyCallback leSearchProc dirSearchProc f XmFileSelectionBoxGetChild
%d
base directory
%p
search pattern
%m
value of dirMask
%s
value of dirSpec
:::::::::::::::::::::::::::::::::::::
Arguments: Return value:
le selection box widget, child reference WidgetID w XmFileSelectionDialog XmCreateFileSelectionDialog for callbacks and functions see: XmFileSelectionBox ::::::::::::::::
f XmFileSelectionDoSearch : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments: Return value:
le selection box, directory mask void
w XmForm : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : w XmFormDialog : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : XmCreateFormDialog
for callbacks and functions see: XmForm 82
w XmFrame : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : f XmGetDestination : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments: any widget Return value: WidgetID The function XmGetDestination returns the widget id of the widget that would be acted on by various selection operations (paste and Clipboard routines). The function returns 0 if there is no current destination (when no edit operations have been performed on a widget). w XmInformationDialog XmCreateInformationDialog for callbacks and functions see: XmMessageBox ::::::::::::::::::
w XmLabel : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : w XmLabelGadget : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : w XmList : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
c browseSelectionCallback
defaultActionCallback singleSelectionCallback c browseSelectionCallback defaultActionCallback singleSelectionCallback c extendedSelectionCallback multipleSelectionCallback c extendedSelectionCallback multipleSelectionCallback c extendedSelectionCallback multipleSelectionCallback c browseSelectionCallback defaultActionCallback extendedSelectionCallback multipleSelectionCallback singleSelectionCallback f XmListAddItem
%s
selected item
%p
item position
%S
selected items
%P
selected item positions
%n
number of selected items
%t
selection type
::::::::::::::::::::::::::::::::::::::::::::::::::::
Arguments: Return value:
f XmListAddItems
Arguments:
List Widget, Item to add, Position void :::::::::::::::::::::::::::::::::::::::::::::::::::
List Widget, items, number of items, position 83
Return value:
void
Arguments: Return value:
List Widget, Item to add, Position void
f XmListAddItemUnselected : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : f XmListDeleteAllItems
:::::::::::::::::::::::::::::::::::::::::::::
Arguments: Return value:
List Widget void
Arguments: Return value:
List Widget, Item to delete void
Arguments: Return value:
List Widget, items, number of items void
Arguments:
List Widget, number of items, position of rst item to be deleted void
f XmListDeleteItem : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : f XmListDeleteItems : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : f XmListDeleteItemsPos : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Return value:
f XmListDeletePos
Arguments: Return value:
:::::::::::::::::::::::::::::::::::::::::::::::::::
List Widget, position of item void
f XmListDeselectAllItems
:::::::::::::::::::::::::::::::::::::::::::
Arguments: Return value:
List Widget void
Arguments: Return value:
List Widget, item void
Arguments: Return value:
List Widget, position of item void
Arguments: Return value:
List Widget, item, list of positions Boolean
f XmListDeselectItem : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : f XmListDeselectPos : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : f XmListGetMatchPos : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : f XmListGetSelectedPos : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
84
Arguments: Return value:
List Widget, list of highlighted items Boolean
f XmListItemExists
Arguments: Return value:
f XmListItemPos
Arguments: Return value:
::::::::::::::::::::::::::::::::::::::::::::::::::
List Widget, Item Boolean
:::::::::::::::::::::::::::::::::::::::::::::::::::::
List Widget, Item int
f XmListReplaceItems
Arguments:
Return value:
:::::::::::::::::::::::::::::::::::::::::::::::
List Widget, Items to be replaced, number of items to be replaced, new items void
f XmListReplaceItemsPos
Arguments:
Return value:
:::::::::::::::::::::::::::::::::::::::::::
List Widget, New items, number of items to be replaced, rst Pos of items to be replaced void
f XmListSelectItem
::::::::::::::::::::::::::::::::::::::::::::::::::
Arguments: Return value:
List Widget, item to highlight, Invoke callback yes/no void
Arguments: Return value:
List Widget, Position of item, Invoke callback yes/no void
f XmListSelectPos : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : f XmListSetAddMode
:::::::::::::::::::::::::::::::::::::::::::::::
Arguments: Return value:
List Widget, Use Add Mode yes/no void
Arguments: Return value:
List Widget, item to be displayed as last item void
f XmListSetBottomItem : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : f XmListSetBottomPos
::::::::::::::::::::::::::::::::::::::::::::::
Arguments: Return value:
List Widget, item to be displayed as last item void
Arguments: Return value:
List Widget, horizontal Position void
f XmListSetHorizPos
::::::::::::::::::::::::::::::::::::::::::::::::
85
f XmListSetItem
:::::::::::::::::::::::::::::::::::::::::::::::::::::
Arguments: Return value:
List Widget, item void
Arguments: Return value:
List Widget, Position void
f XmListSetPos : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : w XmMainWindow : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : f XmMainWindowSetAreas : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments:
main window widget, menu bar widget, command window widget, horizontal scrollbar widget, vertical scrollbar widget, work region widget Return value: void w XmMenuBar XmCreateMenuBar for callbacks and functions see: XmRowColumn :::::::::::::::::::::::::::::::::::::
w XmMenuShell : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : f XmMenuPosition : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments: Return value:
menu widget void
w XmMessageBox : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : f XmMessageBoxGetChild : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments: Return value:
message box widget, child reference WidgetID w XmMessageDialog XmCreateMessageDialog for callbacks and functions see: XmMessageBox w XmOptionMenu XmCreateOptionMenu for callbacks and functions see: XmRowColumn :::::::::::::::::::::::::
::::::::::::::::::::::::::::::
w XmPanedWindow : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : w XmPopupMenu : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : XmCreatePopupMenu
for callbacks and functions see: XmRowColumn
f XmProcessTraversal : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments:
Return value:
Widget for which to traverse hierarchy, direction in which to traverse widget hierarchy Boolean 86
w XmPromptDialog : : : : : : : : : : : : : : : : : : : : : : : : : : : XmCreatePromptDialog
for callbacks and functions see: XmSelectionBox w XmPulldownMenu XmCreatePulldownMenu for callbacks and functions see: XmRowColumn :::::::::::::::::::::::::
w XmPushButton
:::::::::::::::::::::::::::::::::::::::::::::::::::::
c activateCallback
%c
c activateCallback
%c
click count
w XmPushButtonGadget : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
click count w XmQuestionDialog XmCreateQuestionDialog for callbacks and functions see: XmMessageBox w XmRadioBox XmCreateRadioBox for callbacks and functions see: XmRowColumn ::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::
w XmRowColumn : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
c entryCallback
w XmScale
%e
widgetID where entry occured
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
c dragCallback
valueChangedCallback f XmScaleSetTicks
%v
value
:::::::::::::::::::::::::::::::::::::::::::::::::::
Arguments:
XmScale widget, number of scale values between big ticks, number of medium ticks between big values, number of small ticks between medium values, size of big ticks, size of medium ticks, size of small ticks Return value: void Min. Requirements: MOTIF20 The command XmScaleSetTicks controls the number, location and size of the tick marks on a scale. Each tick mark is implemented as a separator gadget. If tick marks are speci ed and the orientation of the XmScale widget is changed, it is necessary to destroy all children of the XmScale widget and to recreate new tick marks using XmScaleSetTicks again.
w XmScrollBar
::::::::::::::::::::::::::::::::::::::::::::::::::::::::
c toBottomCallback
toTopCallback c decrementCallback dragCallback incrementCallback
%p
87
pixel
pageDecrementCallback pageIncrementCallback toBottomCallback toTopCallback valueChangedCallback f XmScrollBarGetValues
%v
value
:::::::::::::::::::::::::::::::::::::::::::::
Arguments:
scrollbar widget, value (slider position), slider size, increment (smallest movement), page increment void
Return value:
f XmScrollBarSetValues
:::::::::::::::::::::::::::::::::::::::::::::
Arguments:
scrollbar widget, value (slider position), slider size, increment (smallest movement), page increment, notify Return value: void w XmScrolledList XmCreateScrolledList for callbacks and functions see: XmList w XmScrolledText XmCreateScrolledText for callbacks and functions see: XmText ::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::
w XmScrolledWindow : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : f XmScrollVisible : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments:
scrolled window, widget to be made visible, left-right margin for positioning, top-botton margin for positioning Return value: void Min. Requirements: MOTIF12
w XmSelectionBox
::::::::::::::::::::::::::::::::::::::::::::::::::::
c applyCallback
noMatchCallback okCallback f XmSelectionBoxGetChild
%s
value
::::::::::::::::::::::::::::::::::::::::::
Arguments: Return value:
selection box widget, child reference WidgetID w XmSelectionDialog XmCreateSelectionDialog for callbacks and functions see: XmSelectionBox ::::::::::::::::::::::::
w XmSeparator : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
88
w XmSeparatorGadget : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : w XmSimpleCheckBox : : : : : : : : : : : : : : : : : : : : : XmCreateSimpleCheckBox w w w w w
for callbacks and functions see: XmRowColumn XmSimpleMenuBar XmCreateSimpleMenuBar for callbacks and functions see: XmRowColumn XmSimpleOptionMenu XmCreateSimpleOptionMenu for callbacks and functions see: XmRowColumn XmSimplePopupMenu XmCreateSimplePopupMenu for callbacks and functions see: XmRowColumn XmSimplePulldownMenu XmCreateSimplePulldownMenu for callbacks and functions see: XmRowColumn XmSimpleRadioBox XmCreateSimpleRadioBox for callbacks and functions see: XmRowColumn :::::::::::::::::::::::
::::::::::::::::
:::::::::::::::::
:::::::::::
::::::::::::::::::::::
w XmText
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
c losingFocusCallback
modifyVerifyCallback motionVerifyCallback c losingFocusCallback modifyVerifyCallback motionVerifyCallback c losingFocusCallback modifyVerifyCallback c losingFocusCallback modifyVerifyCallback c modifyVerifyCallback f XmTextClearSelection
%i
position of insert cursor
%n
new position of insert cursor
%f
startPos (from)
%t %s
endPos (to) text
:::::::::::::::::::::::::::::::::::::::::::::
Arguments: Return value:
f XmTextCopy
Arguments: Return value:
f XmTextCut
Arguments: Return value:
Text widget void
::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Text widget Boolean
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Text widget Boolean 89
f XmTextDisableRedisplay
::::::::::::::::::::::::::::::::::::::::::
Arguments: XmText widget Return value: void Min. Requirements: MOTIF12
f XmTextEnableRedisplay : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments: XmText widget Return value: void Min. Requirements: MOTIF12
w XmTextField
::::::::::::::::::::::::::::::::::::::::::::::::::::::::
c losingFocusCallback
modifyVerifyCallback motionVerifyCallback c losingFocusCallback modifyVerifyCallback motionVerifyCallback c losingFocusCallback modifyVerifyCallback c losingFocusCallback modifyVerifyCallback c modifyVerifyCallback f XmTextFieldClearSelection Arguments: Return value:
f XmTextFieldCut
Arguments: Return value:
position of insert cursor
%n
new position of insert cursor
%f
startPos (from)
%t %s
endPos (to) text
::::::::::::::::::::::::::::::::::::::::
Text eld widget void
f XmTextFieldCopy
Arguments: Return value:
%i
::::::::::::::::::::::::::::::::::::::::::::::::::
Text eld widget Boolean :::::::::::::::::::::::::::::::::::::::::::::::::::
Text eld widget Boolean
f XmTextFieldGetBaseline
::::::::::::::::::::::::::::::::::::::::::
Arguments: Return value:
Text eld widget int
Arguments: Return value:
Text eld widget XmTextPosition
f XmTextFieldGetLastPosition : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
90
f XmTextFieldGetSelection
Arguments: Return value:
:::::::::::::::::::::::::::::::::::::::::
Text eld widget String
f XmTextFieldGetSelectionPosition
::::::::::::::::::::::::::::::::
Arguments: Return value:
Text eld widget, left boundary, right boundary Boolean
Arguments: Return value:
Text eld widget String
Arguments:
Return value:
Text eld widget, character position, text string to be inserted void
Arguments: Return value:
Text eld widget Boolean
f XmTextFieldGetString : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : f XmTextFieldInsert
:::::::::::::::::::::::::::::::::::::::::::::::::
f XmTextFieldPaste : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : f XmTextFieldPosToXY
Arguments:
:::::::::::::::::::::::::::::::::::::::::::::
Return value:
Text eld widget, character position, x coord relative to top left, y coord relative to top left Boolean
Arguments: Return value:
Text eld widget Boolean
f XmTextFieldRemove : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : f XmTextFieldReplace
Arguments:
Return value:
:::::::::::::::::::::::::::::::::::::::::::::::
Text eld widget, from character position, to character position, insert string void
f XmTextFieldSetAddMode
:::::::::::::::::::::::::::::::::::::::::
Arguments: Return value:
Text eld widget, true j false void
Arguments:
Text eld widget, from character position, to character position, HIGHLIGHT NORMAL j HIGHLIGHT SELECTED j HIGHLIGHT SECONDARY SELECTED void
f XmTextFieldSetHighlight : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Return value:
91
f XmTextFieldSetInsertionPosition : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments: Return value:
Text eld widget, character position void
f XmTextFieldSetSelection
Arguments:
::::::::::::::::::::::::::::::::::::::::::
Return value:
Text eld widget, from character position, to character position void
Arguments: Return value:
Text eld widget, character position to display void
f XmTextFieldShowPosition : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : f XmTextFieldXYToPos
Arguments:
Return value:
:::::::::::::::::::::::::::::::::::::::::::::
Text eld widget, x coord relative to top left, y coord relative to top left void
f XmTextFindString
:::::::::::::::::::::::::::::::::::::::::::::::::
XmText widget, start position, search string, TEXT FORWARD j TEXT BACKWARD, start position of the found string Return value: Boolean Min. Requirements: MOTIF12
Arguments:
f XmTextGetBaseline : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments: Return value:
Text widget int
f XmTextGetLastPosition
Arguments: Return value:
:::::::::::::::::::::::::::::::::::::::::::
Text widget XmTextPosition
f XmTextGetSelection
:::::::::::::::::::::::::::::::::::::::::::::::
Arguments: Return value:
Text widget String
Arguments: Return value:
Text widget, left boundary, right boundary Boolean
Arguments: Return value:
Text widget String
f XmTextGetSelectionPosition : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : f XmTextGetString
::::::::::::::::::::::::::::::::::::::::::::::::::
92
f XmTextInsert
:::::::::::::::::::::::::::::::::::::::::::::::::::::::
Arguments:
Text widget, character position, text string to be inserted void
Return value:
f XmTextPaste
Arguments: Return value:
:::::::::::::::::::::::::::::::::::::::::::::::::::::::
f XmTextPosToXY
Arguments:
Text widget Boolean :::::::::::::::::::::::::::::::::::::::::::::::::::
Return value:
Text widget, character position, x coord relative to top left, y coord relative to top left Boolean
Arguments: Return value:
Text widget Boolean
Arguments:
Text widget, from character position, to character position, insert string void
f XmTextRemove : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : f XmTextReplace : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Return value:
f XmTextScroll
:::::::::::::::::::::::::::::::::::::::::::::::::::::::
Arguments: Return value:
Text widget, number of lines to scroll void
Arguments: Return value:
Text widget, true j false void
f XmTextSetAddMode : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : f XmTextSetHighlight
Arguments:
:::::::::::::::::::::::::::::::::::::::::::::::
Return value:
Text widget, from character position, to character position, HIGHLIGHT NORMAL j HIGHLIGHT SELECTED j HIGHLIGHT SECONDARY SELECTED void
Arguments: Return value:
Text widget, character position void
Arguments:
Text widget, from character position, to character position
f XmTextSetInsertionPosition : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : f XmTextSetSelection : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
93
Return value:
void
f XmTextShowPosition
Arguments: Return value:
f XmTextXYToPos
Arguments:
Return value:
w XmToggleButton
::::::::::::::::::::::::::::::::::::::::::::::
Text widget, character position to display void :::::::::::::::::::::::::::::::::::::::::::::::::::
Text widget, x coord relative to top left, y coord relative to top left void :::::::::::::::::::::::::::::::::::::::::::::::::::
c valueChangedCallback
f XmToggleButtonGetState
%s
state
:::::::::::::::::::::::::::::::::::::::::
Arguments: Return value:
toggle button widget Boolean
Arguments: Return value:
toggle button widget, state (bool), notify (bool) void
f XmToggleButtonSetState : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : w XmToggleButtonGadget
:::::::::::::::::::::::::::::::::::::::::::
c valueChangedCallback
%s
f XmToggleButtonGadgetGetState
state
:::::::::::::::::::::::::::::::::
Arguments: Return value:
toggle button gadget Boolean
Arguments: Return value:
toggle button gadget, state (bool), notify (bool) void
f XmToggleButtonGadgetSetState : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : f XmUpdateDisplay : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments: Return value:
widget to determine display void w XmWarningDialog XmCreateWarningDialog for callbacks and functions see: XmMessageBox w XmWorkingDialog XmCreateWorkingDialog for callbacks and functions see: XmMessageBox f XmAddProtocol wafeAddProtocol :::::::::::::::::::::::::
:::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::
94
Arguments:
widget associated with protocol, property atom, protocol atom Return value: void f XmAddProtocolCallback wafeAddProtocolCallback Arguments: widget associated with protocol, property atom, protocol atom, command to be executed Return value: void ::::::::::::::::
f XmActivateProtocol
Arguments:
Return value:
:::::::::::::::::::::::::::::::::::::::::::::::
widget associated with protocol, property atom, protocol atom void
f XmDeactivateProtocol
:::::::::::::::::::::::::::::::::::::::::::::
Arguments:
widget associated with protocol, property atom, protocol atom Return value: void f XmTextSetSelectionArray wafeTextSetSelectionArray Arguments: motif text widget, selection array Return value: void The procedure XmTextSetSelectionArray sets the selection array for the speci ed XmText widget. The selection array determines the selection behavior on single, double, triple and so on clicks with the left mouse button in the text widget. The nth position in this array determines the behavior on the nth click. Possible values in this array are: SELECT POSITION, SELECT WHITESPACE, SELECT WORD, SELECT LINE, SELECT PARAGRAPH and SELECT ALL. Example: XmTextSetSelectionArray $w SELECT WORD SELECT LINE f XmTextFieldSetSelectionArray wafeTextSetSelectionArray Arguments: motif text eld widget, selection array Return value: void The procedure XmTextFieldSetSelectionArray sets the selection array for the speci ed XmTextField widget. The selection array determines the selection behavior on single, double, triple and so on clicks with the left mouse button in the text widget. The nth position in this array determines the behavior on the nth click. Possible values in this array are: SELECT POSITION, SELECT WHITESPACE, SELECT WORD, SELECT LINE, SELECT PARAGRAPH and SELECT ALL. Example: XmTextFieldSetSelectionArray $w SELECT WORD SELCT LINE ::::::::::::::
::::::::
95
f XmModifyVerifyCBset : : : : : : : : : : : : : : : : : : : : : wafeModifyVerifyCBset
Arguments: Return value:
doit, currInsert, startPos, endPos, String void f XmInstallImage wafeInstallImage Arguments: widget to determine display and background color for shaped images, lename or data, short name Return value: Boolean The function XmInstallImage install the image (2nd argument) with the speci ed short name (3rd argument) for the display of the Widget given in the rst argument. The Image can be a name of a .xbm le, the name of a .xpm le, or the content of an .xpm le. If the function succeeds, it returns "1", otherwise "0". The images are added to Motif's internal cache, which is used in string to Pixmap or string to Bitmap conversions. Xpm les are only supported, when Wafe was compiled with XPM support. f XmUninstallImage uninstallImage Arguments: image name Return value: Boolean The function XmUninstallImage removes the named image from the image cache and returns "1" on success, "0" otherwise. When shaped images are added by the converter to the cache, it uses as background color the widgets background color. If the same shaped image is used on a widget with a dierent background, or when the background color is changed, the image has to be removed from the cache to obtain a dierent background color. Note, that this ushing is only necessary, when shaped images are used without shape masks. If the widget does not provide a shape mask resource, use changePixmap for shaping. :::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::
f XmGetString
:::::::::::::::::::::::::::::::::::::::::::::::::::::::
Arguments: widget, resource name Return value: String The function XmGetString returns the value of the speci ed resource (which must be of type XmString or String) in the speci ed widget in form of a string without any tags.
f XmChangeColor
Arguments:
::::::::::::::::::::::::::::::::::::::::::::::::::::
widget, color string for background 96
Return value:
void
f XmStringDraw : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : StringDraw
Arguments:
Widget to draw on, XmLabel widget or subclass (for attributes), String to be drawn, x position, y position, drawjdrawStringjdrawUnderline, optional partial underlineString Return value: void The command XmStringDraw paints the speci ed Text (3rd argument) on the widget given in the rst argument using color and font resources of the widget speci ed in the 2nd argument (must be a XmLabel or a subclass of it). The string is drawn on the x and y positions speci ed in arguments 4 and 5 The 6th argument de nes how the string is drawn. draw means that it is drawn with a transparent background, drawString means that it is drawn on a background colored rectangle, and underline means that it underlines the (portion of the) string speci ed in the 7th argument.
f textHeight : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments: Return value:
Widget, font Resource, Text String int
A.6 Motif Revision 1.2 Widgets and Commands The Commands described in this section are these introduced by Motif Version 1.2. Note that in Wafe versions compiled with Motif 1.2 the commands from sections Motif 1.1 and Motif 1.2 are available. In order to compile Wafe with support for the commands listed in this section use the ag MOTIF during compilation. w XmDragIcon : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : w XmDropSiteManager : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
dragProc dragProc dragProc dragProc dragProc w XmDragContext c dropProc c c c c c
%c %x %y %o %O
dragContext x position y position operation operations
::::::::::::::::::::::::::::::::::::::::::::::::::::
%c 97
dragContext
dropProc dropProc dropProc dropProc dropSiteEnterCallback convertProc w XmDropTransfer c transferProc c transferProc f XmDropSiteRegister c c c c c c
%x %y %o %O %s %t
x position y position operation operations dropSiteStatus target widget
:::::::::::::::::::::::::::::::::::::::::::::::::::
%d %v
destination widget value convertSpecialResources Arguments: Widget to be registered, drop site resources Return value: void f XmDropSiteUpdate convertSpecialResources Arguments: Drop site to be modi ed, drop site resources Return value: void :::::::::::::::::::::::
::::::::::::::::::::::::
f XmDropSiteUnregister : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments: Return value:
Widget to be unregistered void
f XmDropSiteStartUpdate
Arguments: Return value:
::::::::::::::::::::::::::::::::::::::::::
Widget to identify shell with multiple drop sites void
f XmDropSiteEndUpdate : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments: Return value:
Widget to identify shell with multiple drop sites void f XmDropTransferStart createDnDWidget4 Arguments: Drag Context, Drop Transfer Resources Return value: WidgetID f XmDragStart createDnDWidget5 Arguments: Widget (source for drag and drop), Drag Context Resources Return value: WidgetID ::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::
98
A.7 Motif Revision 2.0 Widgets and Commands The Commands described in this section are these introduced by Motif Version 2.0. Note that in Wafe versions compiled with Motif 2.0 the commands from sections Motif 1.1 to 2.0 are available. In order to compile Wafe with support for the commands listed in this section use the ag MOTIF20 during compilation. w XmCSText
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
c losingFocusCallback
modifyVerifyCallback motionVerifyCallback c losingFocusCallback modifyVerifyCallback motionVerifyCallback c losingFocusCallback modifyVerifyCallback c losingFocusCallback modifyVerifyCallback c modifyVerifyCallback f XmCSTextReplace
%i
position of insert cursor
%n
new position of insert cursor
%f
startPos (from)
%t %s
endPos (to) text
:::::::::::::::::::::::::::::::::::::::::::::::::
Arguments:
Compound String Text widget, from character position, to character position, insert string Return value: void w XmScrolledCSText XmCreateScrolledCSText for callbacks and functions see: XmCSText ::::::::::::::::::::::::
w XmComboBox
::::::::::::::::::::::::::::::::::::::::::::::::::::::
c selectionCallback c selectionCallback
w XmContainer
%s %p
item or text position
:::::::::::::::::::::::::::::::::::::::::::::::::::::::
c outlineChangedCallback c defaultActionCallback
%a
selectionCallback %S f XmContainerGetItemChildren
widget id of aected item
widget IDs of selected items containerGetItemChildren XmContainer widget, parent widget String :::::::::
Arguments: Return value:
99
The function XmContainerGetItemChildren returns the list of widget IDs of the children of the speci ed widget (2nd argument) in the XmContainer widget (1st argument). A child is a widget having its entryParent resource set to the speci ed widget. If the speci ed widget has no children, an empty string is returned.
f XmContainerRelayout
:::::::::::::::::::::::::::::::::::::::::::::
Arguments: XmContainer widget Return value: void The procedure XmContainerRelayout forces repositioning of all items in the speci ed Container widget according to the item's positionIndex and entryParent resources. f XmContainerReorder containerReorder Arguments: XmContainer widget, widget list Return value: void The procedure XmContainerReorder reorders the speci ed widgets according to their positionIndex constraint resource. If the layoutType resource of the container widget is OUTLINE or DETAIL, a re-layout of all items will be forced. :::::::::::::::::::::::::::::
w XmIconGadget : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : w XmNotebook : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
pageChangedCallback pageChangedCallback pageChangedCallback pageChangedCallback w XmSpinBox c modifyVerifyCallback valueChangedCallback c modifyVerifyCallback valueChangedCallback c modifyVerifyCallback valueChangedCallback c modifyVerifyCallback valueChangedCallback f XmGetXmScreen c c c c
%p %i %P %I
page number of current page widget id of current page page number of previous page widget id of previous page
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::
%s
string value
%a
widgetID of aected widget
%p
position
%b
crossed boundary
:::::::::::::::::::::::::::::::::::::::::::::::::::
Arguments:
widget to determine screen 100
Return value: WidgetID The command XmGetXmScreen returns the widgetID of the screen object associated with the speci ed widget.
A.8 XmGraph Extension to Motif Widgets The XmGraph Widget requires Motif 1.1 or newer. In order to compile Wafe with support for the commands listed in this section use the ag XMGRAPH during compilation. w XmArc
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
c arcEditedCallback %f old from c arcEditedCallback %t old to c arcEditedCallback %F new from c arcEditedCallback %T new to The XmArc widget class is to be used in cooperation with the XmGraph widget class. An arc may be undirected, directed or bidirected.
f XmArcGetPos
::::::::::::::::::::::::::::::::::::::::::::::::::::::
Arguments:
name of arc Widget, out: from x-coordiante, out: from y-corrdinate, out: to x-coordinate, out: to ycoordinate Return value: void The command XmArcGetPos returns the coordinates of the speci ed widget in the variables given in argument 2 to 4.
w XmGraph
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
c newArcCallback
newNodeCallback arcMovedCallback nodeMovedCallback defaultActionCallback selectNodeCallback selectArcCallback deselectCallback selectSubgraphCallback c newArcCallback newNodeCallback arcMovedCallback 101
%N
selected Nodes
c
nodeMovedCallback defaultActionCallback selectNodeCallback selectArcCallback deselectCallback selectSubgraphCallback newArcCallback newNodeCallback arcMovedCallback defaultActionCallback selectNodeCallback selectArcCallback deselectCallback selectSubgraphCallback arcMovedCallback arcMovedCallback arcMovedCallback arcMovedCallback
%A
selected Arcs
%I child widgetID c %f old from widgetID c %t c %F new from widgetID c %T new to widgetID The XmGraph widget class provides the application developer with the ability to display any group of widgets as a graph, with each widget representing a node. The graph can be disconnected, as well as contain cycles. The arcs used to connect the nodes are instances of an XmArc widget, developed speci cally for use with the XmGraph widget. An arc may be undirected, directed or bidirected. Note that the XmGraph widget does not understand the semantics of arc direction, ie. for layout and editing purposes, an arc will always have a parent and a child regardless of its direction. The XmGraph widget has the ability to arrange all nodes either horizontally or vertically according to an internal layout algorithm, and supports an edit mode in which arcs and nodes may be interactively repositioned as well as created, and a read-only mode in which all events are passed directly to the children of the Graph widget. In edit mode, the XmGraph takes over all device events for editing commands. w XmScrolledGraph XmCreateScrolledGraph for callbacks and functions see: XmGraph An XmScrolledGraph widget is an XmGraph wdiget contained in an XmScrolledWindow. The XmScrolledGraph uses uses the AUTOMATIC scrollbar mode of the XmScrolledWindow. The Graph widget does extensive optimizations based on the existence of the ScrolledWindow's clipWindow when created via XmScrolledGraph. ::::::::::::::::::::::::::
102
f XmGraphInsertRoots
::::::::::::::::::::::::::::::::::::::::::::::
Arguments: XmGraphWidget, nodes Return value: void The command XmGraphInsertRoots adds to the user roots list of graph the speci ed nodes
f XmGraphDestroyAllArcs
::::::::::::::::::::::::::::::::::::::::::
Arguments: XmGraphWidget Return value: void The command XmGraphDestroyAllArcs destroys all arcs of the speci ed XmGraph widget.
f XmGraphDestroyAllNodes
::::::::::::::::::::::::::::::::::::::::
Arguments: XmGraphWidget Return value: void The command XmGraphDestroyAllNodes destroys all arcs of the speci ed XmGraph widget. f XmGraphGetArcsBetweenNodes getArcs Arguments: XmGraph Widget, from node, to node Return value: String The function XmGraphGetArcsBetweenNodes returns a list of all XmArc widgets (in form of widget IDs) that extend from the widget given in the 2nd argument to the widget speci ed in the third argument. if no such arc exists, an empty list is returned. :::::::::::::::::::::::::
f XmGraphCenterAroundWidget : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments: XmGraph Widget, node Return value: void The command XmGraphCenterAroundWidget places the speci ed node (2nd argument) of a scrolled XmGraph widget to the center of the displayed area
A.9 Plotter Widget and Commands The Plotter Widget can be compiled with Athena or Motif versions of Wafe. In order to compile Wafe with support for the commands listed in this section use the ag PLOTTER during compilation. w AtAxis
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
103
The AtAxis widget class is designed for numeric axes as part of the AtPlotter widget. It provides simple linear spacing of tics and subtics and simple printf()-like tic labeling. This class is only concerned with the user-space details of tic positions and tic labels.
w AtBarPlot
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
The AtBarPlot class provides simple bar plots. The X values of the bars are successive integers, and the Y values are given by application data. Each bar on the plot can be outlined and/or lled. The outlining is done using the resources inherited from the AtPlot class. The lling can be in the same or a dierent color, using one of 11 stipple patterns if required. f AtBarPlotAttachData plotAttachData Arguments: bar plot widget, oats Return value: void The command AtBarPlotAttachData is used to specify the data points of an AtBarPlot widget. Each data point is given as a single oating point value. f AtBarPlotExtendData plotExtendData Arguments: bar plot widget, oats Return value: void The command AtBarPlotExtendData is used to add additional data points to an existing AtBarPlot widget. Each data point is given as a single
oating point value. ::::::::::::::::::::::::::::::
:::::::::::::::::::::::::::::
w AtLabelAxis : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : The AtLabelAxis widget class provides facilities for the application pro-
grammer to specify which integral values in the axis should have tics, and attach arbitrary labels to those tics. The XtNticInterval resource will be set to 0, and no subtics will be generated.
f AtLabelAxisAttachData
:::::::::::::::::::::::::::::::::::::::::::
Arguments: label axis wiget, strings Return value: void The command AtLabelAxisAttachData us used to specify the labels of an AtLabelAxis widget.
w AtLinePlot : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : The AtLinePlot class is the simplest of the plotting classes in the AtPlotter
widget set. It's data points are drawn by connecting it with straight lines. f AtLinePlotAttachData plotAttachData :::::::::::::::::::::::::::::
104
Arguments: line plot widget, oats Return value: void The command AtLinePlotAttachData can be used to specify the data points of an AtLinePlot widget. Each data point is speci ed as a single oating point number. f AtLinePlotExtendData plotExtendData Arguments: bar plot widget, oats Return value: void The command AtLinePlotExtendData is used to add additional data points to an existing AtLinePlot widget. Each data point is given as a single
oating point value. ::::::::::::::::::::::::::::
w AtPlotter : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
c clickCallback c c c c
c c c c c c c
motionCallback clickCallback motionCallback clickCallback motionCallback clickCallback motionCallback clickCallback motionCallback clickCallback motionCallback dragCallback slideCallback dragCallback slideCallback dragCallback slideCallback dragCallback slideCallback dragCallback slideCallback dragCallback slideCallback 105
%x
pixel x coordinate
%y
pixel y coordinate
%a
1st axis x coordinate
%b
1st axis y coordinate
%c
2nd axis x coordinate
%d
2nd axis y coordinate
%x
pixel x lower left
%y
pixel y lower left
%a
1st axis x lower left
%b
1st axis y lower left
%c
2nd axis x lower left
%d
2nd axis y lower left
c dragCallback c c c c c
slideCallback dragCallback slideCallback dragCallback slideCallback dragCallback slideCallback dragCallback slideCallback dragCallback slideCallback
%X
pixel x upper right
%Y
pixel y upper right
%A
1st axis x upper right
%B
1st axis y upper right
%C
2nd axis x upper right
%D 2nd axis y upper right The AtPlotter widget class displays various plot types on a set of x-y axes. Currently supported plots are line and bar plots. The axes are optionally labeled, the widget displays an optional title, and plots can be annotated with text. There is an optional legend at the right or left hand side of the plot. Two x axes and two y axes can be displayed each with a dierent range, and plots can be plotted against either x axis and either y axis. The X axis is along the bottom, the X2 axis along the top. The Y axis is along the left edge, the Y2 axis is along the right edge.
f AtPlotterGeneratePostscript
Arguments:
::::::::::::::::::::::::::::::::::::::
le name, plotter widget, title, bounding box: x1, bounding box: y1, bounding box: x2, bounding box: y2, landscape Return value: void The command AtPlotterGeneratePostscript opens lename and writes the PostScript representation of plotter (2nd arguemnt) to the le. The plotter will have a title as speci ed as the 3rd argument. The representation will be drawn inside the bounding box described by (x1, y1) and (x2, y2). If landscape is True, the plotter representation will be rotated and drawn in landscape mode.
w AtTextPlot : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : The AtTextPlot widget class displays formatted text in an AtPlotter wid-
get. The text can be placed in the plotter widget in two ways: attached to a pair of real coordinates or attached to a pair of pixel coordinates. When attached to a real point, the plot will " oat" (i.e. if the coordinate scale changes, the plot will be drawn at the real points new location; this is controlled by the resource oatingPosition). When attached to a pixel point, the plot will be drawn in that position even if the coordinate scale 106
changes. If the physical size of the plotter changes, the plot will be drawn such that it remains in the same relative position (percentage-wise).
w AtXYAxis : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : The AtXYAxis widget class is designed for numeric axes as part of the
AtPlotter widget. It provides linear and logarithmic spacing of tics and subtics and simple printf()-like tic labeling.
w AtXYLinePlot : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : The AtXYLinePlot widget class can be used to display an list of coordinate
pairs in form of a line plot. 7 dierent line types, 12 dierent line styles and 9 dierent marker types for the data points are supported. f AtXYLinePlotAttachData xyLinePlotAttachData Arguments: AtXYLine plot widget, pairs of oats (x oat/y oat) Return value: void The command AtXYLinePlotAttachData can be used to set the plot data if the speci ed line plot widget. The speci ed coordinate pairs are of the form x-value/y-value. See also: AtXYLinePlotExtendData. f AtXYLinePlotExtendData xyLinePlotExtendData Arguments: AtXYLine plot widget, pairs of oats (x oat/y oat) Return value: void The command AtXYLinePlotExtendData can be used to append the speci ed coordinate pairs (of the form x-value/y-value) to the plot data of the speci ed line plot widget and to update the plot. See also: AtXYLinePlotAttachData'. ::::::::::::::::::
:::::::::::::::::
A.10 HyperText (HTML) Widget and Commands The HTML Widget can be compiled with Athena or Motif versions of Wafe. In order to compile Wafe with support for the commands listed in this section use the ag HTML during compilation. w HTML
c c c c c
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
anchorCallback anchorCallback anchorCallback submitFormCallback submitFormCallback
%t %h %i %h %n 107
text hypertext reference element id hypertext reference attribute names
c submitFormCallback %v attribute values c pointerMotionCallback %h hypertext reference c linkCallback %h hypertext reference c linkCallback %r role The HTML widget class can be used to display HTML (HyperText Markup Language) documents (which may contain references to graphics in form of GIF or XPM). When needed scrollbars are added.
f HTMLGetText : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments: HTML Widget, Pretty Code 0-5 Return value: String The function HTMLGetText is a convenience function to return the text of the HTML document as a plain ascii text string. When the 2nd argument is two or larger, Postscript is returned. The font used is encoded in the pretty parameter: * * * *
pretty pretty pretty pretty
= = = =
2: 3: 4: 5:
Times Helvetica New century schoolbook Lucida Bright
f HTMLGetTextAndSelection : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments:
HTML Widget, Selection starts, Selection ends, Insertion Points Return value: String The function HTMLGetText is a convenience function to return the text of the HTML document as a single white space separated string, with pointers to the various start and end points of selections. f HTMLGetHRefs hTMLGetHRefs Arguments: HTML Widget Return value: String The function HTMLGetHRefs returns the HREFs of all active anchors in the document. Function returns an array of strings and lls num hrefs passed. If there are no HREFs an empty string is returned . :::::::::::::::::::::::::::::::::::
f HTMLPositionToId
Arguments: Return value:
::::::::::::::::::::::::::::::::::::::::::::::::
HTML Widget, x Coordinate, y Coordinate int
108
The function HTMLPositionToId returns the element id of the element nearest to the x,y coordinates passed in. If there is no element there, return the rst element in the line we are on. If there we are on no line, either return the beginning, or the end of the document.
f HTMLIdToPosition
::::::::::::::::::::::::::::::::::::::::::::::::
Arguments:
HTML Widget, Element ID, x Coordinate, y Coordinate Return value: int The function HTMLIdToPosition returns the position of the element based on the element id passed in. Function returns 1 on success and lls in x,y pixel values. If there is no such element, x=0, y=0 and -1 is returned.
f HTMLAnchorToPosition : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments:
HTML Widget, Anchor's name, x Coordinate, y Coordinate Return value: int The function HTMLAnchorToPosition returns the position of the anchor based on the anchor NAME passed. Function returns 1 on success and lls in x,y pixel values. If there is no such element, x=0, y=0 and -1 is returned.
f HTMLClearSelection : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments: HTML Widget Return value: void The procedure HTMLClearSelection clears the current selection.
f HTMLSetSelection
:::::::::::::::::::::::::::::::::::::::::::::::::
Arguments: HTML Widget, start, end Return value: void The procedure HTMLSetSelection sets the current selection based on the ElementRefs passed in. Both refs must be valid (and contain the integers id and pos)
f HTMLSetText
::::::::::::::::::::::::::::::::::::::::::::::::::::::
Arguments:
HTML Widget, Text, Header Text, Footer Text, element id, target anchor Return value: void The procedure HTMLSetText sets the raw text into the widget and forces a reparse and a reformat. If String is passed in as NULL that text is unchanged, if a pointer points to an empty string, that text is set to NULL; Also pass an element ID to set the view area to that section of the 109
new text. Finally, and an anchor NAME can be provided as last arguemnt to scroll to the position of the new text. f HTMLSearchText searchtext Arguments: HTML Widget, Pattern, Start, Result: Start, Result: End, Backward, Case Sensitive Return value: int The function HTMLSearchText is used to search the text of the HTML document as a single white space separated string. Linefeeds are converted into spaces. Takes a pattern, pointers to the start and end blocks to store the start and end of the match into. Start is also used as the location to start the search from for incremental searching. If start is an invalid position (id = 0). Default start is the beginning of the document for forward searching, and the end of the document for backwards searching. HTMLSearchText returns 1 on success (and the start and end positions of the match in arguments 4 and 5), or will return -1 on failure (start and end are unchanged). ::::::::::::::::::::::::::::::::::::::::
f HTMLGotoId
:::::::::::::::::::::::::::::::::::::::::::::::::::::::
Arguments: HTML Widget, Element ID Return value: void The procedure HTMLGotoId is used to position the element based on the element id passed at the top of the viewing area. A passed in id of 0 means goto the top.
f HTMLAnchorToId
:::::::::::::::::::::::::::::::::::::::::::::::::
Arguments: HTML Widget, Anchor string Return value: int The function HTMLAnchorToId returns the element id of the anchor based on the anchor NAME passed. Function returns id on success. If there is no such element, 0 is returned.
f HTMLIdToElement
Arguments: Return value:
::::::::::::::::::::::::::::::::::::::::::::::::
HTML Widget, Element ID, Element Record Boolean
f HTMLsetElementBg
Arguments: Return value:
:::::::::::::::::::::::::::::::::::::::::::::::
HTML Widget, Element ID, backgroundColor void
f HTMLRetestAnchors
::::::::::::::::::::::::::::::::::::::::::::::
110
Arguments: HTML Widget Return value: void The procedure HTMLRetestAnchors is used to redraw all active anchors in the document.
f HTMLgetMarkUp
::::::::::::::::::::::::::::::::::::::::::::::::::
Arguments: HTML Widget Return value: String The function HTMLgetMarkUp returns a list of markup elements where each element has the form , where type speci es the type of markup (text or various tags), oset is the byte oset of the text in the raw html text, and text is the text element.
A.11 Motif Tree Widget The Motif Tree Widget (XsTree) was described by Douglas Young in his book "X Window System Programming and Applications with Xt" (Prentice Hall). The sources for the Motif Tree widget with a few xes are distributed together with the Wafe package. The original source can be obtained various ftp servers such as ftp.x.org. The Motif Tree Widget requires Motif 1.1 or newer. In order to compile Wafe with support for the commands listed in this section use the ag MTREE during compilation. w XsTree : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : The XsTree widget class can be used to display tree structures where each
node in the tree can be of an arbitrary widget class. The tree structure is de ned over the resource superNode which is inhherited by all of its children. w XsScrolledTree XsCreateScrolledTree for callbacks and functions see: XsTree The command XsScrolledTree generates a XsTree widget inside of a scrolled window (see alse XsTree). :::::::::::::::::::::::::::::::::
A.12 Xbae Widget and Commands The Xbae widget supports two widget classes, XbaeMatrix and XbaeCaption. Wafe was tested and built with Xbae 3.8p1, Xbae can be obtained from various ftp servers such as ftp.x.org. Xbae requires Motif 1.1 or newer. In order to compile Wafe with support for the commands listed in this section use the ag XBAE during compilation. 111
w XbaeCaption : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : The XbaeCaption widget class is a simple Motif manager widget used
to associate an XmLabel (caption) with it's single child. The label may be either an XmString or Pixmap and can be displayed in any one of twelve positions around the perimeter of the child. XbaeCaption's geometry management technique is to simply "shrink wrap" it's child and display the caption alongside it. By using XbaeCaption with an XmFrame child, groups of related widgets can be labeled similarly to the IBM CUA "Group Box", but with more exibility. XbaeCaption is also useful for associating labels with individual XmTextField widgets.
w XbaeMatrix
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::
c XmNenterCellCallback
c
XmNleaveCellCallback XmNtraverseCellCallback XmNselectCellCallback XmNmodifyVerifyCallback XmNenterCellCallback XmNleaveCellCallback XmNtraverseCellCallback XmNselectCellCallback XmNmodifyVerifyCallback XmNleaveCellCallback XmNtraverseCellCallback XmNtraverseCellCallback XmNmodifyVerifyCallback XmNmodifyVerifyCallback XmNmodifyVerifyCallback XmNmodifyVerifyCallback XmNmodifyVerifyCallback
%r
row
%c column c %s value c %R next row c %C next column c %i position of insert cursor c %n new position of cursor c %f startPos (from) c %t endPos (to) c %s text The XbaeMatrix widget class is a Motif widget which presents an editable array of string data to the user in a scrollable table similarto a spreadsheet. The rows and columns of the Matrix may optionally be labeled. Also, a number of " xed" leading rows or columns may be speci ed - these behave similarly to the labels. While XbaeMatrix looks and acts like a grid of XmTextField widgets, it actually contains only one XmTextField. This means that XbaeMatrix widgets with hundreds or thousands of rows have much less overhead than they would if they used an XmTextField for each cell. XbaeMatrix has callbacks for doing eld validation and customizing 112
traversal. It allows cells to be assigned independent colors. It allows rows, columns and regions of cells to be selected (highlighted). The matrix can be dynamically grown or shrunk by adding and deleting rows and columns at any position. f XbaeMatrixAddEmptyColumns XbaeMatrixAddColumns Arguments: Xbae Matrix Widget, position, columns, labels, widths, max lengths, alignments, label alignments, colors, number of columns to be inserted Return value: void The procedure XbaeMatrixAddEmptyColumns allows to dynamically add new columns anywhere in the Matrix. The columns will be added before the column speci ed in position. Columns are numbered starting at zero. To append new columns onto the end of the Matrix, specify position as the total number of columns. If the programmer attempts to add columns using XbaeMatrixAddColumns when there are no rows, it will result in a warning message. There must be at least one row in the XbaeMatrix widget to add columns. f XbaeMatrixAddEmptyRows XbaeMatrixAddRows Arguments: Xbae Matrix Widget, position, rows, labels, pixels, number of rows to be insterted Return value: void The procedure XbaeMatrixAddEmptyRows allows to dynamically add new rows anywhere in the Matrix. The rows will be added before the row speci ed in position. Rows are numbered starting at zero. To append new rows onto the end of the Matrix, specify position as the total number of rows. :::::::::
:::::::::::::::::
f XbaeMatrixCancelEdit : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments: Xbae Matrix Widget, umap after canel? Return value: void The procedure XbaeMatrixCancelEdit allows to to programmatically cancel a cell edit in progress, discarding any changes made by the user. This function unmaps the TextField edit widget if the unmap ag is True. If unmap is False, the contents of the TextField are restored to their original value, and the TextField is not unmapped.
f XbaeMatrixCommitEdit
Arguments: Return value:
:::::::::::::::::::::::::::::::::::::::::::
Xbae Matrix Widget, umap after canel? void 113
The procedure XbaeMatrixCommitEdit can be used by the applica- tion developer to programmatically commit an edit, saving any changes made by the user. This will cause the callbacks on the XmNleaveCellCallback list to be called to verify that the changes the user made are valid. If the changes are valid, then they are saved into the cell and if the unmap ag is True, the TextField widget will be unmapped.
f XbaeMatrixDeleteColumns : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments:
Xbae Matrix Widget, position, number of columns to be deleted Return value: void The procedure XbaeMatrixDeleteColumns allows the application developer to dynamically delete columns from anywhere in the Matrix. Columns will be deleted starting at the column speci ed by position.
f XbaeMatrixDeleteRows : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments:
Xbae Matrix Widget, position, number of rows to be deleted Return value: void The procedure XbaeMatrixDeleteRows allows the application developer to dynamically delete rows from anywhere in the Matrix. Rows will be deleted starting at the row speci ed by position.
f XbaeMatrixDeselectAll
::::::::::::::::::::::::::::::::::::::::::::
Arguments: Xbae Matrix Widget Return value: void The procedure XbaeMatrixDeselectAll allows the application developer to programmatically deselect all cells. XbaeMatrixDeselectAll redraws the cells in normal video.
f XbaeMatrixDeselectCell
:::::::::::::::::::::::::::::::::::::::::::
Arguments: Xbae Matrix Widget, row, column Return value: void The procedure XbaeMatrixDeselectCell allows the application developer to programmatically deselect a cell. XbaeMatrixDeselectCell redraws the cell in normal video.
f XbaeMatrixDeselectColumn : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments: Xbae Matrix Widget, column Return value: void The procedure XbaeMatrixDeselectColumn allows the application developer to programmatically deselect a column. XbaeMatrixDeselectColumn draws the column in normal video. 114
f XbaeMatrixDeselectRow : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments: Xbae Matrix Widget, row Return value: void The procedure XbaeMatrixDeselectRow allows the application developer to programmatically deselect a row. XbaeMatrixDeselectRow draws the row in reverse video (or selectedForeground / selectedBackground if set).
f XbaeMatrixDisableRedisplay : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments: Xbae Matrix Widget Return value: void Min. Requirements: XBAE43 The procedures XbaeMatrixDisableRedisplay and XbaeMatrixEnableRedisplay allow an application to make multiple changes to a matrix without immediate visual updates. When multiple changes are made with redisplay enabled, visual ashing often occurs. These routines help eliminate this problem.
f XbaeMatrixEditCell : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments: Xbae Matrix Widget, row, column Return value: void The procedure XbaeMatrixEditCell allows the application developer to programmatically force a speci c cell to be edited. This function will rst attempt to commit the edit in the current cell. If the leaveCellCallback callbacks disallow this commit, then XbaeMatrixEditCell will return. Otherwise the speci ed cell is scrolled until it is visible. If the speci ed cell is in a xed row or column, it cannot be edited and XbaeMatrixEditCell will return. Next, the callbacks on the enterCellCallback callback list are called for the speci ed cell to determine it's editability. Then the TextField edit widget is mapped on top of the speci ed cell.
f XbaeMatrixEnableRedisplay
::::::::::::::::::::::::::::::::::::::
Arguments: Xbae Matrix Widget, force redisplay Return value: void Min. Requirements: XBAE43 The procedures XbaeMatrixDisableRedisplay and XbaeMatrixEnableRedisplay allow an application to make multiple changes to a matrix without immediate visual updates. When multiple changes are made with redisplay enabled, visual ashing often occurs. These routines help eliminate this problem.
f XbaeMatrixFirstSelectedCell : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments:
Xbae Matrix Widget, row, column 115
Return value: void Min. Requirements: XBAE43 The procedure XbaeMatrixFirstSelectedCell allows the application programmer to nd out which cell is the rst selected. The function traverses the XbaeMatrix widget in a left to right, top to bottom manner to determine this value. If no cell is selected, row and column are set to -1.
f XbaeMatrixFirstSelectedColumn
:::::::::::::::::::::::::::::::::
Arguments: Xbae Matrix Widget Return value: int Min. Requirements: XBAE43 The function XbaeMatrixFirstSelectedColumn returns the column number of the rst selected column in the XbaeMatrix widget. The function traverses the matrix from column 0. A column must be entirely selected for the column to be considered selected. If no column is selected then -1 is returned.
f XbaeMatrixFirstSelectedRow
:::::::::::::::::::::::::::::::::::::
Arguments: Xbae Matrix Widget Return value: int Min. Requirements: XBAE43 The function XbaeMatrixFirstSelectedRow returns the row number of the rst selected row in the XbaeMatrix widget. The function traverses the matrix from row 0. A row must be entirely selected for the row to be considered selected. If no row is selected then -1 is returned.
f XbaeMatrixGetCell
::::::::::::::::::::::::::::::::::::::::::::::::
Arguments: Xbae Matrix Widget, row, column Return value: String The function XbaeMatrixGetCell returns the string value stored in the speci ed cell.
f XbaeMatrixGetCurrentCell
:::::::::::::::::::::::::::::::::::::::
Arguments: Xbae Matrix Widget, row, column Return value: void Min. Requirements: XBAE43 The procedure XbaeMatrixGetCurrentCell allows the application developer to determine what cell is being edited or has focus.
f XbaeMatrixGetNumSelected : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments: Return value:
Xbae Matrix Widget int 116
Min. Requirements: XBAE43 The function XbaeMatrixGetNumSelected returns the number of cells that are currently selected in the given matrix. The widget maintains an internal variable as cells are selected and deselected so a complete traversal of the widget is avoided
f XbaeMatrixHighlightCell : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments: Xbae Matrix Widget, row, column Return value: void Min. Requirements: XBAE43 The procedure XbaeMatrixHighlightCell allows the application developer to programmatically highlight a cell. XbaeMatrixHighlightCell draws the highlight around the cell.
f XbaeMatrixHighlightColumn : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments: Xbae Matrix Widget, column Return value: void Min. Requirements: XBAE43 The procedure XbaeMatrixHighlightColumn allows the application developer to programmatically highlight a column. XbaeMatrixHighlightColumn draws the highlight around the column if gridType is XmGRID COLUMN SHADOW or from around each cell in the column otherwise. The corresponding unsigned chars in the highlightedCells array will be have its HighlightColumn or HighlightOther bit set, depending on whether gridType is set to XmGRID COLUMN SHADOW or not.
f XbaeMatrixHighlightRow
:::::::::::::::::::::::::::::::::::::::::
Arguments: Xbae Matrix Widget, row Return value: void Min. Requirements: XBAE43 The procedure XbaeMatrixHighlightRowRow allows the application developer to programmatically highlight a row. XbaeMatrixHighlightRow draws the highlight around the row if gridType is XmGRID ROW SHADOW or from around each cell in the row otherwise. The corresponding unsigned chars in the highlightedCells array will be have its HighlightRow or High- lightOther bit set, depending on whether gridType is set to XmGRID ROW SHADOW or not.
f XbaeMatrixIsCellSelected
:::::::::::::::::::::::::::::::::::::::::
Arguments: Xbae Matrix Widget, row, column Return value: Boolean Min. Requirements: XBAE43 117
The function XbaeMatrixIsCellSelected returns whether or not a particular cell is selected. The function returns 1 if the cell is selected and 0 otherwise.
f XbaeMatrixIsColumnSelected : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments: Xbae Matrix Widget, column Return value: Boolean Min. Requirements: XBAE43 The function XbaeMatrixIsColumnSelected returns whether or not a particular column is selected. The function returns 1 if the column is selected and 0 otherwise. A column must be selected in its entirety for 'XbaeMatrixIsColumnSelected; to return 1.
f XbaeMatrixIsRowSelected : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments: Xbae Matrix Widget, row Return value: Boolean Min. Requirements: XBAE43 The function XbaeMatrixIsRowSelected returns whether or not a particular row is selected. The function returns 1 if the row is selected and 0 otherwise. A row must be selected in its entirety for XbaeMatrixIsRowSelected to return 1.
f XbaeMatrixNumColumns
:::::::::::::::::::::::::::::::::::::::::
Arguments: Xbae Matrix Widget Return value: int Min. Requirements: XBAE43 The function XbaeMatrixNumColumns returns the number of columns in the given matrix widget.
f XbaeMatrixNumRows
:::::::::::::::::::::::::::::::::::::::::::::
Arguments: Xbae Matrix Widget Return value: int Min. Requirements: XBAE43 The function XbaeMatrixNumRows returns the number of rows in the given matrix widget.
f XbaeMatrixRefresh
::::::::::::::::::::::::::::::::::::::::::::::::
Arguments: Xbae Matrix Widget Return value: void Min. Requirements: XBAE43 The procedure XbaeMatrixRefresh allows the application developer to force the widget to redraw itself. This might be used when the programmer 118
knows the widget's values have changed, but the widget has not detected the change. While this function should rarely be needed, it is provided "just in case".
f XbaeMatrixSelectAll
:::::::::::::::::::::::::::::::::::::::::::::::
Arguments: Xbae Matrix Widget Return value: void Min. Requirements: XBAE43 The procedure XbaeMatrixSelectAll allows the application developer to programmatically select all cells. XbaeMatrixSelectAll redraws the cells in reverse video.
f XbaeMatrixSelectCell : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments: Xbae Matrix Widget, row, column Return value: void The procedure XbaeMatrixSelectCell allows the application developer to programmatically select a cell. XbaeMatrixSelectCell rst scrolls the speci ed cell until it is visible, and then draws the cell in reverse video (or selectedForeground / selectedBackground if set).
f XbaeMatrixSelectColumn
:::::::::::::::::::::::::::::::::::::::::
Arguments: Xbae Matrix Widget, column Return value: void The procedure XbaeMatrixSelectColumn allows the application developer to programmaticallyselect a column. XbaeMatrixSelectColumn rst scrolls the speci ed column until it is visible, and then draws the column in reverse video (or selectedForeground / selectedBackground if set).
f XbaeMatrixSelectRow
:::::::::::::::::::::::::::::::::::::::::::::
Arguments: Xbae Matrix Widget, row Return value: void The procedure XbaeMatrixSelectRow allows the application developer to programmatically select a row. XbaeMatrixSelectRow rst scrolls the speci ed row until it is visible, and then draws the row in reverse video (or selectedForeground / selected- Background if set).
f XbaeMatrixSetCell
:::::::::::::::::::::::::::::::::::::::::::::::::
Arguments: Xbae Matrix Widget, row, column, value Return value: void The procedure XbaeMatrixSetCell allows the application developer to programmatically set the value of the speci ed cell.
f XbaeMatrixSetCellBackground
119
:::::::::::::::::::::::::::::::::::
Arguments: Xbae Matrix Widget, row, column, background color Return value: void Min. Requirements: XBAE43 The procedure XbaeMatrixSetCellBackground is a convenient way to specify and modify the the background color of a single cell.
f XbaeMatrixSetCellColor : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments: Xbae Matrix Widget, row, column, foreground color Return value: void The procedure XbaeMatrixSetCellColor is a convenient way to specify and modify the the foreground color of a single cell.
f XbaeMatrixUnhighlightAll
::::::::::::::::::::::::::::::::::::::::
Arguments: Xbae Matrix Widget Return value: void Min. Requirements: XBAE43 The procedure XbaeMatrixUnhighlightAll allows the application developer to programmatically unhighlight all cells. XbaeMatrixUnhighlightAll erases the highlight from all cells.
f XbaeMatrixUnhighlightCell
:::::::::::::::::::::::::::::::::::::::
Arguments: Xbae Matrix Widget, row, column Return value: void Min. Requirements: XBAE43 The procedure XbaeMatrixUnhighlightCell allows the application developer to programmatically unhighlight a cell. XbaeMatrixUnhighlightCell erases the highlight from the cell.
f XbaeMatrixUnhighlightColumn : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments: Xbae Matrix Widget, column Return value: void Min. Requirements: XBAE43 The procedure XbaeMatrixUnhighlightColumn allows the application developer to programmatically unhighlight a column. XbaeMatrixUnhighlightColumn erases the highlight from around the column if gridType is XmGRID COLUMN SHADOW or from around each cell in the column otherwise.
f XbaeMatrixUnhighlightRow : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments: Xbae Matrix Widget, row Return value: void Min. Requirements: XBAE43 120
The procedure XbaeMatrixUnhighlightRow allows the application developer to programmatically unhighlight a row. XbaeMatrixUnhighlightRow erases the highlight from around the column if gridType is XmGRID ROW SHADOW or from around each cell in the column otherwise.
f XbaeMatrixVisibleColumns
:::::::::::::::::::::::::::::::::::::::
Arguments: Xbae Matrix Widget Return value: int Min. Requirements: XBAE43 The function XbaeMatrixVisibleColumns returns the number of columns are currently displayed in the speci ed XbaeMatrix. A partially visible column will be declared an entire column.
f XbaeMatrixVisibleRows
:::::::::::::::::::::::::::::::::::::::::::
Arguments: Xbae Matrix Widget Return value: int Min. Requirements: XBAE43 The function XbaeMatrixVisibleRows returns the number of rows are currently displayed in the speci ed XbaeMatrix. A partially visible row will be declared an entire row.
f XbaeMatrixXToCol
::::::::::::::::::::::::::::::::::::::::::::::::
Arguments: Xbae Matrix Widget, x position Return value: int Min. Requirements: XBAE43 The function XbaeMatrixXToCol returns the column under the speci ed x position.
f XbaeMatrixYToRow
:::::::::::::::::::::::::::::::::::::::::::::::
Arguments: Xbae Matrix Widget, y position Return value: int Min. Requirements: XBAE43 The function XbaeMatrixYToRow returns the row under the speci ed y position. f XbaeEnterCellCBset wafeMatrixEnterCellCBset Arguments: doit Return value: void f XbaeLeaveCellCBset wafeMatrixLeaveCellCBset Arguments: doit Return value: void ::::::::::::::::::::
::::::::::::::::::::
121
f XbaeTraverseCellCBset
wafeMatrixTraverseCellCBset Arguments: next row, next column Return value: void f XbaeModifyVerifyCBset wafeMatrixModifyVerifyCBset Arguments: doit, currInsert or -1, startPos or -1, endPos or -1, String Return value: void ::::::::::::::
::::::::::::
A.13 Ghostview Widget and Commands The Ghostview Widget can be compiled with Athena or Motif versions of Wafe. In order to compile Wafe with support for the commands listed in this section use the ag GHOSTVIEW during compilation. w Ghostview
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
callback callback callback callback callback callback outputCallback messageCallback f GhostviewEnableInterpreter c c c c c c c c
%u %v %x %y %X %Y %s %s
width height ps x ps y x dpi y dpi string from gs response
:::::::::::::::::::::::::::::::::::::::
Arguments: Return value:
ghostview widget void
Arguments: Return value:
ghostview widget void
f GhostviewDisableInterpreter : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : f GhostviewIsInterpreterReady
:::::::::::::::::::::::::::::::::::::
Arguments: Return value:
ghostview widget Boolean
Arguments:
ghostview widget
f GhostviewIsInterpreterRunning : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
122
Return value:
Boolean
Arguments: Return value:
ghostview widget long
f GhostviewGetBackingPixmap : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : f GhostviewSendPS
Arguments:
::::::::::::::::::::::::::::::::::::::::::::::::::
ghostview widget, open le, begin, length, boolean close Return value: Boolean The function GhostviewSendPS queues a portion of a PostScript le for output to ghostscript. If several Ghostview widgets are reading from the same le, the le must be opened several times. GhostviewSendPS does not actually send the PostScript contents to the widget, it merely queues it for output. The 3rd argument begin denotes the position in le (returned from ftell()) to start. The 4th argument len is the number of bytes to write. If an interpreter is not running, nothing is queued, False is returned.
f GhostviewNextPage : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments: ghostview widget Return value: Boolean The function GhostviewNextPage tells ghostscript to start the next page. It returns Returns False if ghostscript is not running, or not ready to start another page. This functions sets the busy ag and cursor.
A.14 Xew (EuroBridge) Widget Set and Commands The Xew (EuroBridge) Widgets are designed primarily for use in multimedia applications. These widgets were implemented by Markku.Savela@vtt. . Wafe was tested and built with Xew 3.1, which can be obtained from various ftp servers such as ftp.x.org. For more informationabout Xew, consult http://www.vtt. /tte/EuroBridge/Xew/ In order to compile Wafe with support for the commands listed in this section use the ag XEW during compilation. w XeText : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : The XeText widget class is for displaying text with multinational char-
acter sets (ISO 2022, COMPOUND TEXT), multiple fonts, text sizes, renditions, colors, alignments and justi cations (ISO 6429/ANSI X3.641979). Additionally, the XeText widget allows other widgets (insets) to be embedded into the text stream. The widget class is suitable for applications that require a locale independent international support and/or mixing of text with other widgets. 123
w XeTextEd : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : The XeTextEd widget class is an editable version of the XeText widget
class.
w XeRaster : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : The XeRaster widget class can display images in the GIF and PBMPLUS
formats, Support for JPEG, TIFF and RLE can be added just by compilation switches and having the corresponding freely available libraries. XeRaster can be used by applications that need a quick and easy way to display images in common formats. It is not intended for image processing applications.
w XeAudio : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : The XeAudio widget class "displays" audio content. This is currently
implemented only for /dev/audio on Sun SPARC architecture.
w XeVideo : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : The XeVideo widget class can play MPEG movies. It is based on the
Berkeley MPEG code.
w XeFrame : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : The XeFrame widget class uses the concepts of ODA (ISO 8613) Frame
object. XeFrame stacks its children into absolute positions or into column, which can be laid out vertically or horizontally. The allowed geometry and positioning within column can be constrained in various ways (alignments and ordering) and they can have dierent border styles (shadow, solid, dotted lines, etc). XeFrame can be used as a basic building block for displaying the pages of a document. It is also powerfull enough to be used as a building block for the user interface panels.
A.15 Clock widget class This version of the Clock Widget is based on the Clock widget from the X11R5 release of Xaw3d. The Clock widget has been removed from the Xaw library (and Xaw3d) with the release of X11R6. This separate version of the clock widget class is a strict superset of the original code from Xaw3d. It allows the widget to be used in Motif applications as well and can be used in applications based on Xaw or Xaw3d from X11R6 or newer. Several resources have been added to support setting of time osets, better handling of background pixmaps etc. Check out wafe/lib/clock/README.wafe for details. In order to compile Wafe with support for the commands listed in this section use the ag CLOCK during compilation. 124
w Clock : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : The Clock widget class displays the current time either as analog clock or as time string depending on the value of the analog resource.
A.16 Drag and Drop Commands This section describes the commands available in Wafe to access the functionality of Roger Reynold's (
[email protected]) Drag n' Drop Library, version 1.3. Note, that drag and drop can be used between various applications as well as within one application. In order to compile Wafe with support for the commands listed in this section use the ag RDD during compilation. f rddSetDropData
::::::::::::::::::::::::::::::::::::::::::::::::::::
Arguments: message string Return value: void The command rddSetDropData sets the drop data (an arbitrary string) for the following drag and drop operation. The actual drag operation is started typically by the action routine rddWafeStartAction shell dragShell (where shell indicates the type of the drag operation, and dragShell is a pre-existing shell, that is dragged around on the screen) or by 'rddWafeStartAction pixmap picture.xpm' where the given picture is used the visualize the drag operation.
f rddAddDropHandler
:::::::::::::::::::::::::::::::::::::::::::::::
Arguments: widget, Tcl command for successful drop Return value: void The command rddAddDropHandler allows to register a drop handler which is executed after a successful drop operation in the given widget (1st argument). The drop data, which was set previously using the command rddSetDropData is passed in the global Tcl variable DROP, which is typically referenced in the given Tcl Command (2nd argument). Example: rddAddDropHandler clear {undoAssignment $DROP}
If the the user released the button over a widget, that does not have a drop handler associated, a Tcl procedure with the name rddDropFailHandler with no arguments is called.
A.17 Miscelaneous Additional Commands The commands listed in this section are available in Motif or Athena versions of Wafe. 125
f clock
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
time
Arguments: Return value: time t Min. Requirements: PRE TCL75 The function clock returns the seconds since the Epoch (that is, 00:00:00 GMT, January 1, 1970). This command is obsolete when used with Tcl 7.5, which provides the function clock seconds
f ctime : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
Arguments: clock value Return value: String Min. Requirements: PRE TCL75 The function ctime returns a ASCII string representing the time of the clock value, which is passed as the argument in the form of an integer value. This command is obsolete when used with Tcl 7.5, which provides the function clock format
f echo
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Arguments: strings Return value: void If Wafe is used in frontend mode, the command echo sends its arguments to the application program. Otherwise (if Wafe is used as a scripting language) the arguments are printed to standard output.
f getChannel
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Arguments: Return value: int The function getChannel returns the le descriptor to be used by the application as additional communication channel. The returned value is a small integer value. When this command is issued not in frontend mode, 0 is returned. This function is intended to be used by a backend application to determine the additional, already option communication channel. f quit kill Arguments: None Return value: void The procedure quit is used to terminate Wafe. If there exists a spawned application process Wafe will send to it the SIGTERM signal. When a Tcl procedure with the name onExit (without arguments) is de ned it will be executed on exit. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
f kill
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
126
Arguments: process id, signalType Return value: void The procedure kill can be used to send a signal to the speci ed process id. The following signals are currently de ned: "term", "quit", "int", "hup", "pipe", "usr1", "usr2". f register wafeRegisterCmd Arguments: stdin j stdout j stderr j xioerr j ..signal.., tcl-command Return value: void The command register is used to install handler procedures, which are invoked under dierent conditions, as speci ed by the 1st argument source; this command can be stdin, stdout, stderr, xioer, term, quit, int, hup, pipe, usr1 or usr2. By specifying stdin, stdout or stderr as rst argument, command will be executed whenever data is pending on the corresponding stream. Before executing the command, Wafe will update a global Tcl variable called STDIN, STDOUT or STDERR according to the handler registered, which will contain the pending data. Note that stdout and stderr are named as they are seen in frontend mode from an application running as an subprocess of Wafe. If the application writes to stdout or stderr the corresponding handler will be activated. If the frontend accepts an additional input from the terminal, a stdin handler can be registered. Wafe allows XIO errors to be caught by using the constant xioerr as rst argument to the register command. Note that this is a fatal error condition and that Wafe will anyway try to kill the application program before exiting afterwards. This type of handler procedure facilitates therefore cleanup operations. The remaining handler types refer to signal for which handler can be speci ed as Tcl commands. For signal handlers it is also possible to specify IGNORE or DEFAULT in the command string which cause either to ignore a signal completely or to default to the standard system action (i.e. not using any Wafe speci c signal handler). f setCommunicationVariable wafeSetCommunicationVariableCmd Arguments: variable name, length, tcl command to be executed Return value: void The command setCommunicationVariable is used to make the transferred data available for the user interface (this makes only sense in frontendmode) . As soon as the data with length number of bytes is received (2nd argument), Wafe will create (or overwrite) the Tcl variable named in the 1st argument. This variable will contain the transferred data. As a next step, the speci ed command (3rd argument) will be executed. If the ::::::::::::::::::::::::::::::::::::::::::::
::::
127
f
f
f
f
speci ed number of bytes are not yet received via the extra communication channel, the execution is delayed until the transfer is complete. unregister wafeUnregisterCmd Arguments: stdin j stdout j stderr j xioerr Return value: void The command unregister used to unregister the corresponding handler, which means that the default handler will be reinstalled (see also command register) addInput wafeAddInputCmd Arguments: leno, read j write j except j none j accept, TclVariable, TclCommand Return value: XtInputId .The function addInput can be used to add additional input handlers or exception handlers. If read is speci ed as 2nd argument, each time when data is ready the data is read and APPENDED to the speci ed Tcl Variable (3rd argument) and the given command (4th argument) is executed. addInput returns an inputId. which can be used in the command removeInput. If the 2nd argument is accept a socket can be used for listening (same as read, but no read command is issued for the socket). Note that the amount of data read might depend on the buering of the operating system. If only the newly read data should be kept in the Tcl Variable, the Tcl Command should set it empty after processing its contents. If leno (1st argument) corresponds to an open le, a busy loop is likely to occur (see wafe/src/tcl/addInput.tcl for an example). As shipped, 16 additional input handlers can be added by the application program. Increasing this number needs recompilation. removeInput wafeRemoveInputCmd Arguments: input id Return value: void The command removeInput removes an input added by addInput. The inputId is returned from addInput. leno leNo Arguments: string identifying le, read j write Return value: int The function leno returns for the le opened by using Tcl's open command the le descriptor. The second argument is either read or write. :::::::::::::::::::::::::::::::::::::::
:::::::::::::::::::::::::::::::::::::::::
:::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
128
For pipes the le descriptor might be dierent for reading or writing. On failure the function returns -1;
f alias
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Arguments: new command, old command Return value: int The command alias can be used to register an alternate name (newCommand) for an already existing command (oldCommand). The already existing command can be either a builtin command or a Tcl procedure. f DBUG PUSH DBUG PUSH Arguments: new debug options Return value: void The command DBUG PUSH can be used to modify the current debugging options. The new debugging options are placed on a stack. DBUG PUSH accepts the same arguments as the --D command line option. For example command "DBUG PUSH d:t" turns on debug and trace messages. For details concerning the valid argument strings (pro ling, etc), consult the manual page in wafe/lib/dbug/dbug.man. f DBUG POP DBUG POP Arguments: Return value: void The command DBUG POP switches to the debugging options before the last DBUG PUSH was issued. ::::::::::::::::::::::::::::::::::::::::
:::::::::::::::::::::::::::::::::::::::::::
129
Index
OverrideShell, 18
callActionProc, 26, 31, 50 callback, 22{24, 27, 30, 50 callCallbacks, 26, 50 catch, 48 changePixmap, 47, 48, 67 CHILDPID, 9 Clock, 69, 124, 125 clock, 126 COLORCLOSENSS, 10 combineFileDatabase, 15, 51 Command, 13, 69 command, 40 containerGetItemChildren, 99 containerReorder, 100 convertSelection, 46, 63 convertSpecialResources, 98 createDnDWidget4, 98 createDnDWidget5, 98 ctime, 126
accelerators, 26 action, 24, 26, 38, 49 addInput, 41, 128 addTimeOut, 49 addWorkProc, 64 alias, 129 all, 33 ApplicationShell, 13, 49 Arg, 29 arg, 26 ARGC, 9 argc, 9 ARGV, 9 argv, 9 Argv0, 9 argv0, 9 AtAxis, 103 AtBarPlot, 104 AtBarPlotAttachData, 104 AtBarPlotExtendData, 104 AtLabelAxis, 104 AtLabelAxisAttachData, 104 AtLinePlot, 104 AtLinePlotAttachData, 104 AtLinePlotExtendData, 105 atomId, 65 atomName, 64 AtPlotter, 105 AtPlotterGeneratePostscript, 106 AtTextPlot, 106 AtXYAxis, 107 AtXYLinePlot, 107 AtXYLinePlotAttachData, 107 AtXYLinePlotExtendData, 107 augment, 24, 26
data, 26 DBUG POP, 129 DBUG PUSH, 129 destination, 26 destroyWidget, 18, 51 Dialog, 13, 69 disownSelection, 45, 62 displayCaret, 34 echo, 38, 126 editDone, 35 editError, 35 env, 9 EOL, 33 example, 32 except, 41 exclusive, 18, 22, 23 exec, 24, 25
bell, 49 Box, 13, 69 buttonEvent, 26
fallbackResources, 15, 51 false, 15, 33, 34 130
fetchBuer, 46, 63 fetchBytes, 46, 63 File, 29 leNo, 128 leno, 41, 128 FILESEARCHPATH, 10 rstPos, 32, 35 fontHeight, 21, 52 Form, 13, 70
HTMLGotoId, 110 HTMLIdToElement, 110 HTMLIdToPosition, 109 HTMLPositionToId, 108 HTMLRetestAnchors, 110 HTMLSearchText, 110 HTMLsetElementBg, 110 HTMLSetSelection, 109 HTMLSetText, 109 hup, 39, 40
getActionList, 64 getApplicationResource, 16, 52 getArcs, 103 getChannel, 42, 126 getClass, 16, 53 getDomain, 66 getResourceList, 53 getSelectionValue, 45, 62 getTypeOfAttribute, 16, 53 getValue, 14, 53, 63 Ghostview, 122 GhostviewDisableInterpreter, 122 GhostviewEnableInterpreter, 122 GhostviewGetBackingPixmap, 123 GhostviewIsInterpreterReady, 122 GhostviewIsInterpreterRunning, 122 GhostviewNextPage, 123 GhostviewSendPS, 123 grabKeyboard, 53 grabPointer, 54 Grip, 13, 70 gV, 14, 22, 63
iconPixmap, 48 insertPosition, 34 installAccelerators, 26, 54 installAllAccelerators, 26, 55 int, 39, 40 isAtom, 65 isBusy, 67 isClass, 66 isClassComposite, 66 isManaged, 65 isShell, 17, 64 isWidget, 16, 55, 61 kill, 40, 126 Label, 13, 70 Layout, 55 left, 32, 33 length, 32, 35 List, 13, 29, 30, 70 listAppend, 70 listChange, 70 Logo, 13, 71 lowerWindow, 20, 55
heightOfScreen, 20 hooksOfDisplay, 63 HTML, 107 HTMLAnchorToId, 110 HTMLAnchorToPosition, 109 HTMLClearSelection, 109 HTMLGetHRefs, 108 hTMLGetHRefs, 108 HTMLgetMarkUp, 111 HTMLGetText, 108 HTMLGetTextAndSelection, 108
Mailbox, 13, 71 manageChild, 13, 17, 55 mapState, 64 mapWidget, 17, 55 MenuButton, 13, 71 mergeResources, 15, 56 Motif 1.1, 80 Motif 1.2, 97 131
Motif 2.0, 99 motifWMRunning, 65
realize, 18, 58 realizeWidget, 18, 58 realizeWidgets, 58 register, 39, 127 removeAllCallbacks, 27, 58 removeInput, 41, 128 removeTimeOut, 58 removeWorkProc, 64 reparentWindow, 65 Repeater, 13, 80 replace, 24 resolvePathname, 21, 58 right, 32, 33
nameToWidget, 17, 56 None, 47, 48 none, 18, 22, 23, 41 nonexclusive, 18, 22, 23 NULL, 26, 37, 44, 45 onExit, 21 override, 15, 24, 26 OverrideShell, 13, 56 ownSelection, 44, 45, 62 PACKAGES, 9 Paned, 13, 71 Panner, 13, 79 paragraph, 33 parent, 17, 56 ParentRelative, 48 ParentWidget, 56 PID, 9 pipe, 39, 40 plotAttachData, 104 plotExtendData, 104, 105 Plotter widget set, 103 popdown, 19, 22, 23, 57 popup, 18, 57 popupChildren, 19, 57 popupSpringLoaded, 19, 57 Porthole, 13, 80 position, 22, 23, 33 positionCursor, 22, 24 positionError, 35 PRIMARY, 45 processPendingEvents, 43, 57 ptr, 32, 35 quit, 21, 39, 40, 126 raiseWindow, 20, 58 RDD, 125 rddAddDropHandler, 125 rddSetDropData, 125 read, 41
sans-serif, 12 screen, 66 Scrollbar, 13, 72 scSet, 28, 73 searchtext, 110 selectAll, 31 selectChar, 31 selectLine, 31 selectNull, 31 selectParagraph, 31 selectPosition, 31 selectWord, 31 setBusy, 19, 67 setCommunicationVariable, 42, 127 setCursor, 68 setIconPixmap, 48 setKeyboardFocus, 59 setSensitive, 19, 59 setValues, 14, 15, 22, 28, 48, 59, 63 setWMProtocols, 27, 59 showRes, 12 Simple, 13, 73 SimpleMenu, 13, 73 Sme, 13, 73 SmeBSB, 13, 74 SmeLine, 13, 74 source, 26 STDERR, 39 stderr, 39, 40 STDIN, 39 132
stdin, 39, 40 STDOUT, 39 stdout, 39, 40 storeBuer, 47, 63 StringDraw, 97 StripChart, 13, 74 stripChartSet, 74 sV, 14, 21, 48, 63 sync, 60
wafeAddInputCmd, 128 wafeAddProtocol, 94 wafeAddProtocolCallback, 95 wafeCallbackCmdArgs, 50 wafeChangePixmap, 67 wafeCvtName2Widget, 55, 62 wafeGetApplicationResource, 52 wafeGetAtomName, 64 wafeGetDomain, 66 wafeGetQTypeOfAttribute, 53 wafeInstallImage, 96 WAFELIB, 9 wafeMatrixEnterCellCBset, 121 wafeMatrixLeaveCellCBset, 121 wafeMatrixModifyVerifyCBset, 122 wafeMatrixTraverseCellCBset, 122 wafeModifyVerifyCBset, 96 wafeMWMrunning, 65 wafeOwnSelectionCmd, 62 wafeRegisterCmd, 127 wafeRemoveInputCmd, 128 wafeSetCommunicationVariableCmd, 127 wafeStringToAtom, 65 wafeStringToAtomChk, 65 wafeTextSetSelectionArray, 95 wafeUnregisterCmd, 128 WAFEVERSION, 9 waitForVariable, 42, 61 whiteSpace, 33 widget, 26, 27 widgetId, 61 widgetName, 62 widthOfScreen, 20 window, 17, 62 WM DELETE WINDOW, 27 WM SAVE YOURSELF, 27 WM TAKE FOCUS, 27 write, 41
Tcl, 1, 5, 7, 9, 10, 12{15, 20, 22, 24, 29, 30, 32, 35, 36, 39{45, 139 tcl interactive, 9 term, 39, 40 Text, 13, 68 text, 32 textHeight, 97 textWidth, 20, 60 time, 126 Toggle, 13, 78 toggleSetRadioData, 78 topLevel, 12, 18 TopLevelShell, 13, 60 TransientShell, 13, 18, 60 translateCoords, 20, 60 Tree, 13, 80 true, 33, 34 type, 26 ungrabKeyboard, 61 ungrabPointer, 60 uninstallImage, 96 unknown, 25 unmanageChild, 18, 61 unmanaged, 12, 13, 17 unmapWidget, 17, 61 unrealizeWidget, 18, 61 unregister, 40, 128 Unspeci ed, 48 usr1, 39, 40 usr2, 39, 40
Xaw, 68 XawAsciiSave, 31, 68 XawAsciiSaveAsFile, 31, 68 XawAsciiSourceChanged, 31, 69
Viewport, 13, 79 133
XawAsciiSourceFreeString, 35, 69 XawDialogGetValueString, 69 XawFormDoLayout, 36, 70 XawListAppend, 30, 70 XawListChange, 28, 29, 70 XawListHighlight, 28, 71 XawListShowCurrent, 29, 71 XawListUnhighlight, 28, 71 XawPanedAllowResize, 36, 71 XawPanedGetMinMax, 36, 72 XawPanedGetNumSub, 37, 72 XawPanedSetMinMax, 36, 72 XawPanedSetRe gureMode, 37, 72 XawScrollbarSetThumb, 27, 72 XawSimpleMenuAddGlobalActions, 73 XawSimpleMenuClearActiveEntry, 38, 73 XawSimpleMenuGetActiveEntry, 37, 73 XawStripChartSet, 73, 74 XawTalk, 80 XawTextDisableRedisplay, 34, 74 XawTextDisplay, 34, 74 XawTextDisplayCaret, 34, 74 XawTextEnableRedisplay, 34, 74 XawTextGetInsertionPoint, 34, 75 XawTextGetSelectionPos, 35, 75 XawTextInvalidate, 33, 75 XawTextReplace, 35, 77 XawTextSearch, 32, 75 XawTextSetInsertionPoint, 34, 75 XawTextSetSelection, 35, 76 XawTextSetSelectionArray, 31, 76 XawTextSinkFindDistance, 76 XawTextSinkMaxHeight, 33, 76 XawTextSinkMaxLines, 33, 76 XawTextSinkSetTabs, 31, 76 XawTextSourceRead, 32, 33, 77 XawTextSourceScan, 33, 77 XawTextTopPosition, 34, 77 XawTextUnsetSelection, 35, 78 XawToggleChangeRadioGroup, 37, 78 134
XawToggleGetCurrent, 78 XawToggleSetCurrent, 78 XawToggleSetRadioData, 78 XawToggleUnsetCurrent, 37, 79 XawTreeForceLayout, 36, 80 XawViewportSetCoordinates, 79 XawViewportSetLocation, 79 Xbae, 111 XbaeCaption, 112 XbaeEnterCellCBset, 121 XbaeLeaveCellCBset, 121 XbaeMatrix, 112 XbaeMatrixAddColumns, 113 XbaeMatrixAddEmptyColumns, 113 XbaeMatrixAddEmptyRows, 113 XbaeMatrixAddRows, 113 XbaeMatrixCancelEdit, 113 XbaeMatrixCommitEdit, 113 XbaeMatrixDeleteColumns, 114 XbaeMatrixDeleteRows, 114 XbaeMatrixDeselectAll, 114 XbaeMatrixDeselectCell, 114 XbaeMatrixDeselectColumn, 114 XbaeMatrixDeselectRow, 115 XbaeMatrixDisableRedisplay, 115 XbaeMatrixEditCell, 115 XbaeMatrixEnableRedisplay, 115 XbaeMatrixFirstSelectedCell, 115 XbaeMatrixFirstSelectedColumn, 116 XbaeMatrixFirstSelectedRow, 116 XbaeMatrixGetCell, 116 XbaeMatrixGetCurrentCell, 116 XbaeMatrixGetNumSelected, 116 XbaeMatrixHighlightCell, 117 XbaeMatrixHighlightColumn, 117 XbaeMatrixHighlightRow, 117 XbaeMatrixIsCellSelected, 117 XbaeMatrixIsColumnSelected, 118 XbaeMatrixIsRowSelected, 118 XbaeMatrixNumColumns, 118 XbaeMatrixNumRows, 118 XbaeMatrixRefresh, 118 XbaeMatrixSelectAll, 119 XbaeMatrixSelectCell, 119
XbaeMatrixSelectColumn, 119 XbaeMatrixSelectRow, 119 XbaeMatrixSetCell, 119 XbaeMatrixSetCellBackground, 119 XbaeMatrixSetCellColor, 120 XbaeMatrixUnhighlightAll, 120 XbaeMatrixUnhighlightCell, 120 XbaeMatrixUnhighlightColumn, 120 XbaeMatrixUnhighlightRow, 120 XbaeMatrixVisibleColumns, 121 XbaeMatrixVisibleRows, 121 XbaeMatrixXToCol, 121 XbaeMatrixYToRow, 121 XbaeModifyVerifyCBset, 122 XbaeTraverseCellCBset, 122 XBell, 49 XConvertSelection, 63 XeAudio, 124 XeFrame, 124 XeRaster, 124 XeText, 123 XeTextEd, 124 XeVideo, 124 Xew, 123 XFetchBuer, 63 XFetchBytes, 63 XFlush, 52 x ush, 52 xioerr, 39, 40 XLowerWindow, 55 XmActivateProtocol, 95 XmAddProtocol, 94 XmAddProtocolCallback, 95 XmAddTabGroup, 80 XmArc, 101 XmArcGetPos, 101 XmArrowButton, 80 XmArrowButtonGadget, 80 XmBulletinBoard, 81 XmBulletinBoardDialog, 81 XmCascadeButton, 81 XmCascadeButtonGadget, 81 XmCascadeButtonGadgetHighlight, 81
XmCascadeButtonHighlight, 81 XmChangeColor, 96 XmComboBox, 99 XmCommand, 81 XmCommandAppendValue, 81 XmCommandError, 81 XmCommandGetChild, 81 XmContainer, 99 XmContainerGetItemChildren, 99 XmContainerRelayout, 100 XmContainerReorder, 100 XmCreateBulletinBoardDialog, 81 XmCreateErrorDialog, 82 XmCreateFileSelectionDialog, 82 XmCreateFormDialog, 82 XmCreateInformationDialog, 83 XmCreateMenuBar, 86 XmCreateMessageDialog, 86 XmCreateOptionMenu, 86 XmCreatePopupMenu, 86 XmCreatePromptDialog, 87 XmCreatePulldownMenu, 87 XmCreateQuestionDialog, 87 XmCreateRadioBox, 87 XmCreateScrolledCSText, 99 XmCreateScrolledGraph, 102 XmCreateScrolledList, 88 XmCreateScrolledText, 88 XmCreateSelectionDialog, 88 XmCreateSimpleCheckBox, 89 XmCreateSimpleMenuBar, 89 XmCreateSimpleOptionMenu, 89 XmCreateSimplePopupMenu, 89 XmCreateSimplePulldownMenu, 89 XmCreateSimpleRadioBox, 89 XmCreateWarningDialog, 94 XmCreateWorkingDialog, 94 XmCSText, 99 XmCSTextReplace, 99 XmDeactivateProtocol, 95 XmDialogShell, 81 XmDragContext, 97 XmDragIcon, 97 XmDragStart, 98 135
XmDrawingArea, 81 XmDrawnButton, 81 XmDropSiteEndUpdate, 98 XmDropSiteManager, 97 XmDropSiteRegister, 98 XmDropSiteStartUpdate, 98 XmDropSiteUnregister, 98 XmDropSiteUpdate, 98 XmDropTransfer, 98 XmDropTransferStart, 98 XmErrorDialog, 82 XmFileSelectionBox, 82 XmFileSelectionBoxGetChild, 82 XmFileSelectionDialog, 82 XmFileSelectionDoSearch, 82 XmForm, 82 XmFormDialog, 82 XmFrame, 83 XmGetDestination, 83 XmGetString, 96 XmGetXmScreen, 100 XmGraph, 101 XmGraphCenterAroundWidget, 103 XmGraphDestroyAllArcs, 103 XmGraphDestroyAllNodes, 103 XmGraphGetArcsBetweenNodes, 103 XmGraphInsertRoots, 103 XmIconGadget, 100 XmInformationDialog, 83 XmInstallImage, 96 XmLabel, 83 XmLabelGadget, 83 XmList, 83 XmListAddItem, 83 XmListAddItems, 83 XmListAddItemUnselected, 84 XmListDeleteAllItems, 84 XmListDeleteItem, 84 XmListDeleteItems, 84 XmListDeleteItemsPos, 84 XmListDeletePos, 84 XmListDeselectAllItems, 84 XmListDeselectItem, 84 XmListDeselectPos, 84
XmListGetMatchPos, 84 XmListGetSelectedPos, 84 XmListItemExists, 85 XmListItemPos, 85 XmListReplaceItems, 85 XmListReplaceItemsPos, 85 XmListSelectItem, 85 XmListSelectPos, 85 XmListSetAddMode, 85 XmListSetBottomItem, 85 XmListSetBottomPos, 85 XmListSetHorizPos, 85 XmListSetItem, 86 XmListSetPos, 86 XmMainWindow, 86 XmMainWindowSetAreas, 86 XmMenuBar, 86 XmMenuPosition, 86 XmMenuShell, 86 XmMessageBox, 86 XmMessageBoxGetChild, 86 XmMessageDialog, 86 XmModifyVerifyCBset, 96 XmNotebook, 100 XmOptionMenu, 86 XmPanedWindow, 86 XmPopupMenu, 86 XmProcessTraversal, 86 XmPromptDialog, 87 XmPulldownMenu, 87 XmPushButton, 87 XmPushButtonGadget, 87 XmQuestionDialog, 87 XmRadioBox, 87 XmRowColumn, 87 XmScale, 87 XmScaleSetTicks, 87 XmScrollBar, 87 XmScrollBarGetValues, 88 XmScrollBarSetValues, 88 XmScrolledCSText, 99 XmScrolledGraph, 102 XmScrolledList, 88 XmScrolledText, 88 136
XmScrolledWindow, 88 XmScrollVisible, 88 XmSelectionBox, 88 XmSelectionBoxGetChild, 88 XmSelectionDialog, 88 XmSeparator, 88 XmSeparatorGadget, 89 XmSimpleCheckBox, 89 XmSimpleMenuBar, 89 XmSimpleOptionMenu, 89 XmSimplePopupMenu, 89 XmSimplePulldownMenu, 89 XmSimpleRadioBox, 89 XmSpinBox, 100 XmStringDraw, 97 XmText, 89 XmTextClearSelection, 89 XmTextCopy, 89 XmTextCut, 89 XmTextDisableRedisplay, 90 XmTextEnableRedisplay, 90 XmTextField, 90 XmTextFieldClearSelection, 90 XmTextFieldCopy, 90 XmTextFieldCut, 90 XmTextFieldGetBaseline, 90 XmTextFieldGetLastPosition, 90 XmTextFieldGetSelection, 91 XmTextFieldGetSelectionPosition, 91 XmTextFieldGetString, 91 XmTextFieldInsert, 91 XmTextFieldPaste, 91 XmTextFieldPosToXY, 91 XmTextFieldRemove, 91 XmTextFieldReplace, 91 XmTextFieldSetAddMode, 91 XmTextFieldSetHighlight, 91 XmTextFieldSetInsertionPosition, 92 XmTextFieldSetSelection, 92 XmTextFieldSetSelectionArray, 95 XmTextFieldShowPosition, 92 XmTextFieldXYToPos, 92 XmTextFindString, 92 XmTextGetBaseline, 92
XmTextGetLastPosition, 92 XmTextGetSelection, 92 XmTextGetSelectionPosition, 92 XmTextGetString, 92 XmTextInsert, 93 XmTextPaste, 93 XmTextPosToXY, 93 XmTextRemove, 93 XmTextReplace, 93 XmTextScroll, 93 XmTextSetAddMode, 93 XmTextSetHighlight, 93 XmTextSetInsertionPosition, 93 XmTextSetSelection, 93 XmTextSetSelectionArray, 95 XmTextShowPosition, 94 XmTextXYToPos, 94 XmToggleButton, 94 XmToggleButtonGadget, 94 XmToggleButtonGadgetGetState, 94 XmToggleButtonGadgetSetState, 94 XmToggleButtonGetState, 94 XmToggleButtonSetState, 94 XmUninstallImage, 96 XmUpdateDisplay, 94 XmWarningDialog, 94 XmWorkingDialog, 94 Xpm, 67 xpm, 47 XRaiseWindow, 58 XReparentWindow, 65 XsCreateScrolledTree, 111 XSetWMProtocols, 59 XsScrolledTree, 111 XStoreBuer, 63 XsTree, 111 XSync, 60 Xt, 49 XtAppAddTimeOut, 49 XtAppAddWorkProc, 64 XtDestroyWidget, 51 XtDisownSelection, 62 XtGetSelectionValue, 62 XtGrabKeyboard, 53 137
XtGrabPointer, 54 XtHooksOfDisplay, 63 XtInstallAccelerators, 54 XtInstallAllAccelerators, 55 XtIsManaged, 65 XtIsShell, 64 XtManageChildren, 55 XtMapWidget, 55 XtNameToWidget, 56 XtPopdown, 57 XtPopup, 57 XtPopupSpringLoaded, 57 XtRealizeWidget, 58 XtRemoveAllCallbacks, 58 XtRemoveTimeOut, 58 XtRemoveWorkProc, 64 XtResolvePathname, 58 XtSetKeyboardFocus, 59 XtSetSensitive, 59 XtTranslateCoords, 60 XtUngrabKeyboard, 61 XtUngrabPointer, 60 XtUnmanageChildren, 61 XtUnmapWidget, 61 XtUnrealizeWidget, 61 XtWindow, 62 XVERSION, 9 xyLinePlotAttachData, 107 xyLinePlotExtendData, 107
138
References [1] David Flanagan, X Toolkit Intrinsics Reference Manual , Third Edition, O'Reilly and Associates Inc., 1990. [2] Arnaud Le Hors, The X PixMap Format , Part of the xpm distribution, 1991. [3] Joel McCormack, Paul Asente and Ralph Swick, X Toolkit Intrinsics { C Language Interface , Massachusetts Institute of Technology, 1990. [4] Gustaf Neumann, Stefan Nusser, Wafe - An X Toolkit Based Frontend for Application Programs in Various Programming Languages , Proc. USENIX Winter Conference, January 1993. [5] Adrian Nye { Tim O'Reilly, X Toolkit Intrinsics Programming Manual , Second Edition, O'Reilly and Associates Inc., 1990. [6] John K. Ousterhout, Tcl: An Embeddable Command Language , Proc. USENIX Winter Conference, January 1990. [7] Ralph Swick { Terry Weissman, X Toolkit Athena Widgets { C Language Interface , Massachusetts Institute of Technology, 1990.
139