Button (lv_btn)¶

內容

Buttons have no new features compared to the Base object. They are useful for semantic purposes and have slightly different default settings.

Buttons, by default, differ from Base object in the following ways:

  • Not scrollable
  • Added to the default group
  • Default height and width set to LV_SIZE_CONTENT
  • LV_PART_MAIN The background of the button. Uses the typical background style properties.

There are no new features compared to Base object.

  • LV_EVENT_VALUE_CHANGED when the LV_OBJ_FLAG_CHECKABLE flag is enabled and the object is clicked. The event happens on transition to/from the checked state.

Learn more about Events.

Note that the state of LV_KEY_ENTER is translated to LV_EVENT_PRESSED/PRESSING/RELEASED etc.

See the events of the Base object too.

Learn more about Keys.

警告

doxygenfile: Unable to find project ‘lvgl’ in breathe_projects dictionary

© 版权所有 2021, LVGL Kft. Revision e12ff00e. 最后更新于 2022 年 01 月 05 日.

利用 Sphinx 构建,使用了 主题Read the Docs开发.

總結
Buttons in LVGL have no new features compared to the Base object, but they are useful for semantic purposes and have slightly different default settings. By default, buttons are not scrollable, added to the default group, and have default height and width set to LV_SIZE_CONTENT. The background of the button is represented by LV_PART_MAIN, using typical background style properties. When the LV_OBJ_FLAG_CHECKABLE flag is enabled and the button is clicked, the LV_EVENT_VALUE_CHANGED event occurs during the transition to/from the checked state. The state of LV_KEY_ENTER is translated to LV_EVENT_PRESSED/PRESSING/RELEASED. For more information on events and keys, refer to the Base object documentation. This information is based on the LVGL documentation, last updated on January 5, 2022.