File tree Expand file tree Collapse file tree 1 file changed +19
-7
lines changed
internal_filesystem/apps/com.example.helloworld/assets Expand file tree Collapse file tree 1 file changed +19
-7
lines changed Original file line number Diff line number Diff line change 1- import time
2- myscreen = lv .screen_active ()
1+ # START OF COPY-PASTE FROM https://sim.lvgl.io/v9.0/micropython/ports/webassembly/
32
4- print ( "Hello World running!" )
3+ # Initialize
54
6- label = lv . label ( myscreen )
7- label . set_text ( "Hello World!" )
5+ import display_driver
6+ import lvgl as lv
87
9- while lv .screen_active () == myscreen
10- time .sleep_ms (100 )
8+ # Create a button with a label
9+
10+ scr = lv .obj ()
11+ btn = lv .button (scr )
12+ btn .align (lv .ALIGN .CENTER , 0 , 0 )
13+ label = lv .label (btn )
14+ label .set_text ('Hello World!' )
15+ lv .screen_load (scr )
1116
17+ # END OF COPY-PASTE FROM https://sim.lvgl.io/v9.0/micropython/ports/webassembly/
18+
19+ # Added: wait until the user navigates away instead of stopping immediately.
20+ while lv .screen_active () == scr :
21+ import time
22+ time .sleep_ms (100 )
23+ print ("User navigated away from the HelloWorld app. Bye bye!" )
You can’t perform that action at this time.
0 commit comments