Page 1 of 1
Widget color Toggle
Posted: 25 Sep 2014 10:18
by kvelez
Stumped on how Martin gets the rectangle color to change based on a Boolean value set by a widget. I am trying to create a similar one. Any ideas?
Re: Widget color Toggle
Posted: 25 Sep 2014 13:52
by Martin
Hi,
You could create a custom widget with a rectangle and change the color from a script using the function
setWidgetElementProperty. Please use the button
Function in the script action to insert the function since it will show a dialog that helps to select the widget, the element, the property and the color. You can use an
if in the script to check a boolean variable and to set a different color. Something like this should work:
Code: Select all
flag = true;//resp. false
setWidgetElementProperty("Widget X", "Rectangle_X", "fillcolor", if (flag) "#ffff0000" else "#ff00ff00");
Regards,
Martin