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):
    l=obj.get_child(0)           #  <=====   Erreur de segmentation (core dumped) 
scr = lv.scr_act()

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

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:


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