So I have been again trying to automate, I have succeeded with tag bindings and custom properties, but what I'm stuck on right now is adding event handlers via scripting.
But I'm not sure if it even is the correct way to add the handler, if the callable is in correct format or if I'm missing something.
One thing what I thought was adding "event" and "button" etc. params to the mouseReleased() signature, but again, I'm not very familiar with the structure.
Hmmm. I don't know if those are in the API. You have to set very specificly-named Swing component client properties with lists of objects that encapsulate the events. You might need to do some reflection research on the contents of various client props. Perhaps this topic:
Thank you. I have noticed this segment in the conversation that stood out.
As a side note, you can actually add python function objects themselves to Ignition windows using the putClientProperty which is sometimes useful
Maybe I will give it a go but there is not much documentation regarding this method, I've managed to find it in the introspect script output, so there might be a way.
And in Designer it does work, but if you close and reopen the designer it removes the handler and if you launch the project inside the designer it doesn't work.
I suspect there is some another core function inside the component or maybe the window that I don't know of, I didn't find anything more related to mouseReleased in introspect.
Edit: Maybe I need to place the method to mouseListeners property on the component?
Edit 2: Okay so I went through the XML and found the difference, what I'm missing is basically the whole Interaction Controller, which as I understand is a big deal. Can I work with that in scripting?