Gooey GUI Library
Loading...
Searching...
No Matches
gooey_menu.h File Reference
#include "core/gooey_backend_internal.h"
#include "gooey_widgets_internal.h"

Go to the source code of this file.

Functions

GooeyMenu * GooeyMenu_Set (GooeyWindow *win)
 Sets the menu for the Gooey window.
 
GooeyMenuChild * GooeyMenu_AddChild (GooeyWindow *win, char *title)
 Adds a child menu item to the window's menu.
 
void GooeyMenu_HandleClick (GooeyWindow *win, int x, int y)
 Handles menu item click events.
 
void GooeyMenuChild_AddElement (GooeyMenuChild *child, char *title, void(*callback)())
 Adds a menu item to a menu child.
 
void GooeyMenu_Draw (GooeyWindow *win)
 

Function Documentation

◆ GooeyMenu_AddChild()

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

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

Parameters
winThe window to add the menu item to.
titleThe title of the menu item.
Returns
A new GooeyMenuChild object.

◆ GooeyMenu_Draw()

void GooeyMenu_Draw ( GooeyWindow *  win)

◆ GooeyMenu_HandleClick()

void GooeyMenu_HandleClick ( GooeyWindow *  win,
int  x,
int  y 
)

Handles menu item click events.

Parameters
winThe window containing the menu.
xThe x-coordinate of the click event.
yThe y-coordinate of the click event.

◆ GooeyMenu_Set()

GooeyMenu * GooeyMenu_Set ( GooeyWindow *  win)

Sets the menu for the Gooey window.

Initializes and sets the menu for the given window.

Parameters
winThe window to set the menu for.
Returns
A new GooeyMenu object.

◆ GooeyMenuChild_AddElement()

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

Adds a menu item to a menu child.

Parameters
childThe menu child to add the item to.
titleThe title of the menu item.
callbackThe callback function to call when the item is selected.