(self, event)
return
Handle arrow keys press
Handle arrow keys press
Handle arrow keys press
def handle_arrow_keys(self, event):
        """Handle arrow keys press"""
        #print event.keysym

        row = self.get_row_clicked(event)
        col = self.get_col_clicked(event)
        x,y = self.getCanvasPos(self.currentrow, 0)
        if x == None:
            return

        if event.keysym == 'Up':
            if self.currentrow == 0:
                return
            else:
                self.currentrow  = self.currentrow -1
        elif event.keysym == 'Down':
            if self.currentrow >= self.rows-1:
                return
            else:
                self.currentrow  = self.currentrow +1
        elif event.keysym == 'Right' or event.keysym == 'Tab':
            if self.currentcol >= self.cols-1:
                if self.currentrow < self.rows-1:
                    self.currentcol = 0
                    self.currentrow  = self.currentrow +1
                else:
                    return
            else:
                self.currentcol  = self.currentcol +1
        elif event.keysym == 'Left':
            if self.currentcol == 0:
                if self.currentrow == 0:
                    return
                else:
                    self.currentcol = self.cols-1
                    self.currentrow = self.currentrow - 1
            else:
                self.currentcol  = self.currentcol -1
        self.drawSelectedRect(self.currentrow, self.currentcol)
        coltype = self.model.getColumnType(self.currentcol)
        if coltype == 'text' or coltype == 'number':
            self.delete('entry')
            self.drawCellEntry(self.currentrow, self.currentcol)
        return
def handle_arrow_keys ( self , event ) : #print event.keysym row = self . get_row_clicked ( event ) col = self . get_col_clicked ( event ) x , y = self . getCanvasPos ( self . currentrow , 0 ) if x == None : return if event . keysym == 'Up' : if self . currentrow == 0 : return else : self . currentrow = self . currentrow - 1 elif event . keysym == 'Down' : if self . currentrow >= self . rows - 1 : return else : self . currentrow = self . currentrow + 1 elif event . keysym == 'Right' or event . keysym == 'Tab' : if self . currentcol >= self . cols - 1 : if self . currentrow < self . rows - 1 : self . currentcol = 0 self . currentrow = self . currentrow + 1 else : return else : self . currentcol = self . currentcol + 1 elif event . keysym == 'Left' : if self . currentcol == 0 : if self . currentrow == 0 : return else : self . currentcol = self . cols - 1 self . currentrow = self . currentrow - 1 else : self . currentcol = self . currentcol - 1 self . drawSelectedRect ( self . currentrow , self . currentcol ) coltype = self . model . getColumnType ( self . currentcol ) if coltype == 'text' or coltype == 'number' : self . delete ( 'entry' ) self . drawCellEntry ( self . currentrow , self . currentcol ) return