#include "core/gooey_backend_internal.h"
#include "gooey_widgets_internal.h"
#include <stdbool.h>
Go to the source code of this file.
|
| GooeyButton * | GooeyButton_Add (GooeyWindow *win, const char *label, int x, int y, int width, int height, void(*callback)()) |
| | Adds a button to the window.
|
| |
| bool | GooeyButton_HandleClick (GooeyWindow *win, int x, int y) |
| | Handles button click events.
|
| |
| void | GooeyButton_SetText (GooeyButton *button, const char *text) |
| | Sets the text of the button.
|
| |
| void | GooeyButton_Draw (GooeyWindow *win) |
| | Draws the button on the window.
|
| |
| void | GooeyButton_SetHighlight (GooeyButton *button, bool is_highlighted) |
| | Highlights or unhighlights a button.
|
| |
◆ GooeyButton_Add()
| GooeyButton * GooeyButton_Add |
( |
GooeyWindow * |
win, |
|
|
const char * |
label, |
|
|
int |
x, |
|
|
int |
y, |
|
|
int |
width, |
|
|
int |
height, |
|
|
void(*)() |
callback |
|
) |
| |
Adds a button to the window.
- Parameters
-
| win | The window to add the button to. |
| 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. |
- Returns
- A new GooeyButton object.
◆ GooeyButton_Draw()
| void GooeyButton_Draw |
( |
GooeyWindow * |
win | ) |
|
Draws the button on the window.
- Parameters
-
| win | The window to draw the button on. |
◆ GooeyButton_HandleClick()
| bool GooeyButton_HandleClick |
( |
GooeyWindow * |
win, |
|
|
int |
x, |
|
|
int |
y |
|
) |
| |
Handles button click events.
- Parameters
-
| win | The window containing the button. |
| x | The x-coordinate of the click event. |
| y | The y-coordinate of the click event. |
- Returns
- True if the button was clicked, false otherwise.
◆ GooeyButton_SetHighlight()
| void GooeyButton_SetHighlight |
( |
GooeyButton * |
button, |
|
|
bool |
is_highlighted |
|
) |
| |
Highlights or unhighlights a button.
This function visually indicates whether a button is highlighted.
- Parameters
-
| button | A pointer to the button to modify. |
| is_highlighted | true to highlight the button; false to remove the highlight. |
◆ GooeyButton_SetText()
| void GooeyButton_SetText |
( |
GooeyButton * |
button, |
|
|
const char * |
text |
|
) |
| |
Sets the text of the button.
- Parameters
-
| button | The button to set the text for. |
| text | The new text to display on the button. |