Gooey GUI Library
|
#include "common/gooey_common.h"
Go to the source code of this file.
Functions | |
GooeyRadioButton * | GooeyRadioButton_Add (int x, int y, char *label, void(*callback)(bool selected)) |
Adds a radio button to the window. | |
bool | GooeyRadioButton_HandleClick (GooeyWindow *win, int x, int y) |
Handles radio button click events. | |
bool | GooeyRadioButtonGroup_HandleClick (GooeyWindow *win, int x, int y) |
Handles click events for a group of radio buttons. | |
GooeyRadioButtonGroup * | GooeyRadioButtonGroup_Create () |
Creates a radio button group widget. | |
GooeyRadioButton * | GooeyRadioButtonGroup_AddChild (GooeyWindow *win, GooeyRadioButtonGroup *group, int x, int y, const char *label, void(*callback)(bool)) |
Adds a radio button to a radio button group. | |
void | GooeyRadioButtonGroup_Draw (GooeyWindow *win) |
Draws the radio button group on the window. | |
GooeyRadioButton * GooeyRadioButton_Add | ( | int | x, |
int | y, | ||
char * | label, | ||
void(*)(bool selected) | callback | ||
) |
Adds a radio button to the window.
This function adds a radio button with a label to the specified window at a given position. A callback function is invoked when the radio button is selected.
win | The window to add the radio button to. |
x | The x-coordinate of the radio button's position. |
y | The y-coordinate of the radio button's position. |
label | The label of the radio button. |
callback | The callback function to call when the radio button is selected. |
bool GooeyRadioButton_HandleClick | ( | GooeyWindow * | win, |
int | x, | ||
int | y | ||
) |
Handles radio button click events.
This function detects if a click event occurred on a radio button in the given window and invokes the appropriate action.
win | The window containing the radio button. |
x | The x-coordinate of the click event. |
y | The y-coordinate of the click event. |
GooeyRadioButton * GooeyRadioButtonGroup_AddChild | ( | GooeyWindow * | win, |
GooeyRadioButtonGroup * | group, | ||
int | x, | ||
int | y, | ||
const char * | label, | ||
void(*)(bool) | callback | ||
) |
Adds a radio button to a radio button group.
This function adds a new radio button to a specified radio button group within the given window. A callback is executed when the radio button is selected.
win | The window containing the radio button group. |
group | The radio button group to add the button to. |
x | The x-coordinate of the radio button. |
y | The y-coordinate of the radio button. |
label | The label for the radio button. |
callback | The callback to execute when the radio button is selected. |
GooeyRadioButtonGroup * GooeyRadioButtonGroup_Create | ( | ) |
Creates a radio button group widget.
This function creates a new radio button group, allowing multiple radio buttons to be grouped together, ensuring that only one button is selected at a time.
void GooeyRadioButtonGroup_Draw | ( | GooeyWindow * | win | ) |
Draws the radio button group on the window.
This function renders all the radio buttons within a group onto the window. It ensures that the visual representation reflects the selected state of each button.
win | The window to draw the radio button group on. |
bool GooeyRadioButtonGroup_HandleClick | ( | GooeyWindow * | win, |
int | x, | ||
int | y | ||
) |
Handles click events for a group of radio buttons.
This function allows handling click events in a group of radio buttons, ensuring that only one radio button is selected at a time.
win | The window containing the radio button group. |
x | The x-coordinate of the click event. |
y | The y-coordinate of the click event. |