The Checkbox Gui-Element is a clickable, rectangular box with an optional tickmark inside of it. When the checkbox is pressed and released it's tick state changes and you will be notified via the provided callback.
| #define CHECKBOX_WIN_FG_COLOR RGB(32,161,34) |
| typedef void(* CHECKBOX_CALLBACK) (void *checkbox, bool checked) |
Prototype for Event Listeners (called when the checkbox state has changed)
- Note
- You should NOT execute long running things in this callback nor should you update the gui. But you can call gui_screen_navigate() for instance.
- Parameters
-
| checkbox | The pointer to the CHECKBOX_STRUCT where to corresponding Checkbox has changed the state |
| checked | A boolean which indicates whether the checkbox is now checked or not. |
Adds a checkbox. Your Callback will be called from now on, if the checkbox changes state
- Parameters
-
- Returns
- true on success
Redraws the checkbox. Call this method if you have to redraw the entire screen or if you want to draw a checkbox on top of an image.
- Parameters
-
Removes the checkbox. You will no longer receive events for this checkbox. This function will not overdraw the region where the checkbox was located.
- Parameters
-
Updates the checkbox. Call this function when you change the state of the checkbox through code.
- Parameters
-