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

Header file for the GooeyDropdown module. More...

#include "common/gooey_common.h"

Go to the source code of this file.

Functions

GooeyDropdown * GooeyDropdown_Create (int x, int y, int width, int height, const char **options, int num_options, void(*callback)(int selected_index))
 Adds a dropdown menu to the specified window.
 

Detailed Description

Header file for the GooeyDropdown module.

Provides functions to create, handle, and render dropdown menus within a GooeyWindow.

Author
Yassine Ahmed Ali @license GPL-3.0

Function Documentation

◆ GooeyDropdown_Create()

GooeyDropdown * GooeyDropdown_Create ( int  x,
int  y,
int  width,
int  height,
const char **  options,
int  num_options,
void(*)(int selected_index)  callback 
)

Adds a dropdown menu to the specified window.

This function creates a new dropdown menu with the given list of options

Parameters
xThe x-coordinate of the dropdown's position.
yThe y-coordinate of the dropdown's position.
widthThe width of the dropdown menu.
heightThe height of the dropdown menu.
optionsThe array of strings representing the dropdown menu options.
num_optionsThe total number of options in the dropdown.
callbackThe function to call when an option is selected. It receives the index of the selected option.
Returns
A pointer to the newly created GooeyDropdown object.