H07551 s 00000/00000/00110 d D 1.2 02/06/03 17:56:47 patch 3 2 c Import patch patch.37 cC cF25393 cK15451 cPsrc/doc/dialog.html e s 00110/00000/00000 d D 1.1 02/06/03 17:56:41 patch 2 1 c Import patch patch.01 cC cF25308 cK32500 cO-rw-rw-r-- e s 00000/00000/00000 d D 1.0 02/06/03 17:56:41 patch 1 0 c BitKeeper file /home/orc/Src/ndialog/nd/doc/dialog.html cBorc@pacific.pell.portland.or.us|ChangeSet|20020604075610|31977|6e29fa5631e78430 cF25307 cHpacific.pell.portland.or.us cK53960 cPnd/doc/dialog.html cRd5dd114746b7af57 cV4 cX0x821 cZ-07:00 e u U f e 0 f x 0x821 t T I 2 Libdialog compatability functions

Dialog compatablity functions

All these functions pop up a window containing the prompt and, if appropriate, a box containing whatever the dialog wants to display. They are all built up from ndialog objects and the MENU() display function.
dialog_yesno(title,message,height,width)
Put up a dialog box asking for a yes/no answer. You can autosize the dialog box by setting height and width to -1.
dialog_msgbox(title,message,height,width,pause)
Put up a dialog box with a message in it. If pause is nonzero, a [OK] button will be displayed and the function will wait until you press it, otherwise it will immediately return.
dialog_mesgbox(title,message,height,width)

Put up a dialog box with a message in it and wait for the user to press the [OK] button.

NOTE: This is not correctly implemented. If you pass it a message string that's longer or wider than the screen, dialog_mesgbox will silently fail.

dialog_menu(title,message,height,width,menu_height,
menu_items,items,result,ch,sc)

Put up a menu box and wait for the user to select a menu item or cancel out of the box.

title
The title on the dialog window
message
A message printed at the top of the dialog window
width
How wide the window should be (-1 for autosizing)
height
How deep the window should be (-1 for autosizing)
menu_height
How many items in the menu should be visible at any time (Note that this needs to be 3 less than height, because room is needed for the [CANCEL] button and a separator line.)
menu_items
How long menu[] is.
menu
The menu items, as an array of pairs of strings. The first string (menu[x+x]) is a keyword for this menu item, the second string (menu[x+x+1]) is the description for this menu item. You need to make certain that menu contains 2*menu_items entries, or hilarious crashes will happen.
result
A string that holds the selected keyword.
ch,sc
Horrible compatability kludges to keep track of the last item selected. You need to set them to zero before you call dialog_menubox.
dialog_checklist(title,message,height,width,list_height,
nr_list,items,result)

Like dialog_menubox(), except it puts up a list of checkable items. Note that there are no ch and sc parameters, and that the menu parameter is slightly different. For dialog_checklist, menu is composed of string triples; menu[x+x] is the key, menu[x+x+1] is the description, and menu[x+x+2] is the value on to tell the function that this item is selected. If the user does not cancel out of this form, result contains a whitespace-delimited list of selected keywords.

dialog_radiolist(title,message,height,width,list_height,
nr_list,items,result)

Like dialog_checklist(), except only one item can be checked at a time.

dialog_gauge(title,message,y,x,height,width,perc)

Display a window that contains a progress gauge (from 0% to 100%)

dialog_clear_norefresh()

clears the current window, but doesn't refresh the screen.

dialog_clear()

clears the current window and refreshes the screen.

dialog_update()

updates the window, like the curses function wrefresh

Back to main ndialog page


Written March 1998 by David Parsons
E 2 I 1 E 1