the method DirectObject.bind() allows to bind a function or a method to a specific event. However, is there a way to send -all- events and their additional information to a single method or function?
An easy way to do it was to hack the messenger.send() method in messenger.py and add the following code:
try: self.catchAllMethod(event, sentArgs) except Exception: pass
Of course self.catchAllMethod must be declared in messenger.init() and must be set by the application to point to an appropriate function or method, i.e.:
def myFunction(event, arguments): print("Event: " + event) print("Args:" + str(arguments)) messenger.catchAllMethod = myFunction
Is there a built-in way to achieve the same result?