当前位置:网站首页>LVGL 8.2 Message box
LVGL 8.2 Message box
2022-07-25 04:17:00 【Fairy sword love】
Event handler
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));
}
establish message box
static 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);
}
Running effect

Modify the content and title in the event handler function
static void event_cb(lv_event_t* e)
{
lv_obj_t* obj = lv_event_get_current_target(e);
uint16_t index = lv_msgbox_get_active_btn(obj);
LV_LOG_USER("Button %s clicked %d", lv_msgbox_get_active_btn_text(obj),index);
if (index == 0) {
lv_obj_t* txt = lv_msgbox_get_text(obj);
lv_label_set_text(txt, "123");
}
else {
lv_obj_t* title = lv_msgbox_get_title(obj);
lv_label_set_text(title, "456");
}
}
Running effect

边栏推荐
- High temperature in Britain: two airport runways were burnt out, and several railways were restricted to ensure safety
- Max matrix and JS
- Servlet personal practice notes (I)
- [interview must brush 101] greedy algorithm, simulation, string
- Chapter 3 business function development (modify the remarks of market activities)
- Huawei od maximum consumption JS
- Press the switch for the minimum number of times to turn on all lights
- C language: string processing function
- DNS resolution experiment
- Homologous strategy, surface longitude
猜你喜欢

Xrrunner, a domestic performance testing tool for palm smart, officially unveiled qecon

Behind Senma's LP, "Wenzhou Department" is running into the venture capital circle
![[laser principle and application -5]: laser diode LD (laser diode) and laser diode driver (LD driver)](/img/1f/4e8ea92a93ed16d8e7944d4a5d22c9.png)
[laser principle and application -5]: laser diode LD (laser diode) and laser diode driver (LD driver)

Properties of trees

Localization distillation for dense object detection cvpr2022

After the failure of listing in Hong Kong, tuba rabbit terminated its gem IPO, and the founder responded

Visual studio 2019 installation and uninstallation problems

Yuntu says digital asset chain: your God of digital asset property protection

Definition and basic terms of tree

The LAF protocol elephant of defi 2.0 may be one of the few profit-making means in your bear market
随机推荐
How to cancel and exit revision mode for word
Original | ueditor1.4.3-asmx bypasses WAF
Debezium series: Show slave status view the possible different situations of master-slave delay
How should enterprise users choose aiops or APM?
Serial adder / subtracter
[understanding of opportunity-47]: Guiguzi - Chapter 11 - decision makers, moderation, and rational distribution of interests
EMQ Yingyun technology was successfully selected into the 2022 "cutting edge 100" list of Chinese entrepreneurs
DNS resolution experiment
ADS1256 debugging notes based on stm32hal Library
Cluster clock synchronization configuration
Maker concept design to adapt to popular education
Current characteristics of steering gear with great resistance
Tiktok live broadcast brings goods to help the industry go to sea, and Fastdata observation industry boutique salon helps the ecological development
[matlab] solve the mex error there was a problem creating the mex file for real time execution, please ensure y
Traditional architecture of enterprise digital transformation to medium platform micro service architecture
01_ Education 3
Es- retrieve the selected field from the search
After the failure of listing in Hong Kong, tuba rabbit terminated its gem IPO, and the founder responded
Servlet个人实操笔记(一)
基于ABP实现DDD--领域逻辑和应用逻辑