With Phoenix I see a problem with a custom event that the 'setter' is not called.
The event is define like this:
class ScEventDbItemSet(wx.PyCommandEvent):
"""Custom event to be notified when a dbItem is set on the control"""
def __init__(self, evtType, id):
wx.PyCommandEvent.__init__(self, evtType, id)
self._dbItem = None
With Phoenix I see a problem with a custom event that the 'setter' is not called.
The event is define like this:
class ScEventDbItemSet(wx.PyCommandEvent):
"""Custom event to be notified when a dbItem is set on the control"""
def __init__(self, evtType, id):
wx.PyCommandEvent.__init__(self, evtType, id)
self._dbItem = None
With Phoenix I see a problem with a custom event that the 'setter' is
not called.
The event is define like this:
class ScEventDbItemSet(wx.PyCommandEvent):
"""Custom event to be notified when a dbItem is set on the control"""
def __init__(self, evtType, id):
wx.PyCommandEvent.__init__(self, evtType, id)
self._dbItem = None
Hmm... I expected that would work correctly. It looks like __getattr__ and friends don't always play nice with properties. See python - Using __getattr__ and meeting expected behaviour for subclasses - Stack Overflow. The wx.PyEvent and wx.PyCommandEvent classes have implementations for __[get|set|del]attr__ and is how they ensure that all attributes are stored in the dictionary that gets shared by the clones that go through the event system. I'll add a TODO to my list to take another look at that implementation and see if there is another way to do it.
Yeah, that example is broken. I'll fix that too when I reinvestigate the current implementation. For clarification, you should only need to follow this example if your class already had __getattr__ etc. implementations in Classic, and the intent is to show how they would need to be updated to work with Phoenix using the extra dictionary.