File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed
internal_filesystem/apps/com.example.helloworld/assets Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change 1- # START OF COPY-PASTE FROM https://sim.lvgl.io/v9.0/micropython/ports/webassembly/
1+ import mpos . ui
22
3- # Initialize
3+ def button_click (e ):
4+ print ("Button clicked!" )
45
5- import display_driver # not needed, but included because the LVGL simulator does it
6- import lvgl as lv
6+ scr = lv .obj ()
77
88# Create a button with a label
9-
10- scr = lv .obj ()
119btn = lv .button (scr )
1210btn .align (lv .ALIGN .CENTER , 0 , 0 )
11+ #btn.set_size(lv.pct(100),lv.pct(100))
12+ btn .add_event_cb (button_click ,lv .EVENT .CLICKED ,None )
1313label = lv .label (btn )
1414label .set_text ('Hello World!' )
15- lv .screen_load (scr )
1615
17- # END OF COPY-PASTE FROM https://sim.lvgl.io/v9.0/micropython/ports/webassembly/
16+ mpos . ui . load_screen ( scr )
1817
1918# Optional janitor that cleans up when the app is backgrounded:
2019def janitor_cb (timer ):
You can’t perform that action at this time.
0 commit comments