How to get the SDL example working on Linux? #450
-
I have built the unix version (fee49e2) (on Debian Testing) following the instructions in the readme.
When running the sample code from the readme: https://github.com/lvgl-micropython/lvgl_micropython?tab=readme-ov-file#python-code-examples I see a window flash onto the screen and then disappear. There are no errors reported. If I add:
The window stays but nothing is drawn in it. How can I get this working? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
add the code to a python source file and put that file into the same folder as the binary. Run the binary without passing the filename. When the repl comes up import the python source file. |
Beta Was this translation helpful? Give feedback.
-
In my
after the lvgl init code I call ... in case others find this useful. |
Beta Was this translation helpful? Give feedback.
In order to make it all work properly you need to add a loop at the end of the file you are passing when executing the binary.
That needs to be added because of how micropython is written. when running the binary without passing a filename the repl loads and it will loop. during hat loop it check to see if there are any scheduled tasks that need to run in the main thread. This is an important piece because a task gets scheduled to run in order for LVGL to update. when passing in a file name the repl is bypassed so no loop occurs. Now you simply cannot add a loop at the end of the file you want to run because n…