Now supporting single Arguments

This commit is contained in:
Simon 2020-01-23 13:01:19 +01:00
parent bcd00c5451
commit da73f62ea7
2 changed files with 3 additions and 2 deletions

2
menu.c
View File

@ -63,7 +63,7 @@ void show_menu(const struct MenuPage* pages, const size_t page_count, const bool
{ {
// Perform action // Perform action
system("cls"); system("cls");
pages[page_index].items[i].action(); pages[page_index].items[i].action(pages[page_index].items[i].param);
action_performed = true; action_performed = true;
// Pause if requested // Pause if requested

3
menu.h
View File

@ -6,7 +6,8 @@
struct MenuItem { struct MenuItem {
char* text; char* text;
char key; char key;
void* (*action)(void); void* (*action)(void* params);
void* param;
}; };
/// <summary>Represents a border in which a menu is displayed.</summary> /// <summary>Represents a border in which a menu is displayed.</summary>