mirror of
https://gitee.com/Vancouver2017/luban-lite-t3e-pro.git
synced 2025-12-17 20:08:54 +00:00
v1.0.3
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
|
||||
Simple Message box
|
||||
"""""""""""""""""""
|
||||
|
||||
.. lv_example:: widgets/msgbox/lv_example_msgbox_1
|
||||
:language: c
|
||||
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
#include "../../lv_examples.h"
|
||||
#if LV_USE_MSGBOX && LV_BUILD_EXAMPLES
|
||||
|
||||
static void event_cb(lv_event_t * e)
|
||||
{
|
||||
lv_obj_t * obj = lv_event_get_current_target(e);
|
||||
LV_LOG_USER("Button %s clicked", lv_msgbox_get_active_btn_text(obj));
|
||||
}
|
||||
|
||||
void lv_example_msgbox_1(void)
|
||||
{
|
||||
static const char * btns[] = {"Apply", "Close", ""};
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,10 @@
|
||||
def event_cb(e):
|
||||
mbox = e.get_current_target()
|
||||
print("Button %s clicked" % mbox.get_active_btn_text())
|
||||
|
||||
btns = ["Apply", "Close", ""]
|
||||
|
||||
mbox1 = lv.msgbox(lv.scr_act(), "Hello", "This is a message box with two buttons.", btns, True)
|
||||
mbox1.add_event_cb(event_cb, lv.EVENT.VALUE_CHANGED, None)
|
||||
mbox1.center()
|
||||
|
||||
Reference in New Issue
Block a user