Yes, so I'm suggesting moving some of that code into the widget. So, something like:
class Simple(object):
def __setattr__(self, atr, val):
if atr.startswith("on_"):
val = lambda: val(self)
object.__setattr__(self, atr, val)
That should work in making sure callbacks get the widget passed in. Then something slightly more complex might be needed to get the EventSlot thing working in a similar way.
This means in your 'helloworldeventcallback.py' experiment, you would receive the widget as an argument in new() with no code change, solving the issue of not being able to access event properties.
Yes, so I'm suggesting moving some of that code into the widget. So, something like:
class Simple(object): "on_"): __setattr_ _(self, atr, val)
def __setattr__(self, atr, val):
if atr.startswith(
val = lambda: val(self)
object.
That should work in making sure callbacks get the widget passed in. Then something slightly more complex might be needed to get the EventSlot thing working in a similar way.
This means in your 'helloworldeven tcallback. py' experiment, you would receive the widget as an argument in new() with no code change, solving the issue of not being able to access event properties.