void demo_create(void)
{
lv_obj_t *scr = lv_disp_get_scr_act(NULL);
lv_obj_t * win=lv_win_create(scr,NULL);
lv_style_copy(&style_head,lv_win_get_style(win,LV_WIN_STYLE_HEADER));
style_head.body.main_color=LV_COLOR_WHITE;
style_head.body.grad_color=LV_COLOR_BLUE;
lv_win_set_style(win,LV_WIN_STYLE_HEADER,&style_head);
lv_win_set_title(win, "Hello Xiaohai");
lv_obj_t *closbtn=lv_win_add_btn(win, LV_SYMBOL_CLOSE);
lv_obj_set_event_cb(closbtn,lv_win_close_event_cb);
lv_obj_t *setBtn=lv_win_add_btn(win, LV_SYMBOL_SETTINGS);
lv_win_set_btn_size(win, 30);
lv_win_set_sb_mode(win, LV_SB_MODE_DRAG);
lv_win_set_layout(win, LV_LAYOUT_CENTER);
lv_win_set_drag(win, true);
lv_obj_t * txt = lv_label_create(win, NULL); lv_label_set_text(txt, "This is the content of the window\n\ You can add control buttons to the window header\n");
lv_obj_t * btn = lv_btn_create(win, NULL);
lv_obj_t *lab_btn=lv_label_create(btn,NULL);
lv_label_set_text(lab_btn,"btn");
lv_obj_t * btnm = lv_btnm_create(win, NULL);
}
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50