1XMESSAGE(1) General Commands Manual XMESSAGE(1)
2
3
4
6 xmessage - display a message or query in a window (X-based /bin/echo)
7
9 xmessage [ -buttons label1[:value1],label2[:value2], ... ] [ options ]
10 -file filename
11 xmessage [ -buttons label1[:value1],label2[:value2], ... ] [ options ]
12 message ...
13
15 The xmessage program displays a window containing a message from the
16 command line, a file, or standard input. Along the lower edge of the
17 message is row of buttons; clicking the left mouse button on any of
18 these buttons will cause xmessage to exit. Which button was pressed is
19 returned in the exit status and, optionally, by writing the label of
20 the button to standard output.
21
22 The program is typically used by shell scripts to display information
23 to the user or to ask the user to make a choice.
24
25 Unless a size is specified, xmessage sizes itself to fit the message,
26 up to a maximum size. If the message is too big for the window, xmes‐
27 sage will display scroll bars.
28
30 These are the command line options that xmessage understands.
31
32 -buttons button,button,...
33 This option will cause xmessage to create one button for each
34 comma-separated button argument. The corresponding resource is
35 buttons. Each button consists of a label optionally followed
36 by a colon and an exit value. The label is the name of the
37 Command button widget created and will be the default text dis‐
38 played to the user. Since this is the name of the widget it
39 may be used to change any of the resources associated with that
40 button. The exit value will be returned by xmessage if that
41 button is selected. The default exit value is 100 plus the
42 button number. Buttons are numbered from the left starting
43 with one. The default string if no -buttons option is given is
44 okay:0.
45
46 -default label
47 Defines the button with a matching label to be the default. If
48 not specified there is no default. The corresponding resource
49 is defaultButton. Pressing Return anywhere in the xmessage
50 window will activate the default button. The default button
51 has a wider border than the others.
52
53 -file filename
54 File to display. The corresponding resource is file. A file‐
55 name of `-' reads from standard input. If this option is not
56 supplied, xmessage will display all non-option arguments in the
57 style of echo. Either -file or a message on the command line
58 should be provided, but not both.
59
60 -print This will cause the program to write the label of the button
61 pressed to standard output. Equivalent to setting the print‐
62 Value resource to TRUE. This is one way to get feedback as to
63 which button was pressed.
64
65 -center Pop up the window at the center of the screen. Equivalent to
66 setting the center resource to TRUE.
67
68 -nearmouse
69 Pop up the window near the mouse cursor. Equivalent to setting
70 the nearMouse resource to TRUE.
71
72 -timeout secs
73 Exit with status 0 after secs seconds if the user has not
74 clicked on a button yet. The corresponding resource is time‐
75 out.
76
78 Knowing the name and position in the hierarchy of each widget is useful
79 when specifying resources for them. In the following chart, the class
80 and name of each widget is given.
81
82 Xmessage (xmessage)
83 Form form
84 Text message
85 Command (label1)
86 Command (label2)
87 .
88 .
89 .
90
92 The program has a few top-level application resources that allow cus‐
93 tomizations that are specific to xmessage.
94
95 file A String specifying the file to display.
96
97 buttons A String specifying the buttons to display. See the -buttons
98 command-line option.
99
100 defaultButton
101 A String specifying a default button by label.
102
103 printValue
104 A Boolean value specifying whether the label of the button
105 pressed to exit the program is written to standard output. The
106 default is FALSE.
107
108 center A Boolean value specifying whether to pop up the window at the
109 center of the screen. The default is FALSE.
110
111 nearMouse
112 A Boolean value specifying whether to pop up the window near
113 the mouse cursor. The default is FALSE.
114
115 timeout The number of seconds after which to exit with status 0. The
116 default is 0, which means never time out.
117
118 maxHeight (class Maximum)
119 The maximum height of the text part of the window in pixels,
120 used if no size was specified in the geometry. The default is
121 0, which means use 70% of the height of the screen.
122
123 maxWidth (class Maximum)
124 The maximum width of the text part of the window in pixels,
125 used if no size was specified in the geometry. The default is
126 0, which means use 70% of the width of the screen.
127
129 exit(value)
130 exit immediately with an exit status of value (default 0).
131 This action can be used with translations to provide alternate
132 ways of exiting xmessage.
133
134 default-exit()
135 exit immediately with the exit status specified by the default
136 button. If there is no default button, this action has no
137 effect.
138
140 If it detects an error, xmessage returns 1, so this value should not be
141 used with a button.
142
144 X(7), echo(1), cat(1)
145
147 Chris Peterson, MIT Project Athena
148 Stephen Gildea, X Consortium
149
150
151
152X Version 11 xmessage 1.0.1 XMESSAGE(1)