Where/how to store state for MUIFs? #2686
Replies: 1 comment 1 reply
-
I think I found the problem. The state was read-only according to the compiler because the struct was |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to create a IP address editor MUI without an extra form. The idea is that the field would display the address and when the select button is pressed, the first byte would become MUD editable, then pressing select again would jump to the second byte for MUD editing, and so on. Pressing select on the last byte exits editing mode and the entire address would become one field again.
To do this, I need to store state information like the index of the current byte being edited. I tried to do this along the lines of
MUIF_U8G2_U8_MIN_MAX
which creates a struct with the provided details for the field, but the problem is that it creates a read-only state so it can't be modified by the MUIF when jumping to the next byte.One solution would be to pass the initial state through
MUIF_VARIABLE
, but that seems like an ugly solution since it would expose internal fields.Any hints on how to do this? Thanks!
Beta Was this translation helpful? Give feedback.
All reactions