code: def SetClientRect(self, rect):
          
  
          panel_posx = rect[0] + self.grid.GetRowLabelSize()
          panel_posy = rect[1] + self.grid.GetColLabelSize()
  
          panel_scrolled_pos = self.grid.CalcScrolledPosition(panel_posx,
                                                              panel_posy)
          # If the scrolled position is inside the grid labels then hide
          self.SetPosition(panel_scrolled_pos)
          wx.Panel.SetClientRect(self, wx.Rect(0, 0, rect[2], rect[3]))
  
          # Handle videos that are partly visible or that become invisible
          row_label_size = self.grid.GetRowLabelSize()
          col_label_size = self.grid.GetColLabelSize()
  
          if panel_scrolled_pos[0] < row_label_size or \
             panel_scrolled_pos[1] < col_label_size:
              self.Hide()
          else:
              self.Show()
docs: Positions and resizes video panel
  
          Parameters
          ----------
          rect: 4-tuple of Integer
          \tRect area of video panel