Now supporting single Arguments #9
2
menu.c
2
menu.c
@ -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
3
menu.h
@ -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>
|
||||||
|
Reference in New Issue
Block a user