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:
Python
class MyWindow(Screen):
skin = """
<screen position="200,280" size="320,220" title="MyScreen" >
<widget name="mylabel" position="10,80" size="300,30" valign="top" halign="center" zPosition="2" font="Regular;24" transparent="1" foregroundColor="white" />
</screen>"""
def __init__(self, session, args = None):
Screen.__init__(self, session)
self.skin_path = plugin_path
self["mylabel"] = Label()
self["mylabel"].setText("Hello")
self["mylabel"].setBackgroundColor(0x33000000)
Alles anzeigen
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