code: def change_grid_shape(self, shape):
          
  
          # Mark content as changed
          post_command_event(self.main_window, self.ContentChangedMsg)
  
          self.code_array.shape = shape
  
          # Update TableChoiceIntCtrl
          post_command_event(self.main_window, self.ResizeGridMsg, shape=shape)
  
          # Change grid table dimensions
          self.grid.GetTable().ResetView()
  
          # Clear caches
          self.code_array.result_cache.clear()
docs: Grid shape change event handler, marks content as changed