Skip to content

Cannot jump to a desired menu item ID using the callback function from parent item #96

@floxia

Description

@floxia

Hi Jomelo, thanks for your excellent work in creating this fantastic library. I am facing an issue, and you might know what I might be doing wrong!

I am attempting to jump to a desired menu item ID using the callback function:

void  mFunc_jump_to_ID(uint8_t param)
{
    LCDML.OTHER_setCursorToID(4);
}

I have also tried the callback function below with the same results.

void  mFunc_jump_to_ID(uint8_t param)
{
    LCDML..OTHER_jumpToID(4, 0);
}

In this menu structure:

LCDML._add(0, LCDML._0, 1, "Item 1", mFunc_digit);

LCDML._add(1, LCDML._0, 2, "Item 2", mFunc_jump_to_ID);
LCDML._add(2, LCDML._0_2, 1, "Item 2, Sub 1", NULL);
LCDML._add(3, LCDML._0_2, 2, "Item 2, Sub 2", NULL);
LCDML._add(4, LCDML._0_2, 3, "Item 2, Sub 3", NULL);
LCDML._add(5, LCDML._0_2, 4, "Item 2, Sub 4", NULL);

The above function, when called, should jump straight to ID #4 in this case:

LCDML._add(4, LCDML._0_2, 3, "Item 2, Sub 3", NULL);

Although the function only works if it is not called from a parent but only from a child, as I suspect the parent is already bound to "open the submenu function", I cannot call any callback function from a menu item with submenus.

Therefore, for example,

This works:

LCDML._add(2, LCDML._0_2, 1, "Item 2, Sub 1", mFunc_jump_to_ID);

This does not work:

LCDML._add(1, LCDML._0, 2, "Item 2", mFunc_jump_to_ID);

I am not sure what I am missing here, I am also not seeing any other settings to call a function when the submenu is opened which would be useful to jump to the desired item. I am trying to jump to the desired value of each submenu previously stored elsewhere, showing the current setting selected.

Any ideas on how to solve this would be greatly appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions