implemented short menu system too

This commit is contained in:
Luxferre
2026-01-04 14:41:54 +02:00
parent d2009dd65c
commit 7eb45a4f0b
3 changed files with 32 additions and 3 deletions
+6 -2
View File
@@ -56,9 +56,13 @@ Exported functions:
### `deck.menu`
A library for easy menu systems for T-DeckARD programs. Allows displaying up to 10 menu items with the ability to select them with a single digit or a key on the `QWERTYUIOP` keyboard row.
A library for easy menu systems for T-DeckARD programs.
Exports the only function, `menu(choices)`, which accepts a list of **tuples**, each in the format `(id, label)`. The `label` field is what's displayed on the screen, the `id` field is the string that gets returned upon selection. If the user selects `c`, the operation is canceled and an empty `id` string is returned.
Exported functions:
- `confirm(msg, yes='y', no='n', alt_prompt=None)`: prompt for yes/no confirmation, using a standard prompt in `msg` and the `yes`/`no` message in the corresponding parameters, or a completely alternative prompt in `alt_prompt`.Returns True or False as the result.
- `shortmenu(choices, suffix=': ')`: display several menu items from the `choices` list, automatically labeling the first fitting letter from the item as the selection shortcut. Returns a tuple (`result`, `label`), or (``,``) in case the selection doesn't match.
- `menu(choices)`: display up to 10 menu items with the ability to select them with a single digit or a key on the `QWERTYUIOP` keyboard row. Accepts a list of **tuples**, each in the format `(id, label)`. The `label` field is what's displayed on the screen, the `id` field is the string that gets returned upon selection. If the user selects `c`, the operation is canceled and an empty `id` string is returned.
### `deck.time`