Release 1.6.0.
[xtoys] / xmsg.1
CommitLineData
2b6e1eca 1.\" -*-nroff-*-
2.TH xmsg 1 "20 December 2001" "Edgeware tools"
3.SH NAME
4xmsg \- pops up a message box
5.SH SYNOPSIS
2b6e1eca 6.B xmsg
bce8c6ee
MW
7.RI [ gtk-options ...]
8.RB [ \-EIQWm ]
9.RB [ \-d
10.IR headline ]
2b6e1eca 11.RB [ \-t
12.IR title ]
2b6e1eca 13.I message
14.RI [ button ...]
2b6e1eca 15.SH DESCRIPTION
16The
17.B xmsg
18program pops up a pretty GTK message box, containing the listed buttons
19(shown right to left along the bottom). The button strings are listed,
20one per argument, after the message. If no buttons are requested, an
21.B OK
22button is provided anyway.
23.PP
bce8c6ee
MW
24The user dismisses the message window by activating one of the buttons
25or just closing the window using the window manager. The
26.B xsmg
27program then writes a string to its standard output describing the
28user's action and exits. The string written is, by default, the label
29of the activated button, though this can be overridden: see below.
30.SS "Message specifications"
31The
32.I message
33argument is usually just a text string to be displayed. However, if the
4954eef2 34.I message
35is
36.RB ` \- '
bce8c6ee 37then, instead, the message to display is read from standard input. If the
4954eef2 38first character of
39.I message
40is
bce8c6ee
MW
41.RB ` ! '
42then that character is removed. (Hence, if you really wanted to show
43the message
c1c9f4d2 44.RB ` \- ',
bce8c6ee
MW
45you need to pass
46.RB ` !\- '.)
47Conscientious script authors will prefix strings appropriately.
48.PP
49Pango markup may be used in message and headline strings if the
50.B \-m
51option is requested.
52.SS "Button specifications"
53A
54.I button
55argument has the form
56.RI [ opt \fB: opt \fB: ...] \c
57.RB [ ! ] \c
58.IR label .
59The
60.I label
c1c9f4d2 61is either a text string, or a GTK stock-id (e.g.,
bce8c6ee
MW
62.BR gtk-ok ).
63Mnemonic characters in button labels may be marked by prefixing them
64with underscores. Write two underscores if you really want a literal
65underscore to appear.
4954eef2 66.PP
bce8c6ee
MW
67Each
68.I opt
69may be one of the following.
70.TP
71.B default
72This should be the default button, activated when the user presses the
73.I enter
74or
75.I return
76key.
77.TP
78.B cancel
79This should be the cancel button, activated when the user presses the
80.I escape
81key or simply dismisses the window.
82.TP
83.BI = tag
84If the user activates this button, output the
85.I tag
86rather than the button's label.
2b6e1eca 87.PP
bce8c6ee
MW
88If no button is marked as the default, then the rightmost (first
89specified) is chosen automatically; similarly, if there is no specified
90cancel button then the last is chosen. If several buttons are marked as
91default or cancel buttons then the behaviour is unspecified.
2b6e1eca 92.PP
bce8c6ee
MW
93Button options are usually processed while colons remain in the button
94specification. Processing stops early if an exclamation mark
95.RB ` ! '
96is reached. For example,
97.B default:!cancel:button
98is parsed has specifying the
99.B default
100option and a label text of
101.BR cancel:button .
102.PP
103If no
104.I button
105arguments are given,
106.B xmsg
107automatically provides an OK button (it actually uses the GTK
108.B gtk-ok
109stock button) but produces no output.
2b6e1eca 110.SS Options
bce8c6ee
MW
111.TP
112.BR \-E ", " \-I ", " \-Q ", " \-W
113Mark the message window as, respectively, reporting an error, providing
114information, asking a question, or giving a warning.
115.TP
116.BR "\-d, \-\-headline " headline
117Write the
118.I headline
119above the main message, in larger and bolder text.
120.TP
121.B "\-m, \-\-markup"
122Enable the use of Pango XML-like markup in the message and headline
123strings. See the Pango documentation for a description of the markup
124tags available.
125.TP
2b6e1eca 126.BI "\-t, \-\-title " title
127Sets the title for the window. If you don't specify a title, the window
128is labelled
129.RB ` xmsg '.
2b6e1eca 130.SH BUGS
131None currently known.
bce8c6ee
MW
132.SH SEE ALSO
133.BR gtk-options (7).
f6795c17
MW
134.SH AUTHOR
135Mark Wooding (mdw@distorted.org.uk).