Change colour of text in widget according global variable

Post your questions and help other users.

Moderator: Martin

Post Reply
User avatar
Bushmills
Posts: 286
Joined: 23 Sep 2014 21:56

Change colour of text in widget according global variable

Post by Bushmills » 25 Oct 2014 09:03

I don't manage to change the colour of text in a user defined widget other than statically selecting the colour. What I try to achieve is a widget, showing specific text in one or another colour, depending on state of a variable.
I tried putting a variable between curly braces as colour, and a script fragment consisting of a conditional, switching between colors. Either approach works with widget text, but not with colour. Therefore I currently use displaying capitalized or lowercase text as workaround, but I rather have different colours.

edit: I just found setWidgetElementProperty, seems to be the right tool for the task

edit2: Aktion mit Script in der Art von

setWidgetElementProperty("mywidget", "Text_1", "fillcolor", "#ff00ff00")

macht genau das Gewünschte.

Post Reply