code: def do_fit(self, event, min_size=None):
          
          #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()
          # 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))
          # make sure you adhere to a minimum size
          if min_size:
              actual_size = self.GetSize()
              larger_width = max([actual_size[0], min_size[0]])
              larger_height = max([actual_size[1], min_size[1]])
              if larger_width > actual_size[0] or larger_height > actual_size[1]:
                  self.SetSize((larger_width, larger_height))
          self.Centre()
docs: Re-fit the window to the size of the content.