Expand description
A menu builder for Terminal User Interfaces with searching and arrow key navigation
Use the menu_item!
and menu!
macros for the best effect
§Example
use cartographer_rs::{menu, menu_item};
let menu = menu!(
"Pick a number: ",
[
menu_item!("Item Number 1", true, 1),
menu_item!("Item Number 2", false, 2, ["death"]),
menu_item!("Item Number 3", true, 3),
menu_item!("Item Number 5", true, 5, ["80", "5"])
]
);
// Returns the string of the item given
let usr_selection = menu.serve()?;
Macros§
- menu
- Creates a
Menu
in one line - menu_
item - Creates a
MenuItem
, filling in the defaults if values are not provided
Structs§
- Menu
- The Menu struct that contains the information and functions for displaying the menus
- Menu
Item - A data structure representing a line-item in a menu
- Menu
Options - Controls and characters that can be configured to change the way the menu acts and displays