code: def do_fit(self, event):
          
          #self.grid.ShowScrollbars(wx.SHOW_SB_NEVER, wx.SHOW_SB_NEVER)
          if event:
              event.Skip()
          self.main_sizer.Fit(self)
          disp_size = wx.GetDisplaySize()
          actual_size = self.GetSize()
          rows = self.grid.GetNumberRows()
          # if there isn't enough room to display new content
          # resize the frame
          if disp_size[1] - 75 < actual_size[1]:
              self.SetSize((actual_size[0], disp_size[1] * .95))
          self.Centre()
docs: Re-fit the window to the size of the content.