[][src]Function newt::windows::win_menu

pub fn win_menu(
    title: &str,
    text: &str,
    suggested_width: i32,
    flex_down: i32,
    flex_up: i32,
    max_list_height: i32,
    items: &[&str],
    buttons: &[&str]
) -> (i32, i32)

Open a window containing a Listbox menu.

Requires that the asm feature be enabled.

  • title - The window title.
  • text - The message to display in the window.
  • suggested_width - The preferred width for the window.
  • flex_down - The minimum allowed difference between suggested_width and actual width.
  • flex_up - The maximum allowed difference between suggested_width and actual width.
  • max_list_height - The maximum height to display the list of items.
  • items - A slice containing the text for each item in the list.
  • buttons - A slice containing the text for a number of buttons to display in the window.

Returns a tuple pair as (button, item) where button is the button number pressed to close the window and item is the item number in the list that was selected.