menu: Add support for user defined item choice function
Selecting menu items is currently done in menu_interactive_choice() by reading the user input strings from standard input. Extend menu_interactive_choice() to support user defined function for selecting menu items. This function and its argument can be specified when creating the menu. Signed-off-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Anatolij Gustschin <agust@denx.de>
This commit is contained in:
committed by
Anatolij Gustschin
parent
009d75ccc1
commit
fc9d64ffcd
@@ -51,7 +51,9 @@ struct menu;
|
||||
* menu_create() - Creates a menu handle with default settings
|
||||
*/
|
||||
struct menu *menu_create(char *title, int timeout, int prompt,
|
||||
void (*item_data_print)(void *));
|
||||
void (*item_data_print)(void *),
|
||||
char *(*item_choice)(void *),
|
||||
void *item_choice_data);
|
||||
|
||||
/*
|
||||
* menu_item_add() - Adds or replaces a menu item
|
||||
|
||||
Reference in New Issue
Block a user