Change build structure a bit: put common code in a library.
[xtoys] / xgetline.1
1 .TH xgetline 1 "15 November 1998" "Edgeware tools"
2 .SH NAME
3 xgetline \- request a line of text in an X dialogue box
4 .SH SYNOPSIS
5 .B xgetline
6 .RB [ \-t
7 .IR title ]
8 .RB [ \-p
9 .IR prompt ]
10 .RB [ \-d
11 .IR default ]
12 .SH DESCRIPTION
13 The
14 .B xgetline
15 program reads a line of text from the user via a pretty GTK dialogue
16 box. The title bar contents, prompt string, and default text are all
17 configurable. If the user enters a string and clicks the
18 .B OK
19 button (or
20 presses
21 .IR enter ),
22 the string is echoed to standard output and
23 .B xgetline
24 returns an exit status of zero. If the user cancels the dialogue box
25 (by closing it, or pressing
26 .IR escape ),
27 .B xgetline
28 echoes nothing and returns an exit status of one.
29 .PP
30 The
31 .B xgetline
32 program is intended to be used in window manager configuration files, to
33 allow users to fill in bits of text (e.g., hostnames or shell commands)
34 in generally useful places. For example, the author has the following
35 shell command attached to a hotkey:
36 .PP
37 .RS 5
38 .ft B
39 .nf
40 cmd=`xgetline -t "Shell command in window" -p "Command:"` &&
41 xterm -T "$cmd" -e sh -c "$cmd"
42 .ft R
43 .fi
44 .SS OPTIONS
45 .TP 5
46 .BI "\-t, \-\-title " title
47 Sets the title of the dialogue box to
48 .IR title .
49 The default title is
50 .RB ` "Input request" '.
51 .TP 5
52 .BI "\-p, \-\-prompt " prompt
53 Sets the prompt string in the dialogue box to
54 .IR prompt .
55 The default is to have no prompt string.
56 .TP 5
57 .BI "\-d, \-\-default " default
58 Sets the default text in the entry field to
59 .IR default .
60 The default default is the empty string.
61 .SH AUTHOR
62 Mark Wooding (mdw@nsict.org).
63 .SH BUGS
64 Hopefully none.