Introduce Options and use them for Menu.

Introduce Options for components. This allows me to add new features,
without updating functions signatures.
This commit is contained in:
ArthurSonzogni
2021-07-07 22:13:33 +02:00
committed by Arthur Sonzogni
parent 82adc3b410
commit cd84b187b3
10 changed files with 168 additions and 120 deletions

View File

@@ -19,8 +19,9 @@ int main(int argc, const char* argv[]) {
};
int selected = 0;
auto menu = Menu(&entries, &selected);
MenuBase::From(menu)->on_enter = screen.ExitLoopClosure();
MenuOption option;
option.on_enter = screen.ExitLoopClosure();
auto menu = Menu(&entries, &selected, &option);
screen.Loop(menu);