I am working on some micropython based GUI design and I have come accross some very strange peculiarities with unexpected behaviour.
I have tested using the unix port of lv_micropython as well as the online simulator
I am trying to use the width of an object to set the size of another, however whenever I try to get the width of an object I get a size of 0. The only exception to this appears to be for the base lv.obj() with no parent which is showing the full screen width.
This can be seen by toggling commenting on lines 21/22 to show the set width works, and by toggling commenting on lines 152/153 to change the parent object.
- align vs align_to
I have two sub objects in my scr object (which is a child of another base lv.obj()). If I align the first object using top_bar.align(), the second object disappears. If, however, I use top_bar.align_to() the second object now appears. The two objects shouls be in no way linked. This effect can be tested by toggling commenting on lines 23/24.
Full code to reproduce can be found on the simulator here: LVGL/MicroPython Simulator