The only time I’ve seen events is when they are passed as arguments to the bind function. Ex:
Text.Bind(wx.EVT_KEY_DOWN, self.OnKeyText)
However I was going through the tutorial here http://wiki.wxpython.org/DragAndDrop and noticed that numerous arguments are being passed to the event wx.EVT_RIGHT_DOWN (right click on mouse)
wx.EVT_RIGHT_DOWN(self.text, self.OnDragInit)
and also this
wx.EVT_MENU(self, MENU_FILE_EXIT, self.CloseWindow)
I looked around for documentation on the constructor of the event class but only found this which shows that the constructor takes only a single argument.
http://wxpython.org/docs/api/wx.MouseEvent-class.html
What documentation can I look at to understand the types of arguments an EVT can take?
The only time I've seen events is when they are passed as arguments to
the bind function. Ex:
Text.Bind(wx.EVT_KEY_DOWN, self.OnKeyText)
However I was going through the tutorial here DragAndDrop - wxPyWiki and noticed that numerous arguments
are being passed to the event wx.EVT_RIGHT_DOWN (right click on mouse)
Originally the wx.EVT_WHATEVER items were functions. Now they are instances of a wx.PyEventBinder which also have a __call__ magic method for backwards compatibility. Any new code should use the Bind method instead of the function call version of the event binders. There aren't any plans for removing it now but I can't promise that the old style will stay forever.
I looked around for documentation on the constructor
of the event class but only found this which shows that the constructor takes only a single argument.
That's different. wx.MouseEvent and other event classes are the classes of the objects that are passed to the event handlers. The wx.EVT_* items are the things that bind events to handlers.
Originally the wx.EVT_WHATEVER items were functions. Now they are
instances of a wx.PyEventBinder which also have a call magic method
for backwards compatibility. Any new code should use the Bind method
instead of the function call version of the event binders. There aren’t
any plans for removing it now but I can’t promise that the old style
will stay forever.
I looked around for documentation on the constructor
of the event class but only found this which shows that the constructor
takes only a single argument.
That’s different. wx.MouseEvent and other event classes are the classes
of the objects that are passed to the event handlers. The wx.EVT_*
items are the things that bind events to handlers.