9
0
Fork 0

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:
Sascha Hauer 2013-06-18 00:24:16 +02:00
parent f890ea69be
commit 22350e4e68
1 changed files with 2 additions and 1 deletions

View File

@ -361,7 +361,8 @@ int menu_show(struct menu *m)
break;
clear();
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)
return m->selected->num;
else