I'm trying to add the beautiful menus from Pygame-menu (
https://github.com/ppizarror/pygame-menu) to my project, but having trouble. In my attached stripped down sample, I'm trying to show menu1 when the 1 key is pressed, and show menu2 when the 2 key is pressed. They're both "main menus" launched from the root of the app, as opposed to one being a submenu of the other.
My questions:
- how can I find out what item was selected in the menu? Clicking a selection triggers the item_selected() function, but doesn't send any info about which item was selected.
- how can I close a menu? Running menu1.disable() in item_selected() doesn't close the menu... How do I close the menu when something is selected?
Ideally in this sample I'd like to launch menu1 when the 1 key is pressed, choose a selection, print info about what was selected, and return to the root of the app. Then pressing keyboard 2 launches menu2, repeating the process.
Thanks for any help, and apologies if I'm missing something obvious here.