feat(msgbox) add parent attribute to lv_msgbox_create()

It keeps the consistency of create functions and allows craeting non-modal message boxes
This commit is contained in:
Gabor Kiss-Vamosi
2021-04-26 12:15:55 +02:00
parent d4deb28663
commit da39d692dd
3 changed files with 23 additions and 17 deletions

View File

@@ -3,7 +3,7 @@
static void event_cb(lv_event_t * e)
{
lv_obj_t * obj = lv_event_get_target(e);
lv_obj_t * obj = lv_event_get_current_target(e);
LV_LOG_USER("Button %s clicked", lv_msgbox_get_active_btn_text(obj));
}
@@ -11,7 +11,7 @@ void lv_example_msgbox_1(void)
{
static const char * btns[] ={"Apply", "Close", ""};
lv_obj_t * mbox1 = lv_msgbox_create("Hello", "This is a message box with two buttons.", btns, true);
lv_obj_t * mbox1 = lv_msgbox_create(NULL, "Hello", "This is a message box with two buttons.", btns, true);
lv_obj_add_event_cb(mbox1, event_cb, LV_EVENT_VALUE_CHANGED, NULL);
lv_obj_center(mbox1);
}