Button
createButton
Note
The handleEvents() function must be implemented for the Button CallBack function to work.
-
Use: To create a Button element
-
Definition:
createButton(String button_text, long font_size, long x, long y, long w, long h, int border_radius, uint32_t text_color, uint32_t bg_color, void (*onclick_callBack)(), String id) -
Parameters:
- String button_text : The text to be displayed on the Button as a String
- long font_size : The font size of the text in
px - long x : The position of the Text from its top-left corner along x-axis (horizontal) of the screen in
px - long y : The position of the Text from its top-left corner along y-axis (vertical) of the screen in
px - long w : The width of the Button in
px - long h : The height of the Button in
px - long border_radius : The border radius of the Button in
px - uint32_t text_color : The color of the text on the Button ( you can use the color() function to apply RGB values directly )
- uint32_t bg_color : The background color of the Button ( you can use the color() function to apply RGB values directly )
- void onclick_callBack() : The CallBack function to be executed when the Button is Clicked (*Accepts only void functions)
- String id : ID of the Button element as a String
-
Returns: ID of the Button element as a String
updateButtonText
-
Use: To update/change the text of a pre-created Button element
-
Definition:
updateButtonText(String id, String value) -
Parameters:
- String id : The ID of the pre-created Button element
- String value : The new value of the text as a String
-
Returns: Nothing