(self, event, parameter)
Process an event by calling the registered handler if there's one.
Process an event by calling the registered handler if there's one.
Process an event by calling the registered handler if there s one .
def process(self, event, parameter):
        """Process an event by calling the registered handler if there's one.
        """
        method = self.handlers.get(event, None)
        if method:
            # if the method is a method of a class deriving from EventProcessor
            # we pass just parameter
            if (inspect.ismethod(method) and 
                (EventProcessor in inspect.getmro(method.im_class) or
                 galry.InteractionManager in inspect.getmro(method.im_class))):
                method(parameter)
            else:
                fig = self.interaction_manager.figure
                # HACK: give access to paint_manager.set_data to the figure,
                # so that event processors can change the data
                # BAD SMELL HERE :(
                if not hasattr(fig, 'set_data'):
                    fig.set_data = self.parent.paint_manager.set_data
                    fig.copy_texture = self.parent.paint_manager.copy_texture
                    fig.set_rendering_options = self.parent.paint_manager.set_rendering_options
                    fig.get_processor = self.interaction_manager.get_processor
                    fig.get_visual = self.paint_manager.get_visual
                    fig.process_interaction = self.parent.process_interaction
                
                fig.resizeGL = self.parent.paint_manager.resizeGL
                # here, we are using the high level interface and figure
                # is the Figure object we pass to this function
                method(fig, parameter)
def process ( self , event , parameter ) : method = self . handlers . get ( event , None ) if method : # if the method is a method of a class deriving from EventProcessor # we pass just parameter if ( inspect . ismethod ( method ) and ( EventProcessor in inspect . getmro ( method . im_class ) or galry . InteractionManager in inspect . getmro ( method . im_class ) ) ) : method ( parameter ) else : fig = self . interaction_manager . figure # HACK: give access to paint_manager.set_data to the figure, # so that event processors can change the data # BAD SMELL HERE :( if not hasattr ( fig , 'set_data' ) : fig . set_data = self . parent . paint_manager . set_data fig . copy_texture = self . parent . paint_manager . copy_texture fig . set_rendering_options = self . parent . paint_manager . set_rendering_options fig . get_processor = self . interaction_manager . get_processor fig . get_visual = self . paint_manager . get_visual fig . process_interaction = self . parent . process_interaction fig . resizeGL = self . parent . paint_manager . resizeGL # here, we are using the high level interface and figure # is the Figure object we pass to this function method ( fig , parameter )