Screens could link to child menus #69
Replies: 5 comments
-
If I understand right you are looking for the Let me know if I misunderstood you. |
Beta Was this translation helpful? Give feedback.
-
Yes, that's a very good example. This is good. But I have an idea. :) In this way, navigating multiple menus would be so easy. No callbacks would need to be added, and the menus would be smart enough to navigate with just two methods. :) What do you think? Dan |
Beta Was this translation helpful? Give feedback.
-
Another thing I've done in the past is have a line item have a on_changed method. |
Beta Was this translation helpful? Give feedback.
-
In your example, you call this a bunch of times. All these calls and callbacks could be eliminated. instead, switch_focus() would jump right to the attached menu. Here's an overview: menu1 menu3
menu3,screen4) |
Beta Was this translation helpful? Give feedback.
-
I agree, this will make it more intuitive to navigate menus. The problem is that this library is using a lot of RAM because it uses static memory for the arrays that hold the functions callbacks, the variables pointers and their types, the I can't add this functionality for now, but I'll definitely add it in the future if I update the library to use dynamic memory. |
Beta Was this translation helpful? Give feedback.
-
Was wondering if this sounded like a good request.
Screens could have attached menus.
Screen.attach_menu(ConfigMenu);
Then, no callbacks would be needed to traverse menus.
The ConfigMenu _parent variable is set to the parent of the screen.
When you select a screen, it would take you to the attached menu.
then if you want to go back
CurrentMenu.go_to_parent(); //if no parent, just returns same menu
Dan
Beta Was this translation helpful? Give feedback.
All reactions