I want a Frame with several panel inside then so only 1 panel is shown at once … the problem is that when the second panel shows the panel isnt stretched to the corners when i resize the frame.
im attaching an example of if (mind me on the button not correctly placed since i wrote it fast)
I want a Frame with several panel inside then so only 1 panel is shown at once ... the problem is that when the second panel shows the panel isnt stretched to the corners when i resize the frame.
im attaching an example of if (mind me on the button not correctly placed since i wrote it fast)
On your example you are using a different widget the problem persists.
Whats the advantage in that style over the simple wx.BoxSizer and
wx.FlexGridSizer? Is it that the next widget is placed correctly
instead of laying over the others?
And Ive tried to fix my example using Layout() that you recomended but
it didnt work either ...
Again thanks for the help
···
On 1 mar, 09:33, werner <wbru...@free.fr> wrote:
On 01/03/2012 03:27, monoBOT wrote:> Im having a stupid problem i cant solve ...
> I want a Frame with several panel inside then so only 1 panel is shown
> at once ... the problem is that when the second panel shows the panel
> isnt stretched to the corners when i resize the frame.
> im attaching an example of if (mind me on the button not correctly
> placed since i wrote it fast)
You need to tell the sizer to layout when you hide/show your panel.
You might also want to consider sized_controls. Just for the heck of it
I changed your sample to use the sc controls, see attached.
On your example you are using a different widget the problem persists.
Oops, missed two SetSizerProps calls, see attached.
Whats the advantage in that style over the simple wx.BoxSizer and
wx.FlexGridSizer? Is it that the next widget is placed correctly
instead of laying over the others?
The sized_controls handle most of the sizer stuff for you automatically and they have the advantage that the layout complies to the platform specific Human Interface Guidelines (HIG). Check out the wxPython demo for the different options.
But really just a matter of taste/liking.
And Ive tried to fix my example using Layout() that you recomended but
it didnt work either ...
You need to add the buttons to the appropriate sizer and the panels also need to be defined to expand (expand=True, proporation=1).
You might not have noticed it but I also used the WIT, so when running it press ctrl-alt-i, this tool is very helpful when debugging sizer issues as you easily look at each widget and see how large it is and what the sizer configuration is etc etc. See the wiki for more details: http://wiki.wxpython.org/Widget%20Inspection%20Tool
Werner
BTW - bottom posting is much easier to follow should this discussion go on a bit more:-) , and I believe that most of use on here prefer it.
On your example you are using a different widget the problem persists.
Oops, missed two SetSizerProps calls, see attached.
Whats the advantage in that style over the simple wx.BoxSizer and
wx.FlexGridSizer? Is it that the next widget is placed correctly
instead of laying over the others?
The sized_controls handle most of the sizer stuff for you automatically and they have the advantage that the layout complies to the platform specific Human Interface Guidelines (HIG). Check out the wxPython demo for the different options.
But really just a matter of taste/liking.
Think i will consider it on my next proyect, but dont think i will change it on my current one.
And Ive tried to fix my example using Layout() that you recomended but
it didnt work either …
You need to add the buttons to the appropriate sizer and the panels also need to be defined to expand (expand=True, proporation=1).
You might not have noticed it but I also used the WIT, so when running it press ctrl-alt-i, this tool is very helpful when debugging sizer issues as you easily look at each widget and see how large it is and what the sizer configuration is etc etc. See the wiki for more details: http://wiki.wxpython.org/Widget%20Inspection%20Tool
Oh, now i see it … just checking it on the main application. (i will have to remember to take it out on the final app)
On Wednesday, February 29, 2012 8:27:31 PM UTC-6, monobot wrote:
Im having a stupid problem i cant solve …
I want a Frame with several panel inside then so only 1 panel is shown at once … the problem is that when the second panel shows the panel isnt stretched to the corners when i resize the frame.
im attaching an example of if (mind me on the button not correctly placed since i wrote it fast)
so on every resizing the panel gets the size from its parent.
There's nothing wrong with this solution. If a change in the
parent’s size means that something must happen to the child windows,
then this is exactly how you’d do it. Usually, sizers handle this
for you, but when you don’t have a sizer, this is how you have to do
it.