Change button´s properties from script library

If you want to do something like “programmatically alter all buttons the same way”, then I would suggest making a project library function that expects a particular component as the input. E.G:

Project Library Script - utils

def setColors(button):
    button.background = system.gui.color(251, 250, 249)

Component Event Script

utils.setColors(event.source.parent.getComponent('Button'))

The crucial part is that you pass the component itself as a reference into your project script.

2 Likes