Gooey GUI Library
|
Button handling functions for the Gooey GUI library. More...
#include "common/gooey_common.h"
#include <stdbool.h>
Go to the source code of this file.
Functions | |
GooeyButton * | GooeyButton_Create (const char *label, int x, int y, int width, int height, void(*callback)()) |
Adds a button to the window. | |
void | GooeyButton_SetText (GooeyButton *button, const char *text) |
Sets the text of the button. | |
void | GooeyButton_SetHighlight (GooeyButton *button, bool is_highlighted) |
Highlights or unhighlights a button. | |
Button handling functions for the Gooey GUI library.
This file contains functions for adding, handling, and drawing buttons in a Gooey window.
GooeyButton * GooeyButton_Create | ( | const char * | label, |
int | x, | ||
int | y, | ||
int | width, | ||
int | height, | ||
void(*)() | callback | ||
) |
Adds a button to the window.
This function creates a new button with the specified label, position, dimensions, and callback function. The button is added to the provided window.
label | The label to display on the button. |
x | The x-coordinate of the button's position. |
y | The y-coordinate of the button's position. |
width | The width of the button. |
height | The height of the button. |
callback | The callback function to call when the button is clicked. |
void GooeyButton_SetHighlight | ( | GooeyButton * | button, |
bool | is_highlighted | ||
) |
Highlights or unhighlights a button.
This function visually indicates whether a button is highlighted, which can be used to show focus or selection.
button | A pointer to the button to modify. |
is_highlighted | true to highlight the button; false to remove the highlight. |
void GooeyButton_SetText | ( | GooeyButton * | button, |
const char * | text | ||
) |
Sets the text of the button.
This function updates the label text displayed on the button.
button | The button to set the text for. |
text | The new text to display on the button. |