(self)
Walk all the terminals along the top and left edges to fake up how
        many columns/rows we sort of have
Walk all the terminals along the top and left edges to fake up how
        many columns/rows we sort of have
Walk all the terminals along the top and left edges to fake up how many columns / rows we sort of have
def set_rough_geometry_hints(self):
        """Walk all the terminals along the top and left edges to fake up how
        many columns/rows we sort of have"""
        if self.ismaximised == True:
            return
        if not hasattr(self, 'cached_maker'):
            self.cached_maker = Factory()
        maker = self.cached_maker
        if maker.isinstance(self.get_child(), 'Notebook'):
            dbg("We don't currently support geometry hinting with tabs")
            return

        terminals = self.get_visible_terminals()
        column_sum = 0
        row_sum = 0

        for terminal in terminals:
            rect = terminal.get_allocation()
            if rect.x == 0:
                cols, rows = terminal.get_size()
                row_sum = row_sum + rows
            if rect.y == 0:
                cols, rows = terminal.get_size()
                column_sum = column_sum + cols

        if column_sum == 0 or row_sum == 0:
            dbg('column_sum=%s,row_sum=%s. No terminals found in >=1 axis' %
                (column_sum, row_sum))
            return

        # FIXME: I don't think we should just use whatever font size info is on
        # the last terminal we inspected. Looking up the default profile font
        # size and calculating its character sizes would be rather expensive
        # though.
        font_width, font_height = terminal.get_font_size()
        total_font_width = font_width * column_sum
        total_font_height = font_height * row_sum

        win_width, win_height = self.get_size()
        extra_width = win_width - total_font_width
        extra_height = win_height - total_font_height

        dbg('setting geometry hints: (ewidth:%s)(eheight:%s),\
(fwidth:%s)(fheight:%s)' % (extra_width, extra_height, 
                            font_width, font_height))
        geometry = Gdk.Geometry()
        geometry.base_width = extra_width
        geometry.base_height = extra_height
        geometry.width_inc = font_width
        geometry.height_inc = font_height
        self.set_geometry_hints(None, geometry, Gdk.WindowHints.BASE_SIZE | Gdk.WindowHints.RESIZE_INC)
def set_rough_geometry_hints ( self ) : if self . ismaximised == True : return if not hasattr ( self , 'cached_maker' ) : self . cached_maker = Factory ( ) maker = self . cached_maker if maker . isinstance ( self . get_child ( ) , 'Notebook' ) : dbg ( "We don't currently support geometry hinting with tabs" ) return terminals = self . get_visible_terminals ( ) column_sum = 0 row_sum = 0 for terminal in terminals : rect = terminal . get_allocation ( ) if rect . x == 0 : cols , rows = terminal . get_size ( ) row_sum = row_sum + rows if rect . y == 0 : cols , rows = terminal . get_size ( ) column_sum = column_sum + cols if column_sum == 0 or row_sum == 0 : dbg ( 'column_sum=%s,row_sum=%s. No terminals found in >=1 axis' % ( column_sum , row_sum ) ) return # FIXME: I don't think we should just use whatever font size info is on # the last terminal we inspected. Looking up the default profile font # size and calculating its character sizes would be rather expensive # though. font_width , font_height = terminal . get_font_size ( ) total_font_width = font_width * column_sum total_font_height = font_height * row_sum win_width , win_height = self . get_size ( ) extra_width = win_width - total_font_width extra_height = win_height - total_font_height dbg ( 'setting geometry hints: (ewidth:%s)(eheight:%s),\
(fwidth:%s)(fheight:%s)' % ( extra_width , extra_height , font_width , font_height ) ) geometry = Gdk . Geometry ( ) geometry . base_width = extra_width geometry . base_height = extra_height geometry . width_inc = font_width geometry . height_inc = font_height self . set_geometry_hints ( None , geometry , Gdk . WindowHints . BASE_SIZE | Gdk . WindowHints . RESIZE_INC )