当前位置:网站首页>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
边栏推荐
- JS FAQs
- CSDN blog operation team 2022 H1 summary
- MySQL导出sql脚本文件
- My in-depth remote office experience | community essay solicitation
- Skill combing [email protected] control a dog's running on OLED
- 时间复杂度与空间复杂度
- 【STL源码剖析】容器(待补充)
- Retest the cloud native database performance: polardb is still the strongest, while tdsql-c and gaussdb have little change
- 前嗅ForeSpider教程:抽取数据
- Using LVM to resize partitions
猜你喜欢
[STL source code analysis] iterator
[email protected] intelligent instrument teaching aids based on 51 series single chip microcomputer"/>
Skill combing [email protected] intelligent instrument teaching aids based on 51 series single chip microcomputer
第一届中国数字藏品大会即将召开
Viewing technological changes through Huawei Corps (V): smart Park
sCrypt 中的 ECDSA 签名验证
pytorch 筆記 torch.nn.BatchNorm1d
[STL source code analysis] container (to be supplemented)
在IPhone12的推理延迟仅为1.6 ms!Snap等详析Transformer结构延迟,并用NAS搜出移动设备的高效网络结构...
Using LVM to resize partitions
Pytorch notes torch nn. BatchNorm1d
随机推荐
【深度学习】深度学习检测小目标常用方法
基于HAL库的按键(KEY)库函数
第一届中国数字藏品大会即将召开
Deep dive kotlin synergy (16): Channel
同事的接口文档我每次看着就头大,毛病多多。。。
From introduction to mastery of MySQL 50 lectures (32) -scylladb production environment cluster building
05_ Node JS file management module FS
Anhui "requirements for design depth of Hefei fabricated building construction drawing review" was printed and distributed; Hebei Hengshui city adjusts the pre-sale license standard for prefabricated
Kernel linked list (general linked list) "list.h" simple version and individual comments
Rejuvenated Dell and apple hit each other, and the two old PC enterprises declined rapidly
ArcGIS Pro scripting tool (6) -- repairing CAD layer data sources
js常见问题
Didi open source agile test case management platform!
前嗅ForeSpider教程:抽取数据
Pytorch Notebook. Nn. Batchnorm1d
Mysql database foundation: TCL transaction control language
LVGL 8.2 Drop down in four directions
Review of mathematical knowledge: curve integral of the second type
Machine learning interview preparation (I) KNN
Gd32 RT thread flash driver function