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()= 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()= dialog_msgbox(title,message,height,width,pause) Put up a dialog box with a message in it. If pause is nonzero, an [OK] button will be displayed and the function will wait until you press it, otherwise it will immediately return.

=dialog_mesgbox()= 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()= 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.

<table border=1>
<tr><th valign=top align=left>`title`</th>
<td>The title on the dialog window</td></tr>
<tr><th valign=top align=left>`message`</th>
<td>A message printed at the top of the dialog window</td></tr>
<tr><th valign=top align=left>`width`</th>
<td>How wide the window should be (-1 for autosizing)</td></tr>
<tr><th valign=top align=left>`height`</th>
<td>How deep the window should be (-1 for autosizing)</td></tr>
<tr><th valign=top align=left>`menu_height`</th>
<td>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.)</td></tr>
<tr><th valign=top align=left>`menu_items`</th>
<td>How long menu[] is.</td></tr>
<tr><th valign=top align=left>`menu`</th>
<td>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.</td></tr>
<tr><th valign=top align=left>`result`</th>
<td>A string that holds the selected keyword.</td></tr>
<tr><th valign=top align=left>`ch,sc`</th>
<td>Horrible compatability kludges to keep track of the last item
selected.  You need to set them to zero before you call dialog_menubox.</td></tr>
</table>

=dialog_checklist()= 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()= 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()= dialog_gauge(title,message,y,x,height,width,perc) Display a window that contains a progress gauge (from 0% to **100%)

=dialog_clear_norefresh()= dialog_clear_norefresh() clears the current window, but doesn’t refresh the screen.

=dialog_clear()= dialog_clear() clears the current window and refreshes the screen.

=dialog_update()= dialog_update() updates the window, like the curses function wrefresh

Return to the main ndialog page