newevent module now returns a PyEventBinder instead of a function
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24724 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
"""Easy generation of new events classes and binder functions"""
|
"""Easy generation of new events classes and binder objects"""
|
||||||
|
|
||||||
__author__ = "Miki Tebeka <tebeka@cs.bgu.ac.il>"
|
__author__ = "Miki Tebeka <tebeka@cs.bgu.ac.il>"
|
||||||
|
|
||||||
@@ -19,10 +19,7 @@ def NewEvent():
|
|||||||
self.SetEventType(evttype)
|
self.SetEventType(evttype)
|
||||||
self.__dict__.update(kw)
|
self.__dict__.update(kw)
|
||||||
|
|
||||||
def Binder(win, func):
|
return _Event, wx.PyEventBinder(evttype)
|
||||||
win.Connect(-1, -1, evttype, func)
|
|
||||||
|
|
||||||
return _Event, Binder
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -37,10 +34,7 @@ def NewCommandEvent():
|
|||||||
wx.PyCommandEvent.__init__(self, evttype, id)
|
wx.PyCommandEvent.__init__(self, evttype, id)
|
||||||
self.__dict__.update(kw)
|
self.__dict__.update(kw)
|
||||||
|
|
||||||
def Binder(win, id, func):
|
return _Event, wx.PyEventBinder(evttype, 1)
|
||||||
win.Connect(id, -1, evttype, func)
|
|
||||||
|
|
||||||
return _Event, Binder
|
|
||||||
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user