Description
How can I style each of the children in the msgbox?
What MCU/Processor/Board and compiler are you using?
STM32F767IIT
What LVGL version are you using?
7.10.1
What do you want to achieve?
- Can the size or color of the symbol be different from the text?
- Can the font or color of the first line be different from other lines?
- Can I specify a different size or color for the button?
What have you tried so far?
Code to reproduce
Add a code snippet which can run in the simulator. It should contain only the relevant code that compiles without errors when separated from your main code base.
The code block(s) should be formatted like:
static lv_style_t style_msgbox;
lv_style_init(&style_msgbox);
lv_style_set_text_font(&style_msgbox, LV_STATE_DEFAULT, &lv_font_montserrat_20);
lv_style_set_text_color(&style_msgbox, LV_STATE_DEFAULT, LV_COLOR_BLACK);
lv_style_set_bg_color(&style_msgbox, LV_STATE_DEFAULT, LV_COLOR_YELLOW);
lv_style_set_
//lv_style_set_size(style, state, value)
static const char * btns[] = {"Close", ""};
lv_obj_t * mbox1 = lv_msgbox_create(lv_scr_act(), NULL);
lv_obj_set_event_cb(mbox1, event_handler);
lv_msgbox_set_text(mbox1, LV_SYMBOL_WARNING " Setting value input error\n"
"There is no value. Please enter a value." );
lv_msgbox_add_btns(mbox1, btns);
lv_obj_align(mbox1, NULL, LV_ALIGN_CENTER, 0, 0);
lv_obj_add_style(mbox1, LV_MSGBOX_PART_BG, &style_msgbox);