Get the text of label of button : KO (core dumped) unix port lvgl 7.10

Bonjour ,
i wish get the text of label of button (i will have many buttons)
with this simple code :

import intro_esp_linux as intro
from uasyncio import sleep, create_task, Loop, CancelledError
import lvgl as lv
def trt(obj,e):
    print(obj)
    l=obj.get_child(0)           #  <=====   Erreur de segmentation (core dumped) 
    print(type(l))
scr = lv.scr_act()
btn=lv.btn(scr,None)
btn.set_size(40,40)
lbl=lv.label(btn,None)
lbl.set_text('toto')
btn.set_event_cb(trt)
Loop.run_forever()

bad code or firmware issue ?
how to debug ?
Thanks for help
Regards

Hi @picpic020960,

First, I strongly recommend you try LVGL v8 (latest).
It has better Micropython integration, more examples, many bugs were fixed, new features, clearer API etc.

On v7 the get_child API is a bit weird - it expects an object as its argument.
To get the first child you pass None, to get the second child you pass the first child etc.

So to get the label, try something like this:

l=obj.get_child(None)

Thanks amirgon
I will tried.
but stay in v7 for the moment
(build is not easy … maybe a firmware.bin as service)

Which port? (esp32, stm32, etc), Which board? (with/without spi-ram) Which esp-idf version? Which color mode?
There are too many options and combinations. One firmware binary does not fit everyone. Maintaining a matrix of all combination is not scalable and a lot of effort.

But if you have difficulties building the firmware please open a topic in the forum. We can also improve the docs if you think something is missing there.

I need courage but can find it
the trick works fine, thanks