Three questions about wxScrolledPanel and it's usage.

I am trying to get a wxScrolledPanel work as I want.

* Question 1: On windows, there doesn't show up any scrollbars. The wxGtk
  variant works fine. Is this a known bug?

* Question 2: The panel inside the wxScrolledPanel is (quite obviously or
  there wouldn't be a need for a scrolled panel) too large for the frame
  it is shown on, but the sizing mechanism makes it as large as it can and
  thus enlarging the frame quite a lot. How do I make the wxScrolledPanel
  take up exactly the space that is left and not try to enlarge the
  frame? Now I just do the following:

        self.scrolled_panel = wxPanel(self, -1)
        add_content_to_scrolled_panel()
        sizer.Add(self.scrolled_panel, 1, wxEXPAND | wxALL, 5)

* Question 3: I change the contents of the wxScrolledPanel fairly often
  and I don't understand how to completely remove the old things that were
  there before. I have tried to use Remove() from the main sizer, but that
  doesn't work. I have tried everything I can come up with to delete the
  old content. What is the canonical way to remove and delete contents
  from a panel?

/Ragnar Ouchterlony

Ragnar Ouchterlony wrote:

I am trying to get a wxScrolledPanel work as I want.

* Question 1: On windows, there doesn't show up any scrollbars. The wxGtk
  variant works fine. Is this a known bug?

No. Does the wxScrolledPanel sample in the demo do the same thing?

* Question 2: The panel inside the wxScrolledPanel is (quite obviously or
  there wouldn't be a need for a scrolled panel) too large for the frame
  it is shown on, but the sizing mechanism makes it as large as it can and
  thus enlarging the frame quite a lot. How do I make the wxScrolledPanel
  take up exactly the space that is left and not try to enlarge the
  frame? Now I just do the following:

        self.scrolled_panel = wxPanel(self, -1)
        add_content_to_scrolled_panel()
        sizer.Add(self.scrolled_panel, 1, wxEXPAND | wxALL, 5)

Sizers will never force the window (that they are attached to) to resize, you have to tell it to do so with Fit or something similar.

* Question 3: I change the contents of the wxScrolledPanel fairly often
  and I don't understand how to completely remove the old things that were
  there before. I have tried to use Remove() from the main sizer, but that
  doesn't work. I have tried everything I can come up with to delete the
  old content. What is the canonical way to remove and delete contents
  from a panel?

  childWindow.Destroy()

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!