setlabel() messes up the textcolor?
#1
Hi.

My goal is to optimise my skin and the speed. I got rid of at least skin.strings and the build-in super-heavy lists.

Now I wanted to get rid of as many "window.home.properties" as possible, as it is obviously faster to set the values directly to the controls.
Sadly it messes up stuff..

This is seen on a button, but I suspect it fails all around:

If I use the .setlabel() to update the text on a button the textcolor no longer updates to reflect the property! (as set in the XML, to use the $INFO to get at the property)

This is pretty bad.

XML:
Code:
<control type="button" id="40011">
<!--    <label>$INFO[Window(Home).Property(someName)]</label>-->
    <label>x</label>
    <textcolor>$INFO[Window(Home).Property(someColor)]</textcolor>
</control>

Python:
Code:
    WINDOW.getControl(40011).setLabel('blah')

IF I want to change the color but keep the label, or the other way around, what should I do?

I supect getting the label and/or color from the control is out of the question? And setting BOTH seems plain stupid and would probably be even slower than using properties...

EDIT: The setLabel() seems to work without messing up the color on a labelcontrol.. which is something.. sadly that is not really a button.
Reply

Logout Mark Read Team Forum Stats Members Help
setlabel() messes up the textcolor?0