Upgrade version makes buttons dissapear (possible bug?)

For anyone finding/being linked to this thread in the future; if you want a ‘middle ground’ solution between a global UI manager key and setting every button up with scripting, you could use a technique like this to recursively modify every button in the window (e.g. in visionWindowOpened):

from javax.swing import AbstractButton
from com.inductiveautomation.ignition.client.IgnitionLookAndFeel import setBlendMode
from de.javasoft.plaf.synthetica.util.Synthetica2DUtils import BlendMode

def getComponents(window):
	def walkComponents(component):
		for component in component.components:
			yield component
			walkComponents(component)
	
	return walkComponents(window.rootContainer)
	
isButton = lambda component: isinstance(component, AbstractButton)

def updateBlendMode(component, blendMode):
	setBlendMode(component, blendMode)
	component.repaint()

In use:

win = system.gui.getWindow("buttons")
for button in filter(isButton, getComponents(win)):
	updateBlendMode(button, BlendMode.ALPHA)
2 Likes