(self, event=None, callback=None)
return
Redraw the visible portion of the canvas
Redraw the visible portion of the canvas
Redraw the visible portion of the canvas
def redrawVisible(self, event=None, callback=None):
        """Redraw the visible portion of the canvas"""

        model = self.model
        self.rows = self.model.getRowCount()
        self.cols = self.model.getColumnCount()

        self.tablewidth = (self.cellwidth) * self.cols
        self.configure(bg=self.bgcolor)
        self.setColPositions()

        #are we drawing a filtered subset of the recs?
        if self.filtered == True and self.model.filteredrecs != None:
            self.rows = len(self.model.filteredrecs)
            self.delete('colrect')

        self.rowrange = range(0,self.rows)
        self.configure(scrollregion=(0,0, self.tablewidth+self.x_start,
                self.rowheight*self.rows+10))

        x1, y1, x2, y2 = self.getVisibleRegion()
        startvisiblerow, endvisiblerow = self.getVisibleRows(y1, y2)
        self.visiblerows = range(startvisiblerow, endvisiblerow)
        startvisiblecol, endvisiblecol = self.getVisibleCols(x1, x2)
        self.visiblecols = range(startvisiblecol, endvisiblecol)

        if self.cols == 0 or self.rows == 0:
            self.delete('entry')
            self.delete('rowrect')
            self.delete('currentrect')
            self.delete('gridline','text')
            self.tablerowheader.redraw()
            return

        self.drawGrid(startvisiblerow, endvisiblerow)
        align = self.align
        self.delete('fillrect')
        for row in self.visiblerows:
            if callback != None:
                callback()
            for col in self.visiblecols:
                colname = model.getColumnName(col)
                bgcolor = model.getColorAt(row,col, 'bg')
                fgcolor = model.getColorAt(row,col, 'fg')
                text = model.getValueAt(row,col)
                self.drawText(row, col, text, fgcolor, align)
                if bgcolor != None:
                    self.drawRect(row,col, color=bgcolor)

        #self.drawSelectedCol()
        self.tablecolheader.redraw()
        self.tablerowheader.redraw(align=self.align, showkeys=self.showkeynamesinheader)
        #self.setSelectedRow(self.currentrow)
        self.drawSelectedRow()
        self.drawSelectedRect(self.currentrow, self.currentcol)
        #print self.multiplerowlist

        if len(self.multiplerowlist)>1:
            self.tablerowheader.drawSelectedRows(self.multiplerowlist)
            self.drawMultipleRows(self.multiplerowlist)
            self.drawMultipleCells()
        return
def redrawVisible ( self , event = None , callback = None ) : model = self . model self . rows = self . model . getRowCount ( ) self . cols = self . model . getColumnCount ( ) self . tablewidth = ( self . cellwidth ) * self . cols self . configure ( bg = self . bgcolor ) self . setColPositions ( ) #are we drawing a filtered subset of the recs? if self . filtered == True and self . model . filteredrecs != None : self . rows = len ( self . model . filteredrecs ) self . delete ( 'colrect' ) self . rowrange = range ( 0 , self . rows ) self . configure ( scrollregion = ( 0 , 0 , self . tablewidth + self . x_start , self . rowheight * self . rows + 10 ) ) x1 , y1 , x2 , y2 = self . getVisibleRegion ( ) startvisiblerow , endvisiblerow = self . getVisibleRows ( y1 , y2 ) self . visiblerows = range ( startvisiblerow , endvisiblerow ) startvisiblecol , endvisiblecol = self . getVisibleCols ( x1 , x2 ) self . visiblecols = range ( startvisiblecol , endvisiblecol ) if self . cols == 0 or self . rows == 0 : self . delete ( 'entry' ) self . delete ( 'rowrect' ) self . delete ( 'currentrect' ) self . delete ( 'gridline' , 'text' ) self . tablerowheader . redraw ( ) return self . drawGrid ( startvisiblerow , endvisiblerow ) align = self . align self . delete ( 'fillrect' ) for row in self . visiblerows : if callback != None : callback ( ) for col in self . visiblecols : colname = model . getColumnName ( col ) bgcolor = model . getColorAt ( row , col , 'bg' ) fgcolor = model . getColorAt ( row , col , 'fg' ) text = model . getValueAt ( row , col ) self . drawText ( row , col , text , fgcolor , align ) if bgcolor != None : self . drawRect ( row , col , color = bgcolor ) #self.drawSelectedCol() self . tablecolheader . redraw ( ) self . tablerowheader . redraw ( align = self . align , showkeys = self . showkeynamesinheader ) #self.setSelectedRow(self.currentrow) self . drawSelectedRow ( ) self . drawSelectedRect ( self . currentrow , self . currentcol ) #print self.multiplerowlist if len ( self . multiplerowlist ) > 1 : self . tablerowheader . drawSelectedRows ( self . multiplerowlist ) self . drawMultipleRows ( self . multiplerowlist ) self . drawMultipleCells ( ) return