Message Boxes
There are various types of message boxes with ndless
. The following
message boxes are supported:
Type | Function |
---|---|
Title, message, OK Button | msg |
Title, message, 2 custom buttons | msg_2b |
Title, message, 3 custom buttons | msg_3b |
Title, message, string input with default | msg_input |
Title, message, numeric input with min/max | msg_numeric |
Title and two messages & numeric inputs with min/max | msg_2numeric |
Use it like this:
fn main() {
ndless::msg::msg("Title", "Message");
}
Message boxes with more than one button return a variant of Button. Use it like:
fn main() {
let button_pressed = msg_3b("Hello", "Hello, World!", "1", "2", "3");
let message = match button_pressed {
Button::ONE => "one",
Button::TWO => "two",
Button::THREE => "three",
};
}
Pressing escape will return the first button.