menu: Make action callback optional
Someone calling menu_show might only be interested in the entry the user selected without having something in the action callback. Make it optional. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
f890ea69be
commit
22350e4e68
|
@ -361,7 +361,8 @@ int menu_show(struct menu *m)
|
||||||
break;
|
break;
|
||||||
clear();
|
clear();
|
||||||
gotoXY(1,1);
|
gotoXY(1,1);
|
||||||
m->selected->action(m, m->selected);
|
if (m->selected->action)
|
||||||
|
m->selected->action(m, m->selected);
|
||||||
if (m->selected->non_re_ent)
|
if (m->selected->non_re_ent)
|
||||||
return m->selected->num;
|
return m->selected->num;
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue