[wxPython] About sizers...

I've not found something explicit about this, so time to go to da list...

A project I've put together consists of two groups of controls. The two are
subsets of a horizontal sizer.

The planned layout was to be:

  wxApp
    wxFrame -- wxPanel -- wxBoxSizer (H)
        wxPanel -- wxBoxSizer (V)
        wxPanel -- wxBoxSizer (V)

In other words, two vertical columns of stuff, each founded on a panel.

What I found out was that if I did it this way (Adding a window to the top
sizer) then the sizers attached to the child panels didn't have any effect.
Buttons added to these child panels' sizers just stacked up on top of each
other.

To get it to work, I had to eliminate the child panels and pass the sizers
directly to the parent sizer.

Now, is this the way it's supposed to work, or am I missing something?
Details available on request.

Yep, that is the way it works. You just add your panels to the sizers.
Think of a sizer as sort of a self-managed GUI container for panels.

When I design a user interface, I divide the main window real estate into
the areas I need. These areas are then "implemented" with sizers, and each
sizer afterwards "filled" with a panel or some other widget.

In your example, you just add the two VSizers to your HSizer, and then you
add your panels to the respective VSizers and it works,

Horst

···

On Wednesday 06 February 2002 17:35, Jeff Grimmett wrote:

To get it to work, I had to eliminate the child panels and pass the
sizers directly to the parent sizer.

Now, is this the way it's supposed to work, or am I missing something?
Details available on request.

> To get it to work, I had to eliminate the child panels and pass the
> sizers directly to the parent sizer.
>
> Now, is this the way it's supposed to work, or am I missing something?
> Details available on request.

Yep, that is the way it works. You just add your panels to the sizers.
Think of a sizer as sort of a self-managed GUI container for panels.

I suspect there's a bit more to it than that, since as a result of this all
my buttons disappeared! :slight_smile: Do I need to add a sizer inside that panel then
add the buttons to that sizer?

In your example, you just add the two VSizers to your HSizer, and
then you
add your panels to the respective VSizers and it works,

I did simplify, my appologies. There is a bit more involved :slight_smile: