code: def switch_to_table(self, event):
          
  
          newtable = event.newtable
  
          no_tabs = self.grid.code_array.shape[2] - 1
  
          if 0 <= newtable <= no_tabs:
              self.grid.current_table = newtable
  
              self.grid.SetToolTip(None)
  
              # Delete renderer cache
              self.grid.grid_renderer.cell_cache.clear()
  
              # Delete video cells
              video_cells = self.grid.grid_renderer.video_cells
              for key in video_cells:
                  video_panel = video_cells[key]
                  video_panel.player.stop()
                  video_panel.player.release()
                  video_panel.Destroy()
              video_cells.clear()
  
              # Hide cell editor
              cell_editor = self.grid.GetCellEditor(self.grid.GetGridCursorRow(),
                                                    self.grid.GetGridCursorCol())
  
              try:
                  cell_editor.Reset()
              except AttributeError:
                  # No cell editor open
                  pass
  
              self.grid.HideCellEditControl()
  
              # Change value of entry_line and table choice
              post_command_event(self.main_window, self.TableChangedMsg,
                                 table=newtable)
  
              # Reset row heights and column widths by zooming
  
              self.zoom()
docs: Switches grid to table
  
          Parameters
          ----------
  
          event.newtable: Integer
          \tTable that the grid is switched to