diff --git a/menu.c b/menu.c index 98839cd..48269a8 100644 --- a/menu.c +++ b/menu.c @@ -63,7 +63,7 @@ void show_menu(const struct MenuPage* pages, const size_t page_count, const bool { // Perform action system("cls"); - pages[page_index].items[i].action(); + pages[page_index].items[i].action(pages[page_index].items[i].param); action_performed = true; // Pause if requested diff --git a/menu.h b/menu.h index 496f55f..3776b21 100644 --- a/menu.h +++ b/menu.h @@ -6,7 +6,8 @@ struct MenuItem { char* text; char key; - void* (*action)(void); + void* (*action)(void* params); + void* param; }; /// Represents a border in which a menu is displayed.