(self, widget, keyname)
Handle a keyboard event requesting a terminal resize
Handle a keyboard event requesting a terminal resize
Handle a keyboard event requesting a terminal resize
def resizeterm(self, widget, keyname):
        """Handle a keyboard event requesting a terminal resize"""
        if keyname in ['up', 'down'] and isinstance(self, Gtk.VPaned):
            # This is a key we can handle
            position = self.get_position()

            if self.maker.isinstance(widget, 'Terminal'):
                fontheight = widget.vte.get_char_height()
            else:
                fontheight = 10

            if keyname == 'up':
                self.set_position(position - fontheight)
            else:
                self.set_position(position + fontheight)
        elif keyname in ['left', 'right'] and isinstance(self, Gtk.HPaned):
            # This is a key we can handle
            position = self.get_position()

            if self.maker.isinstance(widget, 'Terminal'):
                fontwidth = widget.vte.get_char_width()
            else:
                fontwidth = 10

            if keyname == 'left':
                self.set_position(position - fontwidth)
            else:
                self.set_position(position + fontwidth)
        else:
            # This is not a key we can handle
            self.emit('resize-term', keyname)
def resizeterm ( self , widget , keyname ) : if keyname in [ 'up' , 'down' ] and isinstance ( self , Gtk . VPaned ) : # This is a key we can handle position = self . get_position ( ) if self . maker . isinstance ( widget , 'Terminal' ) : fontheight = widget . vte . get_char_height ( ) else : fontheight = 10 if keyname == 'up' : self . set_position ( position - fontheight ) else : self . set_position ( position + fontheight ) elif keyname in [ 'left' , 'right' ] and isinstance ( self , Gtk . HPaned ) : # This is a key we can handle position = self . get_position ( ) if self . maker . isinstance ( widget , 'Terminal' ) : fontwidth = widget . vte . get_char_width ( ) else : fontwidth = 10 if keyname == 'left' : self . set_position ( position - fontwidth ) else : self . set_position ( position + fontwidth ) else : # This is not a key we can handle self . emit ( 'resize-term' , keyname )