App:Library:LVGL:Readme:Examples

提供: robot-jp wiki
2022年6月20日 (月) 22:24時点におけるTakashi (トーク | 投稿記録)による版 (→‎Examples)
ナビゲーションに移動検索に移動

https://github.com/lvgl/lvgl#examples

Examples

英文 自動翻訳
For more examples see the examples folder. その他の例については、 examplesフォルダーを参照してください。
LVGL Readme btn example.png

 1lv_obj_t * btn = lv_btn_create(lv_scr_act());                   /*Add a button to the current screen*/
 2lv_obj_set_pos(btn, 10, 10);                                    /*Set its position*/
 3lv_obj_set_size(btn, 100, 50);                                  /*Set its size*/
 4lv_obj_add_event_cb(btn, btn_event_cb, LV_EVENT_CLICKED, NULL); /*Assign a callback to the button*/
 5
 6lv_obj_t * label = lv_label_create(btn);                        /*Add a label to the button*/
 7lv_label_set_text(label, "Button");                             /*Set the labels text*/
 8lv_obj_center(label);                                           /*Align the label to the center*/
 9...
10
11void btn_event_cb(lv_event_t * e)
12{
13  printf("Clicked\n");
14}
15
16
17
戻る : Previous