Changin min size of objects in sizers

This is partly dealing with an issue I have brought up in another thread "Resizing the main panel", but perhaps there is a different way of thinking about it.

I was reading through some of the documentation and it states that sizers work on the principle of making sure the minimum size of objects are displayed. Well, this works great up until I want to make one of the children smaller. If I change the size of the object, I still can't make the window shrink around it.

I start off with a simple frame that I add a menu and status bar to. I then create a panel with a default size. I need it to start off with a particular size (this ends up holding a rendered image, so it needs to be a certain size). I can make it larger than the original size, but I can't make it smaller. I even manually change the minimum size of the panel in the OnSize function, but that doesn't help.

Is there some way to make these values "stick" after I change them? Do I need to call something on the sizer after I fit it?

Thanks,
James

resize.py (2.42 KB)

James Bigler wrote:

This is partly dealing with an issue I have brought up in another thread "Resizing the main panel", but perhaps there is a different way of thinking about it.

I was reading through some of the documentation and it states that sizers work on the principle of making sure the minimum size of objects are displayed. Well, this works great up until I want to make one of the children smaller. If I change the size of the object, I still can't make the window shrink around it.

I start off with a simple frame that I add a menu and status bar to. I then create a panel with a default size. I need it to start off with a particular size (this ends up holding a rendered image, so it needs to be a certain size). I can make it larger than the original size, but I can't make it smaller. I even manually change the minimum size of the panel in the OnSize function, but that doesn't help.

Is there some way to make these values "stick" after I change them? Do I need to call something on the sizer after I fit it?

As mentioned in the other mail the reason the frame in this sample is not resizing smaller is because of the SetSizerAndFit call is setting the minsize of the frame.

ยทยทยท

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