The Button Gui-Element is a clickable, rectangular box with a label inside. When it is pressed and released you will be notified via the provided callback.
Use this value instead of x2, y2 in the BUTTON_STRUCT to autocalculate the button width/height.
| typedef void(* BUTTON_CALLBACK) (void *button) |
Prototype for Event Listeners (called when the button is pressed)
- 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
-
| button | The pointer to the BUTTON_STRUCT where to corresponding Button was pressed |
Adds a button. Your Callback will be called from now on, if the button was pressed
- Parameters
-
- Returns
- true on success
Redraws the button. Call this method if you have to redraw the entire screen or if you want to draw a button on top of an image.
- Parameters
-
Removes the button. You will no longer receive events for this button. This function will not overdraw the region where the button was located.
- Parameters
-