当前位置:网站首页>LVGL 8.2 Simple Drop down list
LVGL 8.2 Simple Drop down list
2022-06-30 10:53:00 【Fairy sword love】
Event handling callback function
static void event_handler(lv_event_t* e)
{
lv_event_code_t code = lv_event_get_code(e); // Get the event code generated by the object
lv_obj_t* obj = lv_event_get_target(e); // Get the object that generated the event
if (code == LV_EVENT_VALUE_CHANGED) {
// Process value changed event
char buf[32];
lv_dropdown_get_selected_str(obj, buf, sizeof(buf)); // Get the text content of the selected object
LV_LOG_USER("Option: %s", buf); // Print text content
}
}
establish dropdown
static void lv_example_dropdown_1(void)
{
/*Create a normal drop down list*/
lv_obj_t* dd = lv_dropdown_create(lv_scr_act()); // establish dropdown object
lv_dropdown_set_options(dd, "Apple\n"
"Banana\n"
"Orange\n"
"Cherry\n"
"Grape\n"
"Raspberry\n"
"Melon\n"
"Orange\n"
"Lemon\n"
"Nuts"); // Set drop-down list option content
lv_obj_align(dd, LV_ALIGN_TOP_MID, 0, 20); //LV_ALIGN_TOP_MID Alignment
lv_obj_add_event_cb(dd, event_handler, LV_EVENT_ALL, NULL); // Add all events
}
Running effect

边栏推荐
- pytorch 筆記 torch.nn.BatchNorm1d
- TypeScript–es5中的类,继承,静态方法
- 程序员需知的 59 个网站
- 基于HAL库的按键(KEY)库函数
- About Library (function library), dynamic library and static library
- go-zero微服务实战系列(八、如何处理每秒上万次的下单请求)
- Mysql database foundation: constraint and identification columns
- Use keil5 software to simulate and debug gd32f305 from 0
- Collectors.toMap应用
- June training (day 30) - topology sorting
猜你喜欢

Remember the experience of an internship. It is necessary to go to the pit (I)

DQN笔记

The latest SCI impact factor release: the highest score of domestic journals is 46! Netizen: I understand if

再测云原生数据库性能:PolarDB依旧最强,TDSQL-C、GaussDB变化不大

Auto SEG loss: automatic loss function design
[email protected]+ Alibaba cloud +nbiot+dht11+bh1750+ soil moisture sensor +oled"/>Skill sorting [email protected]+ Alibaba cloud +nbiot+dht11+bh1750+ soil moisture sensor +oled

第一届中国数字藏品大会即将召开

Use keil5 software to simulate and debug gd32f305 from 0

Machine learning interview preparation (I) KNN

Rejuvenated Dell and apple hit each other, and the two old PC enterprises declined rapidly
随机推荐
我的远程办公深度体验 | 社区征文
Review of mathematical knowledge: curve integral of the second type
LVGL 8.2 Checkboxes as radio buttons
腾讯云数据库工程师能力认证重磅推出,各界共话人才培养难题
Dow Jones Industrial Average
程序员需知的 59 个网站
Skill sorting [email protected]+adxl345+ Motor vibration + serial port output
About Library (function library), dynamic library and static library
scratch绘制正方形 电子学会图形化编程scratch等级考试二级真题和答案解析2022年6月
在 sCrypt 中实现高效的椭圆曲线点加法和乘法
Skill combing [email protected] intelligent instrument teaching aids based on 51 series single chip microcomputer
List introduction
【深度学习】深度学习检测小目标常用方法
[rust weekly database] num bigint - large integer
运动App如何实现端侧后台保活,让运动记录更完整?
The performance of arm's new CPU has been improved by 22%, up to 12 cores can be combined, and the GPU is first equipped with hardware optical tracking. Netizen: the gap with apple is growing
Ionic4 drag the ion reorder group component to change the item order
20万奖金池!【阿里安全 × ICDM 2022】大规模电商图上的风险商品检测赛火热报名中!...
微信推出图片大爆炸功能;苹果自研 5G 芯片或已失败;微软解决导致 Edge 停止响应的 bug|极客头条...
Kernel linked list (general linked list) "list.h" simple version and individual comments