Closed lquang4321 closed 3 years ago
Hi,
Unfortunately, submenu functionality is not implemented. You're thinking in the correct direction:
createMenu(SAppMenu *menu, const char **items, uint8_t count, const NanoRect &rect)
This method is the right way to implement submenus. You only need to remember which level is active now, something like this (pseudocode):
SAppMenu *activeMenu = &mainMenu;
void loop()
{
...
display.showMenu( activeMenu );
...
if item is selected then activeMenu = &subMenu;
}
Best regards.
Thank you for your help, but since this is a school project I can't waste time. I decided it's easier to use ArduinoMenu library although that gave me headache of its own due to the shear amount of features/functionality.
Before I proceed, I'm a beginner in terms of programming so I might used incorrect programming terms. Anyways, I'm making a little device that needs a simple UI library. I managed to create the main menu but it's difficult to create submenu. At first, I tried to create a multidimensional array and then cycle through the "pages" but I don't think the menu gets updated. I'm at a lost. My current solution is to create multiple LcdGfxMenu object and manually do the logic so it displays ontop which gets tedious as the submenu grows.
Is there a way to create a submenu system? I'm currently using Adafruit nrf52 Feather bluefruit and SSD 1306 0.96" mono. Thanks.