-
Hello, I'm starting my studies with the library and I saw the example of a scrollable jump table (static) as below:
From what I understood, when I select each of these fields I can go to another form. I would like to know if one of the items in this list could actually be a back button so I could exit the menu. I tried using the "Exit button" but it remains static on the display and I would actually like it to be just another item in the list. I appreciate any help in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Let me assume you use uint8_t mui_goto_or_back_form_w1_pi(mui_t *ui, uint8_t msg)
{
if ( msg == MUIF_MSG_CURSOR_SELECT )
{
if ( mui_GetSelectableFieldTextOption(ui, ui->last_form_fds, ui->arg + ui->form_scroll_top) )
{
if ( (uint8_t)ui->text[0] == 255 ) // use MUI_255 for the return
{
return mui_RestoreForm(ui);
}
}
}
return mui_u8g2_goto_form_w1_pi(ui, msg); // call the original MUIF
} In this case, the jump back functionality is then executed with MUI_255. |
Beta Was this translation helpful? Give feedback.
-
Hello Olikraus I tested the code you sent, but it was showing an error because the "
Another point: I tried to use "MUI_255", but when I use it, a problem occurs that when the display shows all the items in the list, they don't appear and I can't even interact with it. As I said before, I'm still starting to study the library, so please comment if I've implemented something wrong or incorrectly. I thank you in advance for your help. |
Beta Was this translation helpful? Give feedback.
You are right, 255 has a special meaning, we need to use 254 (or any other number between 1 and 254).
mui_LeaveForm
will not work, but yes,mui_RestoreForm(ui);
is void.The correct code is here:
u8g2/sys/sdl/mui_all/main.c
Lines 213 to 229 in e6a66ee