Message Box

Report on GitHub

Modal dialog created with lv_msgbox_create that displays a title, text, and action buttons.

A modal "Hello" dialog with Apply and Cancel footer buttons and a close icon.

lv_msgbox_create(NULL) opens a modal message box on the top layer. lv_msgbox_add_title sets the title to Hello, lv_msgbox_add_text writes the body, and lv_msgbox_add_close_button installs the header close icon. Two lv_msgbox_add_footer_button calls add Apply and Cancel, each wired to a shared LV_EVENT_CLICKED handler that logs which label was tapped.

Settings dialog with minimize button

A 300x200 non-modal settings panel with Brightness and Speed sliders.

A non-modal lv_msgbox on the active screen gets a header with title Setting, a close icon, and a minus header button whose LV_EVENT_CLICKED handler hides the panel with LV_OBJ_FLAG_HIDDEN. lv_msgbox_get_content is flipped to LV_FLEX_FLOW_COLUMN and holds two column containers that pair a label with a full-width lv_slider, preset to Brightness 50 and Speed 80. The footer adds flex-growing Apply and Cancel buttons tinted indigo.

Blurred message box over background

Toggle a blur radius between the screen backdrop and the message box itself.

A long Lorem ipsum lv_label fills 60% width behind a translucent lv_msgbox placed on lv_layer_top() with a black header and body at LV_OPA_40 and blur_backdrop enabled. A lv_dropdown offering Blur screen and Blur msgbox is anchored at (5, 5); its LV_EVENT_VALUE_CHANGED callback sets a blur radius of 24 on either lv_layer_top() or the message box. A synthetic event is sent to initialize the state.

How is this guide?

Last updated on

On this page