Placing panels within a gridbagsizer

Hi, I'm having trouble getting my head around panels placement using a
gridbagsizer. Full problem outlined here -

http://stackoverflow.com/questions/4700967/placing-elements-panels-within-a-wx-gridbagsizer

Thanks.

I posted a reply to StackOverflow, but I’ll post it here too for completeness:

Personally, I would use a BoxSizer in VERTICAL orientation. I have attached a simple example.

If you open it up, you will see that I changed the background color of each panel to make it easier to tell which is which. You might want to take a look at the Widget Inspection Tool as well to help you visualize it:

http://wiki.wxpython.org/Widget%20Inspection%20Tool

multi_panels.py (824 Bytes)

···

On Tue, Jan 25, 2011 at 3:38 AM, John john@johnharris.tv wrote:

Hi, I’m having trouble getting my head around panels placement using a

gridbagsizer. Full problem outlined here -

http://stackoverflow.com/questions/4700967/placing-elements-panels-within-a-wx-gridbagsizer

Thanks.


Mike Driscoll

Blog: http://blog.pythonlibrary.org

Oops…I accidentally indented the code and saved it in the other version I sent. Here’s one that should “just work” ™

multi_panels.py (724 Bytes)

···

On Tue, Jan 25, 2011 at 10:49 AM, Mike Driscoll mike@pythonlibrary.org wrote:

On Tue, Jan 25, 2011 at 3:38 AM, John john@johnharris.tv wrote:

Hi, I’m having trouble getting my head around panels placement using a

gridbagsizer. Full problem outlined here -

http://stackoverflow.com/questions/4700967/placing-elements-panels-within-a-wx-gridbagsizer

Thanks.

I posted a reply to StackOverflow, but I’ll post it here too for completeness:

Personally, I would use a BoxSizer in VERTICAL orientation. I have attached a simple example.

If you open it up, you will see that I changed the background color of each panel to make it easier to tell which is which. You might want to take a look at the Widget Inspection Tool as well to help you visualize it:

http://wiki.wxpython.org/Widget%20Inspection%20Tool

Mike Driscoll

Blog: http://blog.pythonlibrary.org