def attach(self, gui):
        """Attach the view to the GUI."""
        super(TraceView, self).attach(gui)
        self.actions.add(self.go_to, alias='tg')
        self.actions.separator()
        self.actions.add(self.shift, alias='ts')
        self.actions.add(self.go_right)
        self.actions.add(self.go_left)
        self.actions.separator()
        self.actions.add(self.increase)
        self.actions.add(self.decrease)
        self.actions.separator()
        self.actions.add(self.widen)
        self.actions.add(self.narrow)
        self.actions.separator()
        self.actions.add(self.toggle_show_labels)

        # We forward the event from VisPy to the phy GUI.
        @self.connect
        def on_spike_click(e):
            logger.log(5, "Spike click on channel %s, spike %s, cluster %s.",
                       e.channel_id, e.spike_id, e.cluster_id)
            gui.emit('spike_click',
                     channel_id=e.channel_id,
                     spike_id=e.spike_id,
                     cluster_id=e.cluster_id,
                     )
def attach ( self , gui ) : super ( TraceView , self ) . attach ( gui ) self . actions . add ( self . go_to , alias = 'tg' ) self . actions . separator ( ) self . actions . add ( self . shift , alias = 'ts' ) self . actions . add ( self . go_right ) self . actions . add ( self . go_left ) self . actions . separator ( ) self . actions . add ( self . increase ) self . actions . add ( self . decrease ) self . actions . separator ( ) self . actions . add ( self . widen ) self . actions . add ( self . narrow ) self . actions . separator ( ) self . actions . add ( self . toggle_show_labels ) @ self . connect def on_spike_click ( e ) : logger . log ( 5 , "Spike click on channel %s, spike %s, cluster %s." , e . channel_id , e . spike_id , e . cluster_id ) gui . emit ( 'spike_click' , channel_id = e . channel_id , spike_id = e . spike_id , cluster_id = e . cluster_id , )
Attach the view to the GUI.