label attributes

  • Hi,
    I'm a new user, I bought a 7025 and I'm having fun in making simple python programs.


    Recently,I would like to change some attributes of a Label within python code, but I didn't succeed....
    Here's my code:



    All works, but the "setBackgroundColor" generate a blue screen....maybe this is not the right way to do it....


    How can I set background color for the label from python code?


    If I put:
    backgroundColor="#33000000"
    directly into the skin definition, it works, and actually changes the background of the label to black.


    But how to do it dinamically from python code?
    Should I address the Widget instead of the Label?
    How to do it?


    Thank you very much in advance for any help!
    Best Regards
    Mike

    Einmal editiert, zuletzt von bbox ()

  • sorry, i somehow missed this.


    you can use self["mylabel"].instance.setBackgroundColor, but this is only available after the skin has been shown (for example after onShow, or onLayoutFinish). You need to add a callback to do this late enough.