Widget color Toggle
Moderator: Martin
Widget color Toggle
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
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:
Regards,
Martin
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");
Martin