pub struct MenuProps<'a> {
pub title: &'a str,
pub message: &'a str,
pub exit_on_action: bool,
pub bg_color: u8,
pub fg_color: u8,
pub title_color: Option<u8>,
pub selected_color: Option<u8>,
pub msg_color: Option<u8>,
}Expand description
Stores configuration data passed to a Menu on creation.
Menus use 8-bit colors to ensure widespread terminal support. It should be noted that values from 0-15 will make colors vary based on individual terminal settings.
Configure a subset of properties using the defaults and struct update syntax:
let props = MenuProps {
title: "My Menu",
..MenuProps::default()
};Fields§
§title: &'a strDisplays above the list of menu options. Pass an empty string for no title.
message: &'a strDisplay below the list of menu options. Pass an empty string for no message.
exit_on_action: boolIf true, menu will exit immediately upon an option being selected.
bg_color: u8The background color for the menu.
fg_color: u8The foreground (text) color for the menu.
title_color: Option<u8>Optional color for the title. If None, the foreground color will be used.
selected_color: Option<u8>Optional color for the selected menu option. If None, the foreground color will be used.
msg_color: Option<u8>Optional color for the footer message. If None, the foreground color will be used.