Checkbox

Report on GitHub

Checkbox states stacked vertically

Four labelled checkboxes covering default, checked, disabled, and multi-line variants.

The active screen uses LV_FLEX_FLOW_COLUMN with start alignment and holds four checkboxes: Apple in the default state, Banana with LV_STATE_CHECKED, Lemon with LV_STATE_DISABLED, and Melon\nand a new line with both checked and disabled states and a two-line label. A shared LV_EVENT_ALL callback logs the checkbox text and its current checked state on LV_EVENT_VALUE_CHANGED.

Checkboxes as radio buttons

A group of five checkboxes where only one can be checked at a time.

A centered flex-column container holds five checkboxes labelled Radio button 1 through Radio button 5. Each one calls lv_obj_set_radio_button(obj, true) so checking one clears the others, and two LV_PART_INDICATOR styles round the indicator with LV_RADIUS_CIRCLE and clear the default checkmark image in LV_STATE_CHECKED. Each checkbox logs its label and selection state on LV_EVENT_VALUE_CHANGED.

How is this guide?

Last updated on

On this page