NAME
xmessage - display a message or query in a window (X-based /bin/echo)
SYNOPSIS
xmessage
[
-buttons
label1[::value1],,label2[::value2],,
...
] [
options
]
-file
filename
xmessage
[
-buttons
label1[::value1],,label2[::value2],,
...
] [
options
]
message
...
DESCRIPTION
The
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 _x_m_e_s_s_a_g_e to exit.
Which button was pressed is returned in the exit status and,
optionally, by writing the label of the button to standard output.
The program
is typically used by shell scripts to display information to the user
or to ask the user to make a choice.
Unless a size is specified, _x_m_e_s_s_a_g_e
sizes itself to fit the message, up to a maximum size.
If the message is too big for the window, _x_m_e_s_s_a_g_e will display
scroll bars.
OPTIONS
These are the command line options that _x_m_e_s_s_a_g_e understands.
-
-buttons _b_u_t_t_o_n_,_b_u_t_t_o_n_,_._._.
-
This option will cause _x_m_e_s_s_a_g_e to create one button for each
comma-separated _b_u_t_t_o_n argument.
The corresponding resource is bbuuttttoonnss.
Each _b_u_t_t_o_n 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 _x_m_e_s_s_a_g_e
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 --bbuuttttoonnss option is given is ookkaayy::00.
-
-default _l_a_b_e_l
-
Defines the button with a matching _l_a_b_e_l to be the default.
If not specified there is no default.
The corresponding resource is ddeeffaauullttBBuuttttoonn.
Pressing Return anywhere in the _x_m_e_s_s_a_g_e window will activate
the default button.
The default button has a wider border than the others.
-
-file _f_i_l_e_n_a_m_e
-
File to display.
The corresponding resource is ffiillee.
A _f_i_l_e_n_a_m_e of `--' reads from standard input.
If this option is not supplied, _x_m_e_s_s_a_g_e will
display all non-option arguments in the style of _e_c_h_o.
Either --ffiillee or a message on the command line
should be provided, but not both.
-
-print
-
This will cause the program to write the label of the button pressed to
standard output. Equivalent to setting the pprriinnttVVaalluuee resource
to TRUE.
This is one way to get feedback as to which button was pressed.
-
-center
-
Pop up the window at the center of the screen.
Equivalent to setting the cceenntteerr resource to TRUE.
-
-nearmouse
-
Pop up the window near the mouse cursor.
Equivalent to setting the nneeaarrMMoouussee resource to TRUE.
-
-timeout _s_e_c_s
-
Exit with status 0 after _s_e_c_s seconds if the user has not
clicked on a button yet.
The corresponding resource is ttiimmeeoouutt.
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.
Xmessage (xmessage)
Form form
Text message
Command (label1)
Command (label2)
.
.
.
RESOURCES
The program has a few top-level application resources that allow
customizations that are specific to _x_m_e_s_s_a_g_e.
-
file
-
A String specifying the file to display.
-
buttons
-
A String specifying the buttons to display.
See the --bbuuttttoonnss command-line option.
-
defaultButton
-
A String specifying a default button by label.
-
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.
-
center
-
A Boolean value specifying whether to pop up the window at the center
of the screen. The default is FALSE.
-
nearMouse
-
A Boolean value specifying whether to pop up the window near the mouse
cursor. The default is FALSE.
-
timeout
-
The number of seconds after which to exit with
status 0. The default is 0, which means never time out.
-
maxHeight (ccllaassss MMaaxxiimmuumm))</bb>>
<>
TThhee mmaaxxiimmuumm hheeiigghhtt ooff tthhee tteexxtt ppaarrtt ooff tthhee wwiinnddooww iinn ppiixxeellss,,
uusseedd iiff nnoo ssiizzee wwaass ssppeecciiffiieedd iinn tthhee ggeeoommeettrryy..
TThhee ddeeffaauulltt iiss 00,, wwhhiicchh mmeeaannss uussee 7700%% ooff tthhee hheeiigghhtt ooff tthhee ssccrreeeenn..
<>
<>mmaaxxWWiiddtthh ((ccllaassss MMaaxxiimmuumm))</bb>>
<>
TThhee mmaaxxiimmuumm wwiiddtthh ooff tthhee tteexxtt ppaarrtt ooff tthhee wwiinnddooww iinn ppiixxeellss,,
uusseedd iiff nnoo ssiizzee wwaass ssppeecciiffiieedd iinn tthhee ggeeoommeettrryy..
TThhee ddeeffaauulltt iiss 00,, wwhhiicchh mmeeaannss uussee 7700%% ooff tthhee wwiiddtthh ooff tthhee ssccrreeeenn..
</ddll>>
<> AACCTTIIOONNSS </hh33>>
<>
<>
<>eexxiitt((_v_a_l_u_e))</bb>>
<>
eexxiitt iimmmmeeddiiaatteellyy wwiitthh aann eexxiitt ssttaattuuss ooff _v_a_l_u_e ((ddeeffaauulltt 00)).. TThhiiss
aaccttiioonn ccaann bbee uusseedd wwiitthh ttrraannssllaattiioonnss ttoo pprroovviiddee aalltteerrnnaattee wwaayyss ooff
eexxiittiinngg _x_m_e_s_s_a_g_e..
<>
<>ddeeffaauulltt--eexxiitt(())</bb>>
<>
eexxiitt iimmmmeeddiiaatteellyy wwiitthh tthhee eexxiitt ssttaattuuss ssppeecciiffiieedd bbyy tthhee ddeeffaauulltt bbuuttttoonn..
IIff tthheerree iiss nnoo ddeeffaauulltt bbuuttttoonn,, tthhiiss aaccttiioonn hhaass nnoo eeffffeecctt..
</ddll>>
<> EEXXIITT SSTTAATTUUSS </hh33>>
IIff iitt ddeetteeccttss aann eerrrroorr,, _x_m_e_s_s_a_g_e rreettuurrnnss 11,, ssoo tthhiiss vvaalluuee sshhoouulldd
nnoott bbee uusseedd wwiitthh aa bbuuttttoonn..
<> SSEEEE AALLSSOO </hh33>>
<>XX((77))</aa>>
<>eecchhoo((11))</aa>>
<>ccaatt((11))</aa>>
<>
<> AAUUTTHHOORRSS </hh33>>
CChhrriiss PPeetteerrssoonn,, MMIITT PPrroojjeecctt AAtthheennaa
<>
SStteepphheenn GGiillddeeaa,, XX CCoonnssoorrttiiuumm
</bbooddyy>>
</hhttmmll>>