I'm trying to get the object that caused an event.
I'm storing attributes in the object that I need for processing the
event.
Seems like event.GetEvetObject() is just what is needed.
But it returns a string representation instead of the actual object.
I looked at the SWIG generated code and indeed
_wrap_wxEvent_GetEventObject() calls Py_BuildValue("s",) for the return
value.
Is this a bug or is there a way to turn the string into a proper pointer
to the object instance?
I'm using wxPython version 2.2.1 on Linux
A sippet of code follows.
class testMyApp(wxApp):
def btnIncrement(self,event):
print "in btnIncrement"
print "self=",self
print "event=",event
event_obj=event.GetEventObject()
print type(event_obj)
# I would like to do: event_obj.CallMethod()
def OnInit(self):
self.frame = testMyMainFrame(NULL,-1,"VIZ Gui")
btn1 = wxButton(self.frame, 1010, "increment")
self.btn1 = btn1
print "btn1 object=",btn1
btn1.CallMethod = foo
EVT_BUTTON(self, 1010, self.btnIncrement)
Thanks for your help.
···
--
Ralph Noack
_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/mailman/listinfo/wxpython-users