peng3d/peng.py
def addEventListener(self,event,func,raiseErrors=False):
        """
        Adds a handler to the given event.
        
        A event may have an arbitrary amount of handlers, though assigning too
        many handlers may slow down event processing.
        
        For the format of ``event``\ , see :py:meth:`sendEvent()`\ .
        
        ``func`` is the handler which will be executed with two arguments, ``event_type`` and ``data``\ , as supplied to :py:meth:`sendEvent()`\ .
        
        If ``raiseErrors`` is True, exceptions caused by the handler will be re-raised.
        Defaults to ``False``\ .
        """
        if not isinstance(event,str):
            raise TypeError("Event types must always be strings")
        
        if event not in self.eventHandlers:
            self.eventHandlers[event]=[]
        self.eventHandlers[event].append([func,raiseErrors])
def addEventListener(self,event,func,raiseErrors=False):
        """
        Adds a handler to the given event.
        
        A event may have an arbitrary amount of handlers, though assigning too
        many handlers may slow down event processing.
        
        For the format of ``event``\ , see :py:meth:`sendEvent()`\ .
        
        ``func`` is the handler which will be executed with two arguments, ``event_type`` and ``data``\ , as supplied to :py:meth:`sendEvent()`\ .
        
        If ``raiseErrors`` is True, exceptions caused by the handler will be re-raised.
        Defaults to ``False``\ .
        """
        if not isinstance(event,str):
            raise TypeError("Event types must always be strings")
        
        if event not in self.eventHandlers:
            self.eventHandlers[event]=[]
        self.eventHandlers[event].append([func,raiseErrors])
Adds a handler to the given event.
        
        A event may have an arbitrary amount of handlers, though assigning too
        many handlers may slow down event processing.
        
        For the format of ``event``\ , see :py:meth:`sendEvent()`\ .
        
        ``func`` is the handler which will be executed with two arguments, ``event_type`` and ``data``\ , as supplied to :py:meth:`sendEvent()`\ .
        
        If ``raiseErrors`` is True, exceptions caused by the handler will be re-raised.
        Defaults to ``False``\ .