小忍者项目相关文件上传

This commit is contained in:
lij
2024-02-05 16:51:37 +08:00
commit 48911e3125
1039 changed files with 2266093 additions and 0 deletions

View File

@ -0,0 +1,13 @@
C
^
Simple window
"""""""""""""""
.. lv_example:: widgets/win/lv_example_win_1
:language: c
MicroPython
^^^^^^^^^^^
No examples yet.

View File

@ -0,0 +1,45 @@
#include "../../lv_examples.h"
#if LV_USE_WIN && LV_BUILD_EXAMPLES
static void event_handler(lv_event_t * e)
{
lv_obj_t * obj = lv_event_get_target(e);
LV_LOG_USER("Button %d clicked", lv_obj_get_child_id(obj));
}
void lv_example_win_1(void)
{
lv_obj_t * win = lv_win_create(lv_scr_act(), 40);
lv_obj_t * btn;
btn = lv_win_add_btn(win, LV_SYMBOL_LEFT, 40);
lv_obj_add_event_cb(btn, event_handler, LV_EVENT_CLICKED, NULL);
lv_win_add_title(win, "A title");
btn = lv_win_add_btn(win, LV_SYMBOL_RIGHT, 40);
lv_obj_add_event_cb(btn, event_handler, LV_EVENT_CLICKED, NULL);
btn = lv_win_add_btn(win, LV_SYMBOL_CLOSE, 60);
lv_obj_add_event_cb(btn, event_handler, LV_EVENT_CLICKED, NULL);
lv_obj_t * cont = lv_win_get_content(win); /*Content can be aded here*/
lv_obj_t * label = lv_label_create(cont);
lv_label_set_text(label, "This is\n"
"a pretty\n"
"long text\n"
"to see how\n"
"the window\n"
"becomes\n"
"scrollable.\n"
"\n"
"\n"
"Some more\n"
"text to be\n"
"sure it\n"
"overflows. :)");
}
#endif