The python code provided with the display-o-tron HAT is great for easily making menus and navigating them. The only thing I couldn’t figure out is if there is a way to exit menu class function without hitting the escape button. Calling the left button or cancel button from the class redraw function doesn’t do it. How can I exit a menu class function from the class itself?
Thanks for the quick reply. It saves me from looking for a solution. I’m working on a network monitor that probes via SNMP various devices like router, access points, NAS, printer etc. and puts that information on the HAT including warnings if anything is not ok. The menu is for navigating through all monitored devices. The use case is that after navigating through the devices you can leave the PI and it will automatically switch back to the default (i.e.idle) handler which in my case shows WAN up and downloads speeds and logs that into files. Your answer means that after checking various devices you always need to return to the menu navigation (for automatic switch to the default handler) or select the default handler yourself. Not a big deal but just a little less user friendly.
PS. I noticed that the example code in menu.py under dothat/advanced has a menustructure with idle time function name “idle_timeout” which should be “idle_time” according to menu.py in the dot3k library.