#include "core/gooey_backend_internal.h"
#include "gooey_event_internal.h"
Go to the source code of this file.
|
GooeyTextbox * | GooeyTextBox_Add (GooeyWindow *win, int x, int y, int width, int height, char *placeholder, void(*onTextChanged)(char *text)) |
| Adds a textbox to the window.
|
|
void | GooeyTextbox_Draw (GooeyWindow *win) |
| Draws the textbox on the window.
|
|
bool | GooeyTextbox_HandleClick (GooeyWindow *win, int x, int y) |
| Handles textbox click events.
|
|
void | GooeyTextbox_HandleKeyPress (GooeyWindow *win, GooeyEvent *event) |
| Handles key press events for the textbox.
|
|
const char * | GooeyTextbox_GetText (GooeyTextbox *textbox) |
| Gets the text of the textbox.
|
|
void | GooeyTextbox_SetText (GooeyTextbox *textbox, const char *text) |
| Sets the text of the textbox.
|
|
◆ GooeyTextBox_Add()
GooeyTextbox * GooeyTextBox_Add |
( |
GooeyWindow * |
win, |
|
|
int |
x, |
|
|
int |
y, |
|
|
int |
width, |
|
|
int |
height, |
|
|
char * |
placeholder, |
|
|
void(*)(char *text) |
onTextChanged |
|
) |
| |
Adds a textbox to the window.
- Parameters
-
win | The window to add the textbox to. |
x | The x-coordinate of the textbox's position. |
y | The y-coordinate of the textbox's position. |
width | The width of the textbox. |
height | The height of the textbox. |
placeholder | The placeholder text for the textbox. |
onTextChanged | The callback function to call when the text changes. |
- Returns
- A new GooeyTextbox object.
◆ GooeyTextbox_Draw()
void GooeyTextbox_Draw |
( |
GooeyWindow * |
win | ) |
|
Draws the textbox on the window.
- Parameters
-
win | The window to draw the textbox on. |
◆ GooeyTextbox_GetText()
const char * GooeyTextbox_GetText |
( |
GooeyTextbox * |
textbox | ) |
|
Gets the text of the textbox.
- Parameters
-
textbox | The textbox to retrieve text from. |
- Returns
- The current text of the textbox.
◆ GooeyTextbox_HandleClick()
bool GooeyTextbox_HandleClick |
( |
GooeyWindow * |
win, |
|
|
int |
x, |
|
|
int |
y |
|
) |
| |
Handles textbox click events.
- Parameters
-
win | The window containing the textbox. |
x | The x-coordinate of the click event. |
y | The y-coordinate of the click event. |
- Returns
- True if the textbox was clicked, false otherwise.
◆ GooeyTextbox_HandleKeyPress()
void GooeyTextbox_HandleKeyPress |
( |
GooeyWindow * |
win, |
|
|
GooeyEvent * |
event |
|
) |
| |
Handles key press events for the textbox.
- Parameters
-
win | The window containing the textbox. |
key_event | The key event to handle. |
◆ GooeyTextbox_SetText()
void GooeyTextbox_SetText |
( |
GooeyTextbox * |
textbox, |
|
|
const char * |
text |
|
) |
| |
Sets the text of the textbox.
- Parameters
-
textbox | The textbox to set the text for. |
text | The new text to set in the textbox. |