#include "core/gooey_backend_internal.h"
#include "gooey_widgets_internal.h"
Go to the source code of this file.
|
GooeyDropdown * | GooeyDropdown_Add (GooeyWindow *win, 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 window.
|
|
bool | GooeyDropdown_HandleClick (GooeyWindow *win, int x, int y) |
| Handles dropdown menu click events.
|
|
void | GooeyDropdown_Draw (GooeyWindow *win) |
| Draws the drop down menu on the window.
|
|
◆ GooeyDropdown_Add()
GooeyDropdown * GooeyDropdown_Add |
( |
GooeyWindow * |
win, |
|
|
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 window.
- Parameters
-
win | The window to add the dropdown menu to. |
x | The x-coordinate of the dropdown's position. |
y | The y-coordinate of the dropdown's position. |
width | The width of the dropdown menu. |
height | The height of the dropdown menu. |
options | The list of options for the dropdown menu. |
num_options | The number of options. |
callback | The callback function to call when an option is selected. |
- Returns
- A new GooeyDropdown object.
◆ GooeyDropdown_Draw()
void GooeyDropdown_Draw |
( |
GooeyWindow * |
win | ) |
|
Draws the drop down menu on the window.
- Parameters
-
win | The window to draw the drop down menu. |
◆ GooeyDropdown_HandleClick()
bool GooeyDropdown_HandleClick |
( |
GooeyWindow * |
win, |
|
|
int |
x, |
|
|
int |
y |
|
) |
| |
Handles dropdown menu click events.
- Parameters
-
win | The wi>ndow containing the dropdown menu. |
x | The x-coordinate of the click event. |
y | The y-coordinate of the click event. |
- Returns
- True if the dropdown menu was clicked, false otherwise.