The use case is a little complicated, and very task-specific:
app is constantly listening for incoming messages
manipulating controls in the view sends outgoing messages
some incoming messages will try to set the value of a control being manipulated
this leads to "fighting" between the user and the system
knowing which control or controls are being interacted with, we can filter the incoming messages so they don't attempt to set controls actively being manipulated, effectively "debouncing" the signal
I like the idea of a transparent layer...but I wanted to be more specific about what I considered "manipulating" the control...with this, I can say exactly what I consider to be user interaction for these purposes.
Anyway, I am using the sender argument coming from the addTarget_action_forControlEvents() call, which is how I'm keying which controls are marked active. For my purposes it is working.Unfortunately, it seems like the various Pythonista-wrapped UIControls have different ways, or sometimes no way, of getting access to the actual UIControl instance they wrap, which makes it a little complicated to call the addTarget_ objectiveC method to install the monitor.
@JonB , after a long afternoon of trying understand the side effects I was creating, I have decided to go a different way. It gets worse when trying to add functionality to the class, which is the main intent. I am not giving up. I just dont think its a viable solution. I know you did it in a limited context.
I have thought of another way with just some wrapper functions. I am pretty sure i will be able to achieve almost all I wanted to do with a fraction of the code and side effects. Let's see 😱😳👍