code: def SetSize(self, rect):
          
  
          grid = self.main_window.grid
          key = grid.actions.cursor
  
          drawn_rect = grid.grid_renderer._get_drawn_rect(grid, key, rect)
  
          self._tc.SetDimensions(drawn_rect.x, drawn_rect.y,
                                 drawn_rect.width+2, drawn_rect.height+2,
                                 wx.SIZE_ALLOW_MINUS_ONE)
          self._tc.Layout()
docs: Called to position/size the edit control within the cell rectangle.
          If you don't fill the cell (the rect) then be sure to override
          PaintBackground and do something meaningful there.