summaryrefslogtreecommitdiff
path: root/app/xmessage/man/xmessage.man
blob: 6499d0afcaf711b19fa5dde316ef93d0a9fec15f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
.\" $XConsortium: xmessage.man,v 1.8 95/03/08 22:28:48 gildea Exp $
.\"
.\" $XFree86$
.\"
.TH XMESSAGE 1 __xorgversion__
.SH NAME
xmessage \- display a message or query in a window (X-based /bin/echo)
.SH SYNOPSIS
.B xmessage
[
.B \-buttons
.I label1\fR[\fP\fB:\fPvalue1\fR]\fP\fB,\fPlabel2\fR[\fP\fB:\fPvalue2\fR]\fP\fB,\fP
\&\|.\|.\|.
] [
.I options
]
.B \-file
.I filename
.br
.B xmessage
[
.B \-buttons
.I label1\fR[\fP\fB:\fPvalue1\fR]\fP\fB,\fPlabel2\fR[\fP\fB:\fPvalue2\fR]\fP\fB,\fP
\&\|.\|.\|.
] [
.I options
]
.I message
\&.\|.\|.
.br
.B xmessage
[
.B \-help
|
.B \-version
]
.SH DESCRIPTION
The
.I xmessage
program
displays a window containing a message from the command line, a file,
or standard input.
Along the lower edge of the message is row
of buttons; clicking the left mouse button
on any of these buttons will cause \fIxmessage\fP to exit.
Which button was pressed is returned in the exit status and,
optionally, by writing the label of the button to standard output.
.PP
The program
is typically used by shell scripts to display information to the user
or to ask the user to make a choice.
.PP
Unless a size is specified, \fIxmessage\fP
sizes itself to fit the message, up to a maximum size.
If the message is too big for the window, \fIxmessage\fP will display
scroll bars.
.SH OPTIONS
These are the command line options that \fIxmessage\fP understands, in addition
to the standard ones listed in
.BR X (__miscmansuffix__).
.TP 8
.B \-buttons \fIbutton,button,.\|.\|.\fP
This option will cause \fIxmessage\fP to create one button for each
comma-separated \fIbutton\fP argument.
The corresponding resource is \fBbuttons\fP.
Each \fIbutton\fP consists of a label optionally followed by a colon
and an exit value.
The label is the name of the Command button widget created and will be the
default text displayed to the user.  Since this is the name of the widget
it may be used to change any of the resources associated with that button.
The exit value will be returned by \fIxmessage\fP
if that button is selected.  The default exit value is 100 plus the
button number.  Buttons are numbered from the left starting with one.
The default string if no \fB\-buttons\fP option is given is \fBokay:0\fP.
.TP 8
.B \-default \fIlabel\fP
Defines the button with a matching \fIlabel\fP to be the default.
If not specified there is no default.
The corresponding resource is \fBdefaultButton\fP.
Pressing Return anywhere in the \fIxmessage\fP window will activate
the default button.
The default button has a wider border than the others.
.TP 8
.B \-file \fIfilename\fP
File to display.
The corresponding resource is \fBfile\fP.
A \fIfilename\fP of `\fB\-\fP' reads from standard input.
If this option is not supplied, \fIxmessage\fP will
display all non-option arguments in the style of \fIecho\fP.
Either \fB\-file\fP or a message on the command line
should be provided, but not both.
.TP 8
.B \-print
This will cause the program to write the label of the button pressed to
standard output.  Equivalent to setting the \fBprintValue\fP resource
to TRUE.
This is one way to get feedback as to which button was pressed.
.TP 8
.B \-center
Pop up the window at the center of the screen.
Equivalent to setting the \fBcenter\fP resource to TRUE.
.TP 8
.B \-nearmouse
Pop up the window near the mouse cursor.
Equivalent to setting the \fBnearMouse\fP resource to TRUE.
.TP 8
.B \-timeout \fIsecs\fP
Exit with status 0 after \fIsecs\fP seconds if the user has not
clicked on a button yet.
The corresponding resource is \fBtimeout\fP.
.TP 8
.B \-help
Print a usage message and exit.
.TP 8
.B \-version
Print version info and exit.
.SH "WIDGET HIERARCHY"
Knowing the name and position in the hierarchy of each widget is
useful when specifying resources for them.  In the following chart, the
class and name of each widget is given.
.LP
.nf
Xmessage (xmessage)
	Form form
		Text message
		Command (label1)
		Command (label2)
		.
		.
		.
.fi
.SH RESOURCES
The program has a few top-level application resources that allow
customizations that are specific to \fIxmessage\fP.
.TP 8
.B file
A String specifying the file to display.
.TP 8
.B buttons
A String specifying the buttons to display.
See the \fB\-buttons\fP command-line option.
.TP 8
.B defaultButton
A String specifying a default button by label.
.TP 8
.B printValue
A Boolean value specifying whether the label of the
button pressed to exit the program is written to standard output.
The default is FALSE.
.TP 8
.B center
A Boolean value specifying whether to pop up the window at the center
of the screen.  The default is FALSE.
.TP 8
.B nearMouse
A Boolean value specifying whether to pop up the window near the mouse
cursor.  The default is FALSE.
.TP 8
.B timeout
The number of seconds after which to exit with
status 0.  The default is 0, which means never time out.
.TP 8
.B "maxHeight (\fPclass\fB Maximum)
The maximum height of the text part of the window in pixels,
used if no size was specified in the geometry.
The default is 0, which means use 70% of the height of the screen.
.TP 8
.B "maxWidth (\fPclass\fB Maximum)
The maximum width of the text part of the window in pixels,
used if no size was specified in the geometry.
The default is 0, which means use 70% of the width of the screen.
.SH ACTIONS
.TP 8
.B exit(\fIvalue\fP)
exit immediately with an exit status of \fIvalue\fP (default 0).  This
action can be used with translations to provide alternate ways of
exiting \fIxmessage\fP.
.TP 8
.B default-exit()
exit immediately with the exit status specified by the default button.
If there is no default button, this action has no effect.
.SH "EXIT STATUS"
If it detects an error, \fIxmessage\fP returns 1, so this value should
not be used with a button.
.SH "SEE ALSO"
.IR X (__miscmansuffix__),
.IR echo (__appmansuffix__),
.IR cat (__appmansuffix__)
.br
.SH AUTHORS
Chris Peterson, MIT Project Athena
.br
Stephen Gildea, X Consortium