Gooey GUI Library
Loading...
Searching...
No Matches
gooey_menu.h File Reference

Header file for the Gooey menu system. More...

#include "common/gooey_common.h"

Go to the source code of this file.

Functions

GooeyMenu * GooeyMenu_Set (GooeyWindow *win)
 Sets the menu for the specified Gooey window.
 
GooeyMenuChild * GooeyMenu_AddChild (GooeyWindow *win, char *title)
 Adds a child menu item to the window's menu.
 
void GooeyMenuChild_AddElement (GooeyMenuChild *child, char *title, void(*callback)())
 Adds an element (option) to a menu child.
 

Detailed Description

Header file for the Gooey menu system.

Provides functions to create and manage menus and menu items within a Gooey window.

Author
Yassine Ahmed Ali @license GPL-3.0

Function Documentation

◆ GooeyMenu_AddChild()

GooeyMenuChild * GooeyMenu_AddChild ( GooeyWindow *  win,
char *  title 
)

Adds a child menu item to the window's menu.

Creates a submenu or a category inside the main menu.

Parameters
winThe window to which the menu child will be added.
titleThe title of the menu child.
Returns
A pointer to the newly created GooeyMenuChild object.

◆ GooeyMenu_Set()

GooeyMenu * GooeyMenu_Set ( GooeyWindow *  win)

Sets the menu for the specified Gooey window.

Initializes and attaches a menu to the given window.

Parameters
winThe window to set the menu for.
Returns
A pointer to the newly created GooeyMenu object.

◆ GooeyMenuChild_AddElement()

void GooeyMenuChild_AddElement ( GooeyMenuChild *  child,
char *  title,
void(*)()  callback 
)

Adds an element (option) to a menu child.

Parameters
childThe menu child to which the item will be added.
titleThe title of the menu item.
callbackThe function to be called when the menu item is selected.