Button (lv_button)
Buttons have no new features compared to the base widget. They are useful for semantic purposes and have slightly different default settings.
Overview
Buttons have no new features compared to the base widget. They are useful for semantic purposes and have slightly different default settings.
Buttons, by default, differ from the Base Widget in the following ways:
- Not scrollable
- Added to the default group
- Default height and width set to
LV_SIZE_CONTENT
Parts and Styles
LV_PART_MAINThe background of the button; uses the typical background style properties.
Usage
There are no new features compared to Base Widget.
Events
LV_EVENT_VALUE_CHANGEDwhen theLV_OBJ_FLAG_CHECKABLEflag is enabled and the Widget is clicked. The event happens on transition to/from the checked state.
Keys
Note that the state of LV_KEY_ENTER is translated to
LV_EVENT_PRESSED, LV_EVENT_PRESSING
and LV_EVENT_RELEASED etc.
Further Reading
Learn more about Keys.
Examples
Simple Buttons
Styling buttons
Gummy button
API
How is this guide?
Last updated on
Bar (lv_bar)
The Bar Widget has a background and an indicator. The length of the indicator against the background indicates the Bar's current value.
Button Matrix (lv_buttonmatrix)
The Button Matrix Widget is a lightweight way to display multiple Buttons in rows and columns --- lightweight because the buttons are not actually created but just virtually drawn on the fly. With ...