(self)
Connect the GTK+ signals we care about
Connect the GTK+ signals we care about
Connect the GTK + signals we care about
def register_callbacks(self):
        """Connect the GTK+ signals we care about"""
        self.connect('key-press-event', self.on_key_press)
        self.connect('button-press-event', self.on_button_press)
        self.connect('delete_event', self.on_delete_event)
        self.connect('destroy', self.on_destroy_event)
        self.connect('window-state-event', self.on_window_state_changed)
        self.connect('focus-out-event', self.on_focus_out)
        self.connect('focus-in-event', self.on_focus_in)

        # Attempt to grab a global hotkey for hiding the window.
        # If we fail, we'll never hide the window, iconifying instead.
        if self.config['keybindings']['hide_window'] not in ('', None):
            if display_manager() == 'X11':
                try:
                    self.hidebound = Keybinder.bind(
                        self.config['keybindings']['hide_window'],
                        self.on_hide_window)
                except (KeyError, NameError):
                    pass

                if not self.hidebound:
                    err('Unable to bind hide_window key, another instance/window has it.')
                    self.hidefunc = self.iconify
                else:
                    self.hidefunc = self.hide
def register_callbacks ( self ) : self . connect ( 'key-press-event' , self . on_key_press ) self . connect ( 'button-press-event' , self . on_button_press ) self . connect ( 'delete_event' , self . on_delete_event ) self . connect ( 'destroy' , self . on_destroy_event ) self . connect ( 'window-state-event' , self . on_window_state_changed ) self . connect ( 'focus-out-event' , self . on_focus_out ) self . connect ( 'focus-in-event' , self . on_focus_in ) # Attempt to grab a global hotkey for hiding the window. # If we fail, we'll never hide the window, iconifying instead. if self . config [ 'keybindings' ] [ 'hide_window' ] not in ( '' , None ) : if display_manager ( ) == 'X11' : try : self . hidebound = Keybinder . bind ( self . config [ 'keybindings' ] [ 'hide_window' ] , self . on_hide_window ) except ( KeyError , NameError ) : pass if not self . hidebound : err ( 'Unable to bind hide_window key, another instance/window has it.' ) self . hidefunc = self . iconify else : self . hidefunc = self . hide