]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/dialog/dialog.1
Update serf 1.2.1 -> 1.3.0 for svn
[FreeBSD/FreeBSD.git] / contrib / dialog / dialog.1
1 '\" t
2 .\" $Id: dialog.1,v 1.165 2013/03/15 09:07:30 tom Exp $
3 .\" Copyright 2005-2012,2013  Thomas E. Dickey
4 .\"
5 .\" This program is free software; you can redistribute it and/or modify
6 .\" it under the terms of the GNU Lesser General Public License, version 2.1
7 .\" as published by the Free Software Foundation.
8 .\"
9 .\" This program is distributed in the hope that it will be useful, but
10 .\" WITHOUT ANY WARRANTY; without even the implied warranty of
11 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 .\" Lesser General Public License for more details.
13 .\"
14 .\" You should have received a copy of the GNU Lesser General Public
15 .\" License along with this program; if not, write to
16 .\"     Free Software Foundation, Inc.
17 .\"     51 Franklin St., Fifth Floor
18 .\"     Boston, MA 02110, USA.
19 .\"
20 .\" definitions for renaming
21 .ds p dialog
22 .ds l dialog
23 .ds L Dialog
24 .ds D DIALOG
25 .\"
26 .de ES
27 .ne 8
28 .IP
29 ..
30 .de Ex
31 .RS +7
32 .PP
33 .nf
34 ..
35 .de Ee
36 .fi
37 .RE
38 ..
39 .\" Bulleted paragraph
40 .de bP
41 .IP \(bu 4
42 ..
43 .
44 .TH \*D 1 "" "$Date: 2013/03/15 09:07:30 $"
45 .SH NAME
46 dialog \- display dialog boxes from shell scripts
47 .SH SYNOPSIS
48 \fB\*p --clear\fP
49 .br
50 .BI "\*p --create-rc " file
51 .br
52 \fB\*p --print-maxsize\fP
53 .br
54 \fB\*p\fP
55 \fIcommon-options\fP
56 \fIbox-options\fP
57 .SH DESCRIPTION
58 \fB\*L\fP
59 is a program that will let you to present a variety of questions or
60 display messages using dialog boxes from a shell script.
61 These types of dialog boxes are implemented
62 (though not all are necessarily compiled into \fB\*p\fR):
63 .RS
64 .LP
65 .nh
66 .na
67 .BR buildlist ", "
68 .BR calendar ", "
69 .BR checklist ", "
70 .BR dselect ", "
71 .BR editbox ", "
72 .BR form ", "
73 .BR fselect ", "
74 .BR gauge ", "
75 .BR infobox ", "
76 .BR inputbox ", "
77 .BR inputmenu ", "
78 .BR menu ", "
79 .BR mixedform ", "
80 .BR mixedgauge ", "
81 .BR msgbox " (message), "
82 .BR passwordbox ", "
83 .BR passwordform ", "
84 .BR pause ", "
85 .BR prgbox ", "
86 .BR programbox ", "
87 .BR progressbox ", "
88 .BR radiolist ", "
89 .BR rangebox ", "
90 .BR tailbox ", "
91 .BR tailboxbg ", "
92 .BR textbox ", "
93 .BR timebox ", "
94 .BR treeview ", and "
95 .BR yesno " (yes/no)."
96 .ad
97 .hy
98 .RE
99 .PP
100 You can put more than one dialog box into a script:
101 .bP
102 Use the "\fB--and-widget\fP" token to force \fB\*p\fP to proceed to the next
103 dialog unless you have pressed ESC to cancel, or
104 .bP
105 Simply add the tokens for the next dialog box, making a chain.
106 \*L stops chaining when the return code from a dialog is nonzero,
107 e.g., Cancel or No (see DIAGNOSTICS).
108 .PP
109 Some widgets, e.g., checklist, will write text to \fB\*p\fP's output.
110 Normally that is the standard error, but there are options for
111 changing this: "\fB--output-fd\fP", "\fB--stderr\fP" and "\fB--stdout\fP".
112 No text is written if the Cancel button (or ESC) is pressed;
113 \fB\*p\fP exits immediately in that case.
114 .
115 .\" ************************************************************************
116 .SH OPTIONS
117 All options begin with "\fB--\fP"
118 (two ASCII hyphens,
119 for the benefit of those using systems with deranged locale support).
120 .PP
121 A "\fB--\fP" by itself is used as an escape,
122 i.e., the next token on the command-line is not treated as an option.
123 .RS
124 .B \*p --title -- --Not an option
125 .RE
126 .PP
127 The "\fB--args\fP" option tells \fB\*p\fP to list the command-line
128 parameters to the standard error.
129 This is useful when debugging complex scripts using
130 the "\fB--\fP" and "\fB--file\fP",
131 since the command-line may be rewritten as these are expanded.
132 .PP
133 The "\fB--file\fP" option tells \fB\*p\fP to read parameters from
134 the file named as its value.
135 .RS
136 .B \*p --file \fIparameterfile
137 .RE
138 Blanks not within double-quotes are discarded
139 (use backslashes to quote single characters).
140 The result is inserted into the command-line,
141 replacing "\fB--file\fP" and its option value.
142 Interpretation of the command-line resumes from that point.
143 If \fIparameterfile\fP begins with "&", \fB\*p\fP
144 interprets the following text as a file descriptor number
145 rather than a filename.
146 .
147 .SS \fBCommon Options\fP
148 .
149 .IP "\fB--ascii-lines
150 Rather than draw graphics lines around boxes,
151 draw ASCII "+" and "-" in the same place.
152 See also "\fB--no-lines\fR".
153 .
154 .IP "\fB--aspect \fIratio"
155 This gives you some control over the box dimensions when using auto
156 sizing (specifying 0 for height and width).
157 It represents width / height.
158 The default is 9, which means 9 characters wide to every 1 line high.
159 .
160 .IP "\fB--backtitle \fIbacktitle"
161 Specifies a
162 \fIbacktitle\fP
163 string to be displayed on the backdrop, at the top of the screen.
164 .
165 .IP "\fB--begin \fIy x"
166 Specify the position of the upper left corner of a dialog box on the screen.
167 .
168 .IP "\fB--cancel-label \fIstring"
169 Override the label used for "Cancel" buttons.
170 .
171 .IP "\fB--clear"
172 Clears the widget screen, keeping only the screen_color background.
173 Use this when you combine widgets with "\fB--and-widget\fR" to erase the
174 contents of a previous widget on the screen, so it won't be seen
175 under the contents of a following widget.
176 Understand this as the complement of "\fB--keep-window\fR".
177 To compare the effects, use these:
178 .
179 .ES
180 All three widgets visible, staircase effect, ordered 1,2,3:
181 .Ex
182 \*p \\
183                                --begin 2 2 --yesno "" 0 0 \\
184     --and-widget               --begin 4 4 --yesno "" 0 0 \\
185     --and-widget               --begin 6 6 --yesno "" 0 0
186 .Ee
187 .
188 .ES
189 Only the last widget is left visible:
190 .Ex
191 \*p \\
192                  --clear       --begin 2 2 --yesno "" 0 0 \\
193     --and-widget --clear       --begin 4 4 --yesno "" 0 0 \\
194     --and-widget               --begin 6 6 --yesno "" 0 0
195 .Ee
196 .
197 .ES
198 All three widgets visible, staircase effect, ordered 3,2,1:
199 .Ex
200 \*p \\
201                  --keep-window --begin 2 2 --yesno "" 0 0 \\
202     --and-widget --keep-window --begin 4 4 --yesno "" 0 0 \\
203     --and-widget               --begin 6 6 --yesno "" 0 0
204 .Ee
205 .
206 .ES
207 First and third widget visible, staircase effect, ordered 3,1:
208 .Ex
209 \*p \\
210                  --keep-window --begin 2 2 --yesno "" 0 0 \\
211     --and-widget --clear       --begin 4 4 --yesno "" 0 0 \\
212     --and-widget               --begin 6 6 --yesno "" 0 0
213 .Ee
214 .IP
215 Note, if you want to restore original console colors and send your
216 cursor home after the dialog program has exited, use the \fBclear\fR\ (1)
217 command.
218 .
219 .IP "\fB--colors"
220 Interpret embedded "\\Z" sequences in the dialog text
221 by the following character,
222 which tells \fB\*p\fP to set colors or video attributes:
223 0 through 7 are the ANSI used in curses:
224 black,
225 red,
226 green,
227 yellow,
228 blue,
229 magenta,
230 cyan and
231 white respectively.
232 Bold is set by 'b', reset by 'B'.
233 Reverse is set by 'r', reset by 'R'.
234 Underline is set by 'u', reset by 'U'.
235 The settings are cumulative, e.g., "\\Zb\\Z1" makes the following text
236 bold (perhaps bright) red.
237 Restore normal settings with "\\Zn".
238 .
239 .IP "\fB--column-separator \fIstring"
240 Tell \fB\*p\fP to split data for radio/checkboxes and menus on the
241 occurrences of the given string, and to align the split data into columns.
242 .
243 .IP "\fB--cr-wrap"
244 Interpret embedded newlines in the dialog text as a newline on the screen.
245 Otherwise, \fB\*p\fR will only wrap lines where needed to fit inside the text box.
246 .IP
247 Even though you can control line breaks with this,
248 \fB\*L\fR will still wrap any lines that are too long for the width of the box.
249 Without cr-wrap, the layout of your text may be formatted to look nice
250 in the source code of your script without affecting the way it will
251 look in the dialog.
252 .IP
253 See also the "\fB--no-collapse\fP" and "\fB--trim\fP" options.
254 .
255 .IP "\fB--create-rc \fIfile"
256 When
257 \fB\*p\fP
258 supports run-time configuration,
259 this can be used to dump a sample configuration file to the file specified
260 by
261 .IR file "."
262 .
263 .IP "\fB--date-format \fIformat"
264 If the host provides \fBstrftime\fP,
265 this option allows you to specify the format of the date printed for
266 the \fB--calendar\fP widget.
267 The time of day (hour, minute, second) are the current local time.
268 .
269 .IP "\fB--defaultno"
270 Make the default value of the
271 \fByes/no\fP
272 box a
273 .BR No .
274 Likewise, make the default button of widgets that provide "OK" and "Cancel"
275 a \fBCancel\fP.
276 If "\fB--nocancel\fP" or "\fB--visit-items\fP" are given
277 those options overrides this,
278 making the default button always "Yes" (internally the same as "OK").
279 .
280 .IP "\fB--default-button \fIstring"
281 Set the default (preselected) button in a widget.
282 By preselecting a button,
283 a script makes it possible for the user to simply press \fIEnter\fP
284 to proceed through a dialog with minimum interaction.
285 .IP
286 The option's value is the name of the button:
287 .IR ok ,
288 .IR yes ,
289 .IR cancel ,
290 .IR no ,
291 .IR help "\ or"
292 .IR extra .
293 .IP
294 Normally the first button in each widget is the default.
295 The first button shown is determined by the widget
296 together with the "\fB--nook\fP" and "\fB--nocancel\fP options.
297 If this option is not given, there is no default button assigned.
298 .
299 .IP "\fB--default-item \fIstring"
300 Set the default item in a checklist, form or menu box.
301 Normally the first item in the box is the default.
302 .
303 .IP "\fB--exit-label \fIstring"
304 Override the label used for "EXIT" buttons.
305 .
306 .IP "\fB--extra-button"
307 Show an extra button, between "OK" and "Cancel" buttons.
308 .
309 .IP "\fB--extra-label \fIstring"
310 Override the label used for "Extra" buttons.
311 Note: for inputmenu widgets, this defaults to "Rename".
312 .
313 .IP "\fB--help"
314 Prints the help message to the standard output and exits.
315 The help message is also printed if no options are given,
316 or if an unrecognized option is given.
317 .
318 .IP "\fB--help-button"
319 Show a help-button after "OK" and "Cancel" buttons,
320 i.e., in checklist, radiolist and menu boxes.
321 If "\fB--item-help\fR" is also given, on exit
322 the return status will be the same as for the "OK" button,
323 and the item-help text will be written to \fB\*p\fP's output after the token "HELP".
324 Otherwise, the return status will indicate that the Help button was pressed,
325 and no message printed.
326 .
327 .IP "\fB--help-label \fIstring"
328 Override the label used for "Help" buttons.
329 .
330 .IP "\fB--help-status"
331 If the help-button is selected,
332 writes the checklist, radiolist or form information
333 after the item-help "HELP" information.
334 This can be used to reconstruct the state of a checklist after processing
335 the help request.
336 .
337 .IP "\fB--hfile \fIfilename"
338 Display the given file using a textbox when the user presses F1.
339 .
340 .IP "\fB--hline \fIstring"
341 Display the given string centered at the bottom of the widget.
342 .
343 .IP "\fB--ignore"
344 Ignore options that \fB\*p\fP does not recognize.
345 Some well-known ones such as "\fB--icon\fP" are ignored anyway,
346 but this is a better choice for compatibility with other implementations.
347 .
348 .IP "\fB--input-fd \fIfd"
349 Read keyboard input from the given file descriptor.
350 Most \fB\*p\fR scripts read from the standard input,
351 but the gauge widget reads a pipe (which is always standard input).
352 Some configurations do not work properly when
353 \fB\*p\fP tries to reopen the terminal.
354 Use this option (with appropriate juggling of file-descriptors)
355 if your script must work in that type of environment.
356 .
357 .IP "\fB--insecure"
358 Makes the password widget friendlier but less secure,
359 by echoing asterisks for each character.
360 .
361 .IP "\fB--item-help"
362 Interpret the tags data for checklist, radiolist and menu boxes
363 adding a column which is displayed in the bottom line of the
364 screen, for the currently selected item.
365 .
366 .IP "\fB--keep-tite"
367 When built with \fBncurses\fP,
368 \fB\*p\fP normally checks to see if it is running in an \fBxterm\fP,
369 and in that case tries to suppress the initialization strings that
370 would make it switch to the alternate screen.
371 Switching between the normal and alternate screens
372 is visually distracting in a script which runs \fB\*p\fP
373 several times.
374 Use this option to allow \fB\*p\fP to use those initialization strings.
375 .
376 .IP "\fB--keep-window"
377 Normally when \fB\*p\fR performs several \fBtailboxbg\fR widgets
378 connected by "\fB--and-widget\fR",
379 it clears the old widget from the screen by painting over it.
380 Use this option to suppress that repainting.
381 .IP
382 At exit, \fB\*p\fR repaints all of the widgets which have been
383 marked with "\fB--keep-window\fR", even if they are not \fBtailboxbg\fR widgets.
384 That causes them to be repainted in reverse order.
385 See the discussion of the "\fB--clear\fR" option for examples.
386 .
387 .IP "\fB--last-key"
388 At exit, report the last key which the user entered.
389 This is the curses key code rather than a symbol or literal character.
390 It can be used by scripts to distinguish between two keys which are
391 bound to the same action.
392 .
393 .IP "\fB--max-input \fIsize"
394 Limit input strings to the given size.
395 If not specified, the limit is 2048.
396 .
397 .IP "\fB--no-cancel"
398 .IP "\fB--nocancel"
399 Suppress the "Cancel" button in checklist, inputbox and menu box modes.
400 A script can still test if the user pressed the ESC key to cancel to quit.
401 .
402 .IP "\fB--no-collapse"
403 Normally \fB\*p\fR converts tabs to spaces and reduces multiple
404 spaces to a single space for text which is displayed in a message boxes, etc.
405 Use this option to disable that feature.
406 Note that \fB\*p\fR will still wrap text,
407 subject to the "\fB--cr-wrap\fR" and "\fB--trim\fR" options.
408 .
409 .IP "\fB--no-items"
410 Some widgets (checklist, inputmenu, radiolist, menu) display a list
411 with two columns (a "tag" and "item", i.e., "description").
412 This option tells \fB\*p\fP to read shorter rows,
413 omitting the "item" part of the list.
414 This is occasionally useful, e.g., if the tags provide enough information.
415 .IP
416 See also \fB--no-tags\fP.
417 If both options are given, this one is ignored.
418 .
419 .IP "\fB--no-kill"
420 Tells
421 \fB\*p\fP
422 to put the
423 \fBtailboxbg\fP
424 box in the background,
425 printing its process id to \fB\*p\fP's output.
426 SIGHUP is disabled for the background process.
427 .
428 .IP "\fB--no-label \fIstring"
429 Override the label used for "No" buttons.
430 .
431 .IP "\fB--no-lines
432 Rather than draw lines around boxes, draw spaces in the same place.
433 See also "\fB--ascii-lines\fR".
434 .
435 .IP "\fB--no-mouse
436 Do not enable the mouse.
437 .
438 .IP "\fB--no-nl-expand
439 Do not convert "\\n" substrings of the message/prompt text into
440 literal newlines.
441 .
442 .IP "\fB--no-ok"
443 .IP "\fB--nook"
444 Suppress the "OK" button in checklist, inputbox and menu box modes.
445 A script can still test if the user pressed the "Enter" key to accept the data.
446 .
447 .IP "\fB--no-shadow"
448 Suppress shadows that would be drawn to the right and bottom of each dialog box.
449 .
450 .IP "\fB--no-tags"
451 Some widgets (checklist, inputmenu, radiolist, menu) display a list
452 with two columns (a "tag" and "description").
453 The tag is useful for scripting, but may not help the user.
454 The \fB--no-tags\fP option (from Xdialog) may be used to suppress the
455 column of tags from the display.
456 Unlike the \fB--no-items\fP option,
457 this does not affect the data which is read from the script.
458 .IP
459 Xdialog does not display the tag column for the analogous buildlist
460 and treeview widgets; \fB\*p\fP does the same.
461 .IP
462 Normally \fB\*p\fP allows you to quickly move to entries on the displayed list,
463 by matching a single character to the first character of the tag.
464 When the \fB--no-tags\fP option is given, \fB\*p\fP matches against
465 the first character of the description.
466 In either case, the matchable character is highlighted.
467 .
468 .IP "\fB--ok-label \fIstring"
469 Override the label used for "OK" buttons.
470 .
471 .IP "\fB--output-fd \fIfd"
472 Direct output to the given file descriptor.
473 Most \fB\*p\fR scripts write to the standard error,
474 but error messages may also be written there, depending on your script.
475 .
476 .IP "\fB--separator \fIstring"
477 .IP "\fB--output-separator\fIstring"
478 Specify a string that will separate the output on \fB\*p\fP's output from
479 checklists, rather than a newline (for --separate-output) or a space.
480 This applies to other widgets such as forms and editboxes which normally
481 use a newline.
482 .
483 .IP "\fB--print-maxsize"
484 Print the maximum size of dialog boxes, i.e., the screen size,
485 to \fB\*p\fP's output.
486 This may be used alone, without other options.
487 .
488 .IP "\fB--print-size"
489 Prints the size of each dialog box to \fB\*p\fP's output.
490 .
491 .IP "\fB--print-version"
492 Prints \fB\*p\fR's version to \fB\*p\fP's output.
493 This may be used alone, without other options.
494 It does not cause \fBdialog\fP to exit by itself.
495 .
496 .IP "\fB--quoted"
497 Normally \fB\*p\fP quotes the strings returned by checklist's
498 as well as the item-help text.
499 Use this option to quote all string results.
500 .
501 .IP "\fB--scrollbar"
502 For widgets holding a scrollable set of data,
503 draw a scrollbar on its right-margin.
504 This does not respond to the mouse.
505 .
506 .IP "\fB--separate-output"
507 For checklist widgets, output result one line at a time, with no quoting.
508 This facilitates parsing by another program.
509 .
510 .IP "\fB--separate-widget \fIstring"
511 Specify a string that will separate the output on \fB\*p\fP's output from
512 each widget.
513 This is used to simplify parsing the result of a dialog with several widgets.
514 If this option is not given,
515 the default separator string is a tab character.
516 .
517 .IP "\fB--shadow"
518 Draw a shadow to the right and bottom of each dialog box.
519 .
520 .IP "\fB--single-quoted"
521 Use single-quoting as needed (and no quotes if unneeded) for the
522 output of checklist's as well as the item-help text.
523 If this option is not set, \fB\*p\fP uses double quotes around each item.
524 In either case,
525 \fB\*p\fP adds backslashes to make the output useful in shell scripts.
526 .
527 .IP "\fB--size-err"
528 Check the resulting size of a dialog box before trying to use it,
529 printing the resulting size if it is larger than the screen.
530 (This option is obsolete, since all new-window calls are checked).
531 .
532 .IP "\fB--sleep \fIsecs"
533 Sleep (delay) for the given number of seconds after processing a dialog box.
534 .
535 .IP "\fB--stderr"
536 Direct output to the standard error.
537 This is the default, since curses normally writes screen updates to
538 the standard output.
539 .
540 .IP "\fB--stdout"
541 Direct output to the standard output.
542 This option is provided for compatibility with Xdialog,
543 however using it in portable scripts is not recommended,
544 since curses normally writes its screen updates to the standard output.
545 If you use this option, \fB\*p\fR attempts to reopen the terminal
546 so it can write to the display.
547 Depending on the platform and your environment, that may fail.
548 .
549 .IP "\fB--tab-correct"
550 Convert each tab character to one or more spaces
551 (for the \fBtextbox\fP widget; otherwise to a single space).
552 Otherwise, tabs are rendered according to the curses library's interpretation.
553 .
554 .IP "\fB--tab-len \fIn"
555 Specify the number of spaces that a tab character occupies if the
556 "\fB--tab-correct\fP" option is given.
557 The default is 8.
558 This option is only effective for the \fBtextbox\fP widget.
559 .
560 .IP "\fB--time-format \fIformat"
561 If the host provides \fBstrftime\fP,
562 this option allows you to specify the format of the time printed for
563 the \fB--timebox\fP widget.
564 The day, month, year values in this case are for the current local time.
565 .
566 .IP "\fB--timeout \fIsecs"
567 Timeout (exit with error code)
568 if no user response within the given number of seconds.
569 A timeout of zero seconds is ignored.
570 .IP
571 This option is ignored by the "\fB--pause\fP" widget.
572 It is also overridden if the background "\fB--tailboxbg\fP" option is used
573 to setup multiple concurrent widgets.
574 .
575 .IP "\fB--title \fItitle"
576 Specifies a
577 \fItitle\fP
578 string to be displayed at the top of the dialog box.
579 .
580 .IP "\fB--trace \fIfilename"
581 logs the command-line parameters,
582 keystrokes and other information to the given file.
583 If \fBdialog\fP reads a configure file, it is logged as well.
584 Piped input to the \fIgauge\fP widget is logged.
585 Use control/T to log a picture of the current dialog window.
586 .PP
587 The \fB\*p\fR program handles some command-line parameters specially,
588 and removes them from the parameter list as they are processed.
589 For example, if the first option is \fB--trace\fP,
590 then that is processed (and removed) before \fB\*p\fR initializes the display.
591 .
592 .IP "\fB--trim"
593 eliminate leading blanks,
594 trim literal newlines and repeated blanks from message text.
595 .
596 .IP
597 See also the "\fB--cr-wrap\fR" and "\fB--no-collapse\fR" options.
598 .
599 .IP "\fB--version"
600 Prints \fB\*p\fR's version to the standard output, and exits.
601 See also "\fB--print-version\fP".
602 .
603 .IP "\fB--visit-items"
604 Modify the tab-traversal of checklist, radiolist, menubox and inputmenu
605 to include the list of items as one of the states.
606 This is useful as a visual aid,
607 i.e., the cursor position helps some users.
608 .IP
609 When this option is given, the cursor is initially placed on the list.
610 Abbreviations (the first letter of the tag) apply to the list items.
611 If you tab to the button row, abbreviations apply to the buttons.
612 .
613 .IP "\fB--yes-label \fIstring"
614 Override the label used for "Yes" buttons.
615 .
616 .\" ************************************************************************
617 .SS Box Options
618 All dialog boxes have at least three parameters:
619 .TP 5
620 \fItext\fP
621 the caption or contents of the box.
622 .TP 5
623 \fIheight\fP
624 the height of the dialog box.
625 .TP 5
626 \fIwidth\fP
627 the width of the dialog box.
628 .PP
629 Other parameters depend on the box type.
630 .
631 .
632 .IP "\fB--buildlist \fItext height width \fR[ \fItag item status \fR] \fI..."
633 A \fBbuildlist\fP dialog displays two lists, side-by-side.
634 The list on the left shows unselected items.
635 The list on the right shows selected items.
636 As items are selected or unselected, they move between the lists.
637 .IP
638 Use a carriage return or the "OK" button to accept the current value
639 in the selected-window and exit.
640 The results are written using the order displayed in the selected-window.
641 .IP
642 The initial on/off state of each entry is specified by
643 .IR status "."
644 .IP
645 The dialog behaves like a \fBmenu\fP, using the \fB--visit-items\fP
646 to control whether the cursor is allowed to visit the lists directly.
647 .RS
648 .bP
649 If \fB--visit-items\fP is not given,
650 tab-traversal uses two states (OK/Cancel).
651 .bP
652 If \fB--visit-items\fP is given,
653 tab-traversal uses four states (Left/Right/OK/Cancel).
654 .RE
655 .IP
656 Whether or not \fB--visit--items\fP is given,
657 it is possible to move the highlight between the two lists using
658 the default "^" (left-column) and "$" (right-column) keys.
659 .IP
660 On exit, a list of the \fItag\fP
661 strings of those entries that are turned on
662 will be printed on \fB\*p\fP's output.
663 .IP
664 If the "\fB--separate-output\fP" option is not given,
665 the strings will be quoted as needed to make it simple for scripts to separate them.
666 By default, this uses double-quotes.
667 See the "\fB--single-quoted\fP" option, which modifies the quoting behavior.
668 .
669 .
670 .IP "\fB--calendar \fItext height width day month year"
671 A \fBcalendar\fP box displays
672 month, day and year in separately adjustable windows.
673 If the values for day, month or year are missing or negative,
674 the current date's corresponding values are used.
675 You can increment or decrement any of those using the
676 left-, up-, right- and down-arrows.
677 Use vi-style h, j, k and l for moving around the array of days in a month.
678 Use tab or backtab to move between windows.
679 If the year is given as zero, the current date is used as an initial value.
680 .IP
681 On exit, the date is printed in the form day/month/year.
682 The format can be overridden using the \fB--date-format\fP option.
683 .
684 .
685 .IP "\fB--checklist \fItext height width list-height \fR[ \fItag item status \fR] \fI..."
686 A
687 \fBchecklist\fP
688 box is similar to a
689 \fBmenu\fP
690 box; there are
691 multiple entries presented in the form of a menu.
692 Another difference is
693 that you can indicate which entry is currently selected, by setting its
694 .IR status " to " on "."
695 Instead of choosing
696 one entry among the entries, each entry can be turned on or off by the user.
697 The initial on/off state of each entry is specified by
698 .IR status "."
699 .IP
700 On exit, a list of the \fItag\fP
701 strings of those entries that are turned on
702 will be printed on \fB\*p\fP's output.
703 .IP
704 If the "\fB--separate-output\fP" option is not given,
705 the strings will be quoted as needed to make it simple for scripts to separate them.
706 By default, this uses double-quotes.
707 See the "\fB--single-quoted\fP" option, which modifies the quoting behavior.
708 .
709 .
710 .IP "\fB--dselect \fIfilepath height width\fR"
711 The directory-selection dialog displays a text-entry window in which you can type
712 a directory, and above that a windows with directory names.
713 .IP
714 Here
715 \fBfilepath\fP
716 can be a filepath in which case the directory window
717 will display the contents of the path and the text-entry window will contain
718 the preselected directory.
719 .IP
720 Use tab or arrow keys to move between the windows.
721 Within the directory window, use the up/down arrow keys
722 to scroll the current selection.
723 Use the space-bar to copy the current selection into the text-entry
724 window.
725 .IP
726 Typing any printable characters switches focus to the text-entry window,
727 entering that character as well as scrolling the directory
728 window to the closest match.
729 .IP
730 Use a carriage return or the "OK" button to accept the current value
731 in the text-entry window and exit.
732 .IP
733 On exit, the contents of the text-entry window are written to \fB\*p\fP's output.
734 .
735 .IP "\fB--editbox \fIfilepath height width\fR"
736 The edit-box dialog displays a copy of the file.
737 You may edit it using
738 the \fIbackspace\fP, \fIdelete\fP and cursor keys
739 to correct typing errors.
740 It also recognizes pageup/pagedown.
741 Unlike the \fB--inputbox\fP,
742 you must tab to the "OK" or "Cancel" buttons to close the dialog.
743 Pressing the "Enter" key within the box will split the corresponding line.
744 .IP
745 On exit, the contents of the edit window are written to \fB\*p\fP's output.
746 .
747 .nf
748 .IP "\fB--form \fItext height width formheight \fR[ \fIlabel y x item y x flen ilen \fR] \fI..."
749 .fi
750 The \fBform\fP dialog displays a form consisting of labels and fields,
751 which are positioned on a scrollable window by coordinates given in the script.
752 The field length \fIflen\fR and input-length \fIilen\fR tell how long
753 the field can be.
754 The former defines the length shown for a selected field,
755 while the latter defines the permissible length of the data entered in the
756 field.
757 .RS
758 .bP
759 If \fIflen\fR is zero, the corresponding field cannot be altered.
760 and the contents of the field determine the displayed-length.
761 .bP
762 If \fIflen\fR is negative, the corresponding field cannot be altered,
763 and the negated value of \fIflen\fR is used as the displayed-length.
764 .bP
765 If \fIilen\fR is zero, it is set to \fIflen\fR.
766 .RE
767 .IP
768 Use up/down arrows (or control/N, control/P) to move between fields.
769 Use tab to move between windows.
770 .IP
771 On exit, the contents of the form-fields are written to \fB\*p\fP's output,
772 each field separated by a newline.
773 The text used to fill non-editable fields
774 (\fIflen\fR is zero or negative)
775 is not written out.
776 .
777 .
778 .IP "\fB--fselect \fIfilepath height width\fR"
779 The \fBfselect\fP (file-selection) dialog displays a text-entry window in which you can type
780 a filename (or directory), and above that two windows with directory
781 names and filenames.
782 .IP
783 Here
784 \fBfilepath\fP
785 can be a filepath in which case the file and directory windows
786 will display the contents of the path and the text-entry window will contain
787 the preselected filename.
788 .IP
789 Use tab or arrow keys to move between the windows.
790 Within the directory or filename windows, use the up/down arrow keys
791 to scroll the current selection.
792 Use the space-bar to copy the current selection into the text-entry
793 window.
794 .IP
795 Typing any printable characters switches focus to the text-entry window,
796 entering that character as well as scrolling the directory and filename
797 windows to the closest match.
798 .IP
799 Typing the space character forces \fB\*p\fP to complete the current
800 name (up to the point where there may be a match against more than one
801 entry).
802 .IP
803 Use a carriage return or the "OK" button to accept the current value
804 in the text-entry window and exit.
805 .IP
806 On exit, the contents of the text-entry window are written to \fB\*p\fP's output.
807 .
808 .
809 .IP "\fB--gauge \fItext height width [percent]\fR"
810 A
811 \fBgauge\fP
812 box displays a meter along the bottom of the box.
813 The meter indicates the percentage.
814 New percentages are read from
815 standard input, one integer per line.
816 The meter is updated
817 to reflect each new percentage.
818 If the standard input reads the string "XXX",
819 then the first line following is taken as an integer percentage,
820 then subsequent lines up to another "XXX" are used for a new prompt.
821 The gauge exits when EOF is reached on the standard input.
822 .IP
823 The \fIpercent\fR value denotes the initial percentage shown in the meter.
824 If not specified, it is zero.
825 .IP
826 On exit, no text is written to \fB\*p\fP's output.
827 The widget accepts no input, so the exit status is always OK.
828 .
829 .
830 .IP "\fB--infobox \fItext height width"
831 An \fBinfo\fP box is basically a \fBmessage\fP box.
832 However, in this case, \fB\*p\fP
833 will exit immediately after displaying the message to the user.
834 The screen is not cleared when \fB\*p\fP
835 exits, so that the message will remain on the screen until the calling
836 shell script clears it later.
837 This is useful when you want to inform
838 the user that some operations are carrying on that may require some
839 time to finish.
840 .IP
841 On exit, no text is written to \fB\*p\fP's output.
842 Only an "OK" button is provided for input,
843 but an ESC exit status may be returned.
844 .
845 .
846 .IP "\fB--inputbox \fItext height width [init]"
847 An
848 \fBinput\fP
849 box is useful when you want to ask questions that
850 require the user to input a string as the answer.
851 If init is supplied
852 it is used to initialize the input string.
853 When entering the string,
854 the \fIbackspace\fP, \fIdelete\fP and cursor keys
855 can be used to correct typing errors.
856 If the input string is longer than
857 can fit in the dialog box, the input field will be scrolled.
858 .IP
859 On exit, the input string will be printed on \fB\*p\fP's output.
860 .
861 .
862 .IP "\fB--inputmenu \fItext height width menu-height \fR[ \fItag item \fR] \fI..."
863 An \fBinputmenu\fP box is very similar to an ordinary \fBmenu\fP box.
864 There are only a few differences between them:
865 .RS
866 .TP 4
867 1.
868 The entries are not automatically centered but left adjusted.
869 .TP
870 2.
871 An extra button (called \fIRename\fP) is implied to rename
872 the current item when it is pressed.
873 .TP
874 3.
875 It is possible to rename the current entry by pressing the
876 \fIRename\fP
877 button.
878 Then \fB\*p\fP will write the following on \fB\*p\fP's output.
879 .IP
880 RENAMED <tag> <item>
881 .RE
882 .
883 .
884 .IP "\fB--menu \fItext height width menu-height \fR[ \fItag item \fR] \fI..."
885 As its name suggests, a
886 \fBmenu\fP
887 box is a dialog box that can be used to present a list of choices in
888 the form of a menu for the user to choose.
889 Choices are displayed in the order given.
890 Each menu entry consists of a \fItag\fP string and an \fIitem\fP string.
891 The \fItag\fP
892 gives the entry a name to distinguish it from the other entries in the
893 menu.
894 The \fIitem\fP is a short description of the option that the entry represents.
895 The user can move between the menu entries by pressing the
896 cursor keys, the first letter of the \fItag\fP
897 as a hot-key, or the number keys
898 .IR 1-9 ". There are"
899 \fImenu-height\fP
900 entries displayed in the menu at one time, but the menu will be
901 scrolled if there are more entries than that.
902 .IP
903 On exit the \fItag\fP
904 of the chosen menu entry will be printed on \fB\*p\fP's output.
905 If the "\fB--help-button\fR" option is given, the corresponding help
906 text will be printed if the user selects the help button.
907 .
908 .nf
909 .IP "\fB--mixedform \fItext height width formheight \fR[ \fIlabel y x item y x flen ilen itype \fR] \fI..."
910 .fi
911 The \fBmixedform\fP dialog displays a form consisting of labels and fields,
912 much like the \fB--form\fP dialog.
913 It differs by adding a field-type parameter to each field's description.
914 Each bit in the type denotes an attribute of the field:
915 .RS
916 .TP 5
917 1
918 hidden, e.g., a password field.
919 .TP 5
920 2
921 readonly, e.g., a label.
922 .RE
923 .
924 .IP "\fB--mixedgauge \fItext height width percent \fR[ \fItag1 item1 \fR] \fI..."
925 A
926 \fBmixedgauge\fP
927 box displays a meter along the bottom of the box.
928 The meter indicates the percentage.
929 .IP
930 It also displays a list of the \fItag\fP- and \fIitem\fP-values at the
931 top of the box.
932 See \*l(3) for the tag values.
933 .IP
934 The \fItext\fP is shown as a caption between the list and meter.
935 The \fIpercent\fR value denotes the initial percentage shown in the meter.
936 .IP
937 No provision is made for reading data from the standard input as \fB--gauge\fP
938 does.
939 .IP
940 On exit, no text is written to \fB\*p\fP's output.
941 The widget accepts no input, so the exit status is always OK.
942 .
943 .IP "\fB--msgbox \fItext height width"
944 A \fBmessage\fP box is very similar to a \fByes/no\fP box.
945 The only difference between a \fBmessage\fP box and a \fByes/no\fP
946 box is that a \fBmessage\fP box has only a single \fBOK\fP button.
947 You can use this dialog box to display any message you like.
948 After reading the message, the user can press the \fIENTER\fP key so that
949 \fB\*p\fP will exit and the calling shell script can continue its operation.
950 .IP
951 If the message is too large for the space,
952 \fB\*p\fP may allow you to scroll it,
953 provided that the underlying curses implementation is capable enough.
954 In this case, a percentage is shown in the base of the widget.
955 .IP
956 On exit, no text is written to \fB\*p\fP's output.
957 Only an "OK" button is provided for input,
958 but an ESC exit status may be returned.
959 .
960 .IP "\fB--pause \fItext height width seconds\fR"
961 A
962 \fBpause\fP
963 box displays a meter along the bottom of the box.
964 The meter indicates how many seconds remain until the end of the pause.
965 The pause exits when timeout is reached
966 or the user presses the OK button
967 (status OK)
968 or the user presses the CANCEL button
969 or Esc key.
970 .IP "\fB--passwordbox \fItext height width [init]"
971 A \fBpassword\fP box is similar to an input box,
972 except that the text the user enters is not displayed.
973 This is useful when prompting for passwords or other
974 sensitive information.
975 Be aware that if anything is passed in "init", it
976 will be visible in the system's process table to casual snoopers.
977 Also, it
978 is very confusing to the user to provide them with a default password they
979 cannot see.
980 For these reasons, using "init" is highly discouraged.
981 See "\fB--insecure\fP" if you do not care about your password.
982 .IP
983 On exit, the input string will be printed on \fB\*p\fP's output.
984 .
985 .
986 .nf
987 .IP "\fB--passwordform \fItext height width formheight \fR[ \fIlabel y x item y x flen ilen \fR] \fI..."
988 .fi
989 This is identical to \fB--form\fP except that all text fields are
990 treated as \fBpassword\fP widgets rather than \fBinputbox\fP widgets.
991 .
992 .
993 .IP "\fB--prgbox \fItext command height width"
994 .IP "\fB--prgbox \fIcommand height width"
995 A \fBprgbox\fP is very similar to a \fBprogrambox\fP.
996 .IP
997 This dialog box is used to display the output of a command that is
998 specified as an argument to \fBprgbox\fP.
999 .IP
1000 After the command completes, the user can press the \fIENTER\fP key so that
1001 \fBdialog\fP will exit and the calling shell script can continue its operation.
1002 .IP
1003 If three parameters are given, it displays the text under the title,
1004 delineated from the scrolling file's contents.
1005 If only two parameters are given, this text is omitted.
1006 .
1007 .
1008 .IP "\fB--programbox \fItext height width"
1009 .IP "\fB--programbox \fIheight width"
1010 A \fBprogrambox\fP is very similar to a \fBprogressbox\fP.
1011 The only difference between a \fBprogram\fP box and a \fBprogress\fP
1012 box is that a \fBprogram\fP box displays an \fBOK\fP button
1013 (but only after the command completes).
1014 .IP
1015 This dialog box is used to display the piped output of a command.
1016 After the command completes, the user can press the \fIENTER\fP key so that
1017 \fBdialog\fP will exit and the calling shell script can continue its operation.
1018 .IP
1019 If three parameters are given, it displays the text under the title,
1020 delineated from the scrolling file's contents.
1021 If only two parameters are given, this text is omitted.
1022 .
1023 .
1024 .IP "\fB--progressbox \fItext height width"
1025 .IP "\fB--progressbox \fIheight width"
1026 A \fBprogressbox\fP is similar to an \fBtailbox\fP,
1027 except that
1028 .RS
1029 .TP 3
1030 a) rather than displaying the contents of a file,
1031 it displays the piped output of a command and
1032 .TP 3
1033 b) it will exit when it reaches the end of the file
1034 (there is no "OK" button).
1035 .RE
1036 .IP
1037 If three parameters are given, it displays the text under the title,
1038 delineated from the scrolling file's contents.
1039 If only two parameters are given, this text is omitted.
1040 .
1041 .
1042 .IP "\fB--radiolist \fItext height width list-height \fR [ \fItag item status \fR] \fI..."
1043 A
1044 \fBradiolist\fP
1045 box is similar to a
1046 \fBmenu\fP
1047 box.
1048 The only difference is
1049 that you can indicate which entry is currently selected, by setting its
1050 .IR status " to " on "."
1051 .IP
1052 On exit, the tag of the selected item is written to \fB\*p\fP's output.
1053 .
1054 .
1055 .IP "\fB--tailbox \fIfile height width"
1056 Display text from a file in a dialog box, as in a "tail -f" command.
1057 Scroll left/right using vi-style 'h' and 'l', or arrow-keys.
1058 A '0' resets the scrolling.
1059 .IP
1060 On exit, no text is written to \fB\*p\fP's output.
1061 Only an "OK" button is provided for input,
1062 but an ESC exit status may be returned.
1063 .
1064 .
1065 .nf
1066 .IP "\fB--rangebox \fItext height width list-height min-value max-value default-value"
1067 .fi
1068 Allow the user to select from a range of values, e.g., using a slider.
1069 The dialog shows the current value as a bar (like the gauge dialog).
1070 Tabs or arrow keys move the cursor between the buttons and the value.
1071 When the cursor is on the value,
1072 you can edit it by:
1073 .RS
1074 .TP 5
1075 left/right cursor movement to select a digit to modify
1076 .TP 5
1077 +/-
1078 characters to increment/decrement the digit by one
1079 .TP 5
1080 0 through 9
1081 to set the digit to the given value
1082 .RE
1083 .IP
1084 Some keys are also recognized in all cursor positions:
1085 .RS
1086 .TP 5
1087 home/end
1088 set the value to its maximum or minimum
1089 .TP 5
1090 pageup/pagedown
1091 increment the value so that the slider moves by one column
1092 .RE
1093 .
1094 .
1095 .IP "\fB--tailboxbg \fIfile height width"
1096 Display text from a file in a dialog box as a background task,
1097 as in a "tail -f &" command.
1098 Scroll left/right using vi-style 'h' and 'l', or arrow-keys.
1099 A '0' resets the scrolling.
1100 .IP
1101 \*L treats the background task specially if there are other
1102 widgets (\fB--and-widget\fP) on the screen concurrently.
1103 Until those widgets are closed (e.g., an "OK"),
1104 \fB\*p\fP will perform all of the tailboxbg widgets in the same process,
1105 polling for updates.
1106 You may use a tab to traverse between the widgets on the screen,
1107 and close them individually, e.g., by pressing \fIENTER\fP.
1108 Once the non-tailboxbg widgets are closed, \fB\*p\fP forks a copy of itself
1109 into the background, and prints its process id if the "\fB--no-kill\fP" option
1110 is given.
1111 .IP
1112 On exit, no text is written to \fB\*p\fP's output.
1113 Only an "EXIT" button is provided for input,
1114 but an ESC exit status may be returned.
1115 .IP
1116 NOTE:
1117 Older versions of \fB\*p\fP forked immediately and attempted to
1118 update the screen individually.
1119 Besides being bad for performance,
1120 it was unworkable.
1121 Some older scripts may not work properly with the polled scheme.
1122 .
1123 .
1124 .IP "\fB--textbox \fIfile height width"
1125 A
1126 \fBtext\fP
1127 box lets you display the contents of a text file in a dialog box.
1128 It is like a simple text file viewer.
1129 The user can move through the file by using the
1130 cursor, page-up, page-down
1131 and \fIHOME/END\fR keys available on most keyboards.
1132 If the lines are too long to be displayed in the box,
1133 the \fILEFT/RIGHT\fP
1134 keys can be used to scroll the text region horizontally.
1135 You may also use vi-style keys h, j, k, l in place of the cursor keys,
1136 and B or N in place of the page-up and page-down keys.
1137 Scroll up/down using vi-style 'k' and 'j', or arrow-keys.
1138 Scroll left/right using vi-style 'h' and 'l', or arrow-keys.
1139 A '0' resets the left/right scrolling.
1140 For more convenience,
1141 vi-style forward and backward searching functions are also provided.
1142 .IP
1143 On exit, no text is written to \fB\*p\fP's output.
1144 Only an "EXIT" button is provided for input,
1145 but an ESC exit status may be returned.
1146 .
1147 .
1148 .IP "\fB--timebox \fItext height [width hour minute second]"
1149 A dialog is displayed which allows you to select hour, minute and second.
1150 If the values for hour, minute or second are missing or negative,
1151 the current date's corresponding values are used.
1152 You can increment or decrement any of those using the
1153 left-, up-, right- and down-arrows.
1154 Use tab or backtab to move between windows.
1155 .IP
1156 On exit, the result is printed in the form hour:minute:second.
1157 The format can be overridden using the \fB--time-format\fP option.
1158 .
1159 .
1160 .IP "\fB--treeview \fItext height width list-height \fR[ \fItag item status depth \fR] \fI..."
1161 Display data organized as a tree.
1162 Each group of data contains a tag,
1163 the text to display for the item,
1164 its status ("on" or "off")
1165 and the depth of the item in the tree.
1166 .IP
1167 Only one item can be selected (like the \fBradiolist\fP).
1168 The tag is not displayed.
1169 .IP
1170 On exit, the tag of the selected item is written to \fB\*p\fP's output.
1171 .
1172 .
1173 .IP "\fB--yesno \fItext height width"
1174 A \fByes/no\fP dialog box of
1175 size \fIheight\fP rows by \fIwidth\fP columns will be displayed.
1176 The string specified by
1177 \fItext\fP
1178 is displayed inside the dialog box.
1179 If this string is too long to fit
1180 in one line, it will be automatically divided into multiple lines at
1181 appropriate places.
1182 The
1183 \fItext\fP
1184 string can also contain the sub-string
1185 .I
1186 "\en"
1187 or newline characters
1188 \fI`\en'\fP
1189 to control line breaking explicitly.
1190 This dialog box is useful for
1191 asking questions that require the user to answer either yes or no.
1192 The dialog box has a
1193 \fBYes\fP
1194 button and a
1195 \fBNo\fP
1196 button, in which the user can switch between by pressing the
1197 .IR TAB " key."
1198 .IP
1199 On exit, no text is written to \fB\*p\fP's output.
1200 In addition to the "Yes" and "No" exit codes (see DIAGNOSTICS)
1201 an ESC exit status may be returned.
1202 .IP
1203 The codes used for "Yes" and "No" match those used for "OK" and "Cancel",
1204 internally no distinction is made.
1205 .
1206 .\" ************************************************************************
1207 .SS "Obsolete Options"
1208 .\" from cdialog 0.9a (Pako)
1209 .IP "\fB--beep"
1210 This was used to tell the original cdialog that it should make a beep
1211 when the separate processes of the tailboxbg widget would repaint the screen.
1212 .
1213 .\" from cdialog 0.9a (Pako)
1214 .IP "\fB--beep-after"
1215 Beep after a user has completed a widget by pressing one of the buttons.
1216 .
1217 .\" ************************************************************************
1218 .SH "RUN-TIME CONFIGURATION"
1219 .TP 4
1220 1.
1221 Create a sample configuration file by typing:
1222 .LP
1223 .in +1i
1224 "\*p --create-rc <file>"
1225 .TP 4
1226 2.
1227 At start,
1228 \fB\*p\fP
1229 determines the settings to use as follows:
1230 .RS
1231 .TP 4
1232 a)
1233 if environment variable
1234 \fBDIALOGRC\fP
1235 is set, its value determines the name of the configuration file.
1236 .TP 4
1237 b)
1238 if the file in (a) is not found, use the file
1239 \fI$HOME/.dialogrc\fP
1240 as the configuration file.
1241 .TP 4
1242 c)
1243 if the file in (b) is not found, try using the GLOBALRC file determined at
1244 compile-time, i.e., \fI/etc/dialogrc\fP.
1245 .TP 4
1246 d)
1247 if the file in (c) is not found, use compiled in defaults.
1248 .RE
1249 .TP 4
1250 3.
1251 Edit the sample configuration file and copy it to some place that
1252 \fB\*p\fP
1253 can find, as stated in step 2 above.
1254 .
1255 .\" ************************************************************************
1256 .SH "KEY BINDINGS"
1257 You can override or add to key bindings in \fB\*p\fP
1258 by adding to the configuration file.
1259 \fB\*L\fP's \fBbindkey\fP command maps single keys to its internal coding.
1260 .Ex
1261 bindkey \fIwidget\fP \fIcurses_key\fP \fIdialog_key\fP
1262 .Ee
1263 .PP
1264 The \fIwidget\fP name can be "*" (all widgets), or
1265 specific widgets such as \fBtextbox\fP.
1266 Specific widget bindings override the "*" bindings.
1267 User-defined bindings override the built-in bindings.
1268 .PP
1269 The \fIcurses_key\fP can be any of the names derived from
1270 \fBcurses.h\fP, e.g., "HELP" from "KEY_HELP".
1271 \fB\*L\fP also recognizes ANSI control characters such as "^A", "^?",
1272 as well as C1-controls such as "~A" and "~?".
1273 Finally, it allows any single character to be escaped with a backslash.
1274 .PP
1275 \fB\*L\fP's internal keycode names correspond to the
1276 \fBDLG_KEYS_ENUM\fP type in
1277 \fBdlg_keys.h\fP, e.g., "HELP" from "DLGK_HELP".
1278 .SS Widget Names
1279 .PP
1280 Some widgets (such as the formbox) have an area where fields can be edited.
1281 Those are managed in a subwindow of the widget, and
1282 may have separate keybindings from the main widget
1283 because the subwindows are registered using a different name.
1284 .TS
1285 center tab(/) ;
1286 l l l
1287 l l l .
1288 \fIWidget\fR/\fIWindow name\fR/\fISubwindow Name\fR
1289 calendar/calendar
1290 checklist/checklist
1291 editbox/editbox/editbox2
1292 form/formbox/formfield
1293 fselect/fselect/fselect2
1294 inputbox/inputbox/inputbox2
1295 menu/menubox/menu
1296 msgbox/msgbox
1297 pause/pause
1298 progressbox/progressbox
1299 radiolist/radiolist
1300 tailbox/tailbox
1301 textbox/textbox/searchbox
1302 timebox/timebox
1303 yesno/yesno
1304 .TE
1305 .PP
1306 Some widgets are actually other widgets,
1307 using internal settings to modify the behavior.
1308 Those use the same widget name as the actual widget:
1309 .TS
1310 center tab(/) ;
1311 l l
1312 l l .
1313 \fIWidget\fR/\fIActual Widget\fR
1314 dselect/fselect
1315 infobox/msgbox
1316 inputmenu/menu
1317 mixedform/form
1318 passwordbox/inputbox
1319 passwordform/form
1320 prgbox/progressbox
1321 programbox/progressbox
1322 tailboxbg/tailbox
1323 .TE
1324 .SS Built-in Bindings
1325 This manual page does not list the key bindings for each widget,
1326 because that detailed information can be obtained by running \fB\*p\fP.
1327 If you have set the \fB--trace\fP option,
1328 \fB\*p\fP writes the key-binding information for each widget
1329 as it is registered.
1330 .SS Example
1331 Normally \fB\*p\fP uses different keys for navigating between the buttons
1332 and editing part of a dialog versus navigating within the editing part.
1333 That is, tab (and back-tab) traverse buttons
1334 (or between buttons and the editing part),
1335 while arrow keys traverse fields within the editing part.
1336 Tabs are also recognized as a special case for traversing between
1337 widgets, e.g., when using multiple tailboxbg widgets.
1338 .PP
1339 Some users may wish to use the same key for traversing within the
1340 editing part as for traversing between buttons.
1341 The form widget is written to support this sort of redefinition of
1342 the keys, by adding a special group in <code>dlgk_keys.h</code>
1343 for "form" (left/right/next/prev).
1344 Here is an example binding demonstrating how to do this:
1345 .Ex
1346 bindkey formfield TAB  form_NEXT
1347 bindkey formbox   TAB  form_NEXT
1348 bindkey formfield BTAB form_prev
1349 bindkey formbox   BTAB form_prev
1350 .Ee
1351 .PP
1352 That type of redefinition would not be useful in other widgets,
1353 e.g., calendar, due to the potentially large number of fields to traverse.
1354 .
1355 .\" ************************************************************************
1356 .SH ENVIRONMENT
1357 .TP 15
1358 \fBDIALOGOPTS\fP
1359 Define this variable to apply any of the common options to each widget.
1360 Most of the common options are reset before processing each widget.
1361 If you set the options in this environment variable,
1362 they are applied to \fB\*p\fP's state after the reset.
1363 As in the "\fB--file\fP" option,
1364 double-quotes and backslashes are interpreted.
1365 .IP
1366 The "\fB--file\fP" option is not considered a common option
1367 (so you cannot embed it within this environment variable).
1368 .TP 15
1369 \fBDIALOGRC\fP
1370 Define this variable if you want to specify the name of the configuration file
1371 to use.
1372 .TP 15
1373 \fBDIALOG_CANCEL\fP
1374 .TP 15
1375 \fBDIALOG_ERROR\fP
1376 .TP 15
1377 \fBDIALOG_ESC\fP
1378 .TP 15
1379 \fBDIALOG_EXTRA\fP
1380 .TP 15
1381 \fBDIALOG_HELP\fP
1382 .TP 15
1383 \fBDIALOG_ITEM_HELP\fP
1384 .TP 15
1385 \fBDIALOG_OK\fP
1386 Define any of these variables to change the exit code on
1387 Cancel (1),
1388 error (-1),
1389 ESC (255),
1390 Extra (3),
1391 Help (2),
1392 Help with \fB--item-help\fP (2),
1393 or OK (0).
1394 Normally shell scripts cannot distinguish between -1 and 255.
1395 .TP 15
1396 \fBDIALOG_TTY\fP
1397 Set this variable to "1" to provide compatibility with older versions
1398 of \fB\*p\fP which assumed that if the script redirects the standard output,
1399 that the "\fB--stdout\fP" option was given.
1400 .SH FILES
1401 .TP 20
1402 \fI$HOME/.dialogrc\fP
1403 default configuration file
1404 .SH EXAMPLES
1405 The \fB\*p\fP sources contain several samples
1406 of how to use the different box options and how they look.
1407 Just take a look into the directory \fBsamples/\fP of the source.
1408 .SH DIAGNOSTICS
1409 Exit status is subject to being overridden by environment variables.
1410 The default values and corresponding environment variables
1411 that can override them are:
1412 .TP 5
1413 0
1414 if
1415 .BR \*p " is exited by pressing the " Yes " or " OK
1416 button (DIALOG_OK).
1417 .TP 5
1418 1
1419 if the
1420 .BR No " or " Cancel
1421 button is pressed (DIALOG_CANCEL).
1422 .TP 5
1423 2
1424 if the
1425 .BR Help
1426 button is pressed (DIALOG_HELP).
1427 .TP 5
1428 3
1429 if the
1430 .BR Extra
1431 button is pressed (DIALOG_EXTRA).
1432 .TP 5
1433 4
1434 if the
1435 .BR Help
1436 button is pressed (DIALOG_HELP),
1437 or the \fB--item-help\fP option is set
1438 when the \fBHelp\fP button is pressed (DIALOG_ITEM_HELP),
1439 .TP 5
1440 -1
1441 if errors occur inside \fB\*p\fP (DIALOG_ERROR)
1442 or \fB\*p\fP is exited by pressing the \fIESC\fP key (DIALOG_ESC).
1443 .
1444 .\" ************************************************************************
1445 .SH PORTABILITY
1446 \fB\*L\fP works with X/Open curses.
1447 However, some implementations have deficiencies:
1448 .RS 3
1449 .bP
1450 HPUX curses (and perhaps others) do not open the terminal properly for
1451 the \fInewterm\fP function.
1452 This interferes with \fB\*p\fP's \fB--input-fd\fP option,
1453 by preventing cursor-keys and similar escape sequences from being recognized.
1454 .bP
1455 NetBSD 5.1 curses has incomplete support for wide-characters.
1456 \fB\*p\fP will build, but not all examples display properly.
1457 .RE
1458 .\" ************************************************************************
1459 .SH COMPATIBILITY
1460 You may want to write scripts which run with other \fBdialog\fP "clones".
1461 .SS ORIGINAL DIALOG
1462 First, there is the "original" \fBdialog\fP program to consider (versions
1463 0.3 to 0.9).
1464 It had some misspelled (or inconsistent) options.
1465 The \fB\*p\fP program maps those deprecated options to the preferred ones.
1466 They include:
1467 .RS
1468 .TS
1469 l l
1470 _ _
1471 l l.
1472 \fIOption\fR    \fITreatment\fR
1473 \fB--beep-after\fP      ignored
1474 \fB--guage\fP   mapped to \fB--gauge\fP
1475 .TE
1476 .RE
1477 .SS XDIALOG
1478 Technically, "\fBXdialog\fP",
1479 this is an X application.
1480 With some care, it is possible to write useful scripts that work
1481 with both \fBXdialog\fP and \fBdialog\fP.
1482 .PP
1483 The \fB\*p\fP program ignores these options which are recognized
1484 by \fBXdialog\fP:
1485 .RS
1486 .TS
1487 l l
1488 _ _
1489 l l.
1490 \fIOption\fR    \fITreatment\fR
1491 \fB--allow-close\fP     ignored
1492 \fB--auto-placement\fP  ignored
1493 \fB--fixed-font\fP      ignored
1494 \fB--icon\fP    ignored
1495 \fB--keep-colors\fP     ignored
1496 \fB--no-close\fP        ignored
1497 \fB--no-cr-wrap\fP      ignored
1498 \fB--screen-center\fP   ignored
1499 \fB--separator\fP       mapped to \fB--separate-output\fP
1500 \fB--smooth\fP  ignored
1501 \fB--under-mouse\fP     ignored
1502 \fB--wmclass\fP ignored
1503 .TE
1504 .RE
1505 .PP
1506 \fBXdialog\fP's manpage has a section discussing its compatibility with \fB\*p\fP.
1507 There are some differences not shown in the manpage.
1508 For example, the html documentation states
1509 .RS
1510 .PP
1511 Note:  former  Xdialog  releases  used  the  "\n" (line feed) as a
1512 results  separator  for  the  checklist  widget; this has been
1513 changed  to  "/"  in  Xdialog v1.5.0 so to make it compatible with
1514 (c)dialog.  In  your  old scripts using the Xdialog checklist, you
1515 will  then  have  to  add  the --separate-output option before the
1516 --checklist one.
1517 .RE
1518 .PP
1519 \fB\*L\fP has not used a different separator;
1520 the difference was likely due to confusion regarding some script.
1521 .SS WHIPTAIL
1522 Then there is \fBwhiptail\fP.
1523 For practical purposes, it is maintained by Debian
1524 (very little work is done by its upstream developers).
1525 Its documentation (README.whiptail) claims
1526 .RS
1527 .sp
1528 .nf
1529 whiptail(1) is a lightweight replacement for \*p(1),
1530 to provide dialog boxes for shell scripts.
1531 It is built on the
1532 newt windowing library rather than the ncurses library, allowing
1533 it to be smaller in embedded enviroments such as installers,
1534 rescue disks, etc.
1535 .sp
1536 whiptail is designed to be drop-in compatible with \*p, but
1537 has less features: some dialog boxes are not implemented, such
1538 as tailbox, timebox, calendarbox, etc.
1539 .fi
1540 .RE
1541 .PP
1542 Comparing actual sizes (Debian testing, 2007/1/10):
1543 The total of sizes for \fBwhiptail\fP, the newt, popt and slang libraries is 757kb.
1544 The comparable number for \fB\*p\fP (counting ncurses) is 520kb.
1545 Disregard the first paragraph.
1546 .PP
1547 The second paragraph is misleading, since \fBwhiptail\fP
1548 also does not work for common options of \fB\*p\fP,
1549 such as the gauge box.
1550 \fBwhiptail\fP is less compatible with \fB\*p\fP than the
1551 original mid-1990s dialog 0.4 program.
1552 .PP
1553 \fBwhiptail\fP's manpage borrows features from \fB\*p\fP, e.g.,
1554 but oddly cites only \fB\*p\fP versions up to 0.4 (1994) as a source.
1555 That is, its manpage refers to features which
1556 were borrowed from more recent versions of \fB\*p\fP, e.g.,
1557 .bP
1558 \fB--gauge\fP (from 0.5)
1559 .bP
1560 \fB--passwordbox\fP (from Debian changes in 1999),
1561 .bP
1562 \fB--default-item\fP (from \fB\*p\fP 2000/02/22),
1563 .bP
1564 \fB--output-fd\fP (from \fB\*p\fP 2002/08/14).
1565 .PP
1566 Somewhat humorously, one may note that the \fBpopt\fP feature
1567 (undocumented in its manpage)
1568 of using a "--" as an escape was documented in \fB\*p\fP's manpage about
1569 a year before it was mentioned in \fBwhiptail\fP's manpage.
1570 \fBwhiptail\fP's manpage incorrectly attributes that to \fBgetopt\fP
1571 (and is inaccurate anyway).
1572 .PP
1573 Debian uses \fBwhiptail\fP for the official \fB\*p\fP variation.
1574 .PP
1575 The \fB\*p\fP program ignores or maps these options which are recognized
1576 by \fBwhiptail\fP:
1577 .RS
1578 .TS
1579 l l
1580 _ _
1581 l l.
1582 \fIOption\fR    \fITreatment\fR
1583 \fB--cancel-button\fP   mapped to \fB--cancel-label\fP
1584 \fB--fb\fP      ignored
1585 \fB--fullbutton\fP      ignored
1586 \fB--no-button\fP       mapped to \fB--no-label\fP
1587 \fB--nocancel\fP        mapped to \fB--no-cancel\fP
1588 \fB--noitem\fP  mapped to \fB--no-items\fP
1589 \fB--notags\fP  mapped to \fB--no-tags\fP
1590 \fB--ok-button\fP       mapped to \fB--ok-label\fP
1591 \fB--scrolltext\fP      mapped to \fB--scrollbar\fP
1592 \fB--topleft\fP mapped to \fB--begin 0 0\fP
1593 \fB--yes-button\fP      mapped to \fB--yes-label\fP
1594 .TE
1595 .RE
1596 .LP
1597 There are visual differences which are not addressed by command-line options:
1598 .bP
1599 \fB\*p\fP centers lists within the window.
1600 \fBwhiptail\fP typically puts lists against the left margin.
1601 .bP
1602 \fBwhiptail\fP uses angle brackets ("<" and ">") for marking buttons.
1603 \fB\*p\fP uses square brackets.
1604 .bP
1605 \fBwhiptail\fP marks the limits of subtitles with vertical bars.
1606 \fB\*p\fP does not mark the limits.
1607 .bP
1608 \fBwhiptail\fP attempts to mark the top/bottom cells of a scrollbar
1609 with up/down arrows.
1610 When it cannot do this,
1611 it fills those cells with the background color
1612 of the scrollbar and confusing the user.
1613 \fB\*p\fP uses the entire scrollbar space,
1614 thereby getting better resolution.
1615 .\" ************************************************************************
1616 .SH BUGS
1617 Perhaps.
1618 .SH AUTHOR
1619 .LP
1620 Thomas E. Dickey (updates for 0.9b and beyond)
1621 .SH CONTRIBUTORS
1622 Kiran Cherupally - the mixed form and mixed gauge widgets.
1623 .LP
1624 Tobias C. Rittweiler
1625 .LP
1626 Valery Reznic - the form and progressbox widgets.
1627 .LP
1628 Yura Kalinichenko adapted the gauge widget as "pause".
1629 .PP
1630 This is a rewrite (except as needed to provide compatibility)
1631 of the earlier version of \fB\*p 0.9a\fP,
1632 which lists as authors:
1633 .bP
1634 Savio Lam - version 0.3, "dialog"
1635 .bP
1636 Stuart Herbert - patch for version 0.4
1637 .bP
1638 Marc Ewing - the gauge widget.
1639 .bP
1640 Pasquale De Marco "Pako" - version 0.9a, "cdialog"