FabGL
ESP32 Display Controller and Graphics Library

◆ menu() [1/2]

int menu ( char const *  titleText,
char const *  messageText,
char const *  itemsText,
char  separator = ';' 
)

Shows a dialog with a label and a list box. The dialog exits when an item is selected, just like a menu.

Parameters
titleTextOptional title of the dialog (nullptr = the dialogs hasn't a title)
messageTextMessage to show
itemsTextString containing a separated list of items to show into the listbox
separatorOptional items separator. Default is ';'
Returns
Index of the selected item or -1 if dialog has been canceled

Example:

InputBox ib;
ib.begin();
int s = ib.menu("Menu", "Click on an item", "Item number one;Item number two;Item number three;Item number four");
ib.messageFmt("", nullptr, "OK", "You have selected %d", s);
ib.end();

Definition at line 235 of file inputbox.cpp.