Release 1.6.0.
[xtoys] / xgetline.1
... / ...
CommitLineData
1.\" -*-nroff-*-
2.TH xgetline 1 "15 November 1998" "Straylight/Edgeware" "xtoys"
3.SH NAME
4xgetline \- request a line of text in an X dialogue box
5.SH SYNOPSIS
6.B xgetline
7.RI [ gtk-options ...]
8.RB [ -Hin ]
9.RB [ \- M
10.IR max ]
11.RB [ \-d
12.IR default ]
13.RB [ \-l
14.IR file ]
15.RB [ \-p
16.IR prompt ]
17.RB [ \-t
18.IR title ]
19.SH DESCRIPTION
20The
21.B xgetline
22program reads a line of text from the user via a pretty GTK dialogue
23box. The title bar contents, prompt string, and default text are all
24configurable. If the user enters a string and clicks the
25.B OK
26button (or
27presses
28.IR enter ),
29the string is echoed to standard output and
30.B xgetline
31returns an exit status of zero. If the user cancels the dialogue box
32(by closing it, or pressing
33.IR escape ),
34.B xgetline
35echoes nothing and returns an exit status of one.
36.PP
37The
38.B xgetline
39program is intended to be used in window manager configuration files, to
40allow users to fill in bits of text (e.g., hostnames or shell commands)
41in generally useful places. For example, the author has the following
42shell command attached to a hotkey:
43.PP
44.RS 5
45.ft B
46.nf
47cmd=$(xgetline -t "Shell command in window" -p "_Command:") &&
48 xterm -T "$cmd" -e sh -c "$cmd"
49.ft R
50.fi
51.SS Options
52.TP 5
53.B "\-H, \-\-history"
54With
55.BR \-l ,
56update the file with the newly entered line at the top. Other lines
57matching the newly entered string are not written. No effect without
58.BR \-l .
59.TP 5
60.BI "\-M, \-\-histmax " max
61When writing an updated history file, do not write more than
62.I max
63lines. The default is 20; a value of 0 disables a length limit on the
64history file.
65.TP 5
66.BI "\-d, \-\-default " default
67Sets the default text in the entry field to
68.IR default .
69The default default is the first item in the empty string. The special
70default string
71.RB ` @ '
72sets the default to be the first item in the history list, if one is
73supplied.
74.TP 5
75.B \-i, \-\-invisible
76Don't echo characters to the screen when they're typed. Useful when
77requesting passwords and similar secrets.
78.TP 5
79.BI "\-l, \-\-list " file
80Reads a list of alternatives from
81.I file
82and displays them in a drop-down list box. The user can rapidly select
83an item from the drop-down list using the mouse or cursor keys. The
84file is not modified (but see the
85.B \-\-history
86option below).
87.TP 5
88.B "\-n, \-\-no-choice"
89One of the items from the selection list must be chosen; the user may
90not type an entry in directly.
91.TP 5
92.BI "\-p, \-\-prompt " prompt
93Sets the prompt string in the dialogue box to
94.IR prompt .
95If the prompt string contains an underscore character
96.RB ` _ ',
97then the following character appears underlined; pressing Alt and the
98leftmost underlined character (the `mnemonic') moves the input focus to
99the entry widget. If you want a literal underscore, type two
100consecutive underscores. The default is to have no prompt string.
101.TP 5
102.BI "\-t, \-\-title " title
103Sets the title of the dialogue box to
104.IR title .
105The default title is
106.RB ` "Input request" '.
107.SH BUGS
108Hopefully none.
109.SH SEE ALSO
110.BR gtk-options (7).
111.SH AUTHOR
112Mark Wooding (mdw@distorted.org.uk).