Skip to content

Exit button in Scrollable Jump Table (static) #2516

Closed Answered by olikraus
JosehL7 asked this question in Q&A
Discussion options

You must be logged in to vote

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

/* https://github.com/olikraus/u8g2/discussions/2516 */
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] == 254 ) // use MUI_254 for the return
{
mui_RestoreForm(ui);
return 0;
}
}
}
r…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@olikraus
Comment options

Answer selected by JosehL7
@JosehL7
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants