thanks, so it is just burning extra CPU in this case but memory is not affected as you probably need to pass one such function for each menu item anyway no matter how big or small.
the submenu item is broken - the }, ending part from back: line probably belongs to line above it but it still breaks with Uncaught Error: Cannot read property 'title' of undefined until I also comment out two items with undefined
when showing the menu repeatedly via E.showMenu(mainmenu) call and just clicking the Exit item I need to click twice to close it and everytime the menu is shown and hidden I get 5 variables less free visible in process.memory()
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
thanks, so it is just burning extra CPU in this case but memory is not affected as you probably need to pass one such function for each menu item anyway no matter how big or small.
Anyway, I tried to learn how E.showMenu() works. So I started Bangle 2 emulator, copy pasted example from http://www.espruino.com/Reference#l_E_showMenu 'as is' and
},
ending part fromback:
line probably belongs to line above it but it still breaks withUncaught Error: Cannot read property 'title' of undefined
until I also comment out two items withundefined
E.showMenu(mainmenu)
call and just clicking the Exit item I need to click twice to close it and everytime the menu is shown and hidden I get 5 variables less free visible inprocess.memory()