boxsizer not nesting in proper place in parent boxsizer

I’ve created a button bar I want to reuse as class and want to nest it in another boxsizer where eventually another button bar will go. When I do these two button bars directly in the panel, they come out correctly, one below the other, and both below some static text and some entry fields.

When I try to place the button bar class in, it goes only partially to the top of the panel. I have no idea why it’s doing this.

I will attach the code for the two files so you can see what’s happening.

In the file table_entry2.py you can see how I created two button series and placed them in BoxSizers horinontally, then added them to another boxsizer, mainsizer. When I do each button series without refactoring they work fine. However, nav_butn.py is an attempt (it seems successful to a point) of creating a class for the navigation buttons. I return them to table_entry2, but it doesn’t place the button bar at the bottom, either before or after the action buttons or under the static text and the fields.

Can anyone explain this behavior?

Thanks

Mark

nav_butn.py (1.75 KB)

table_entry2.py (3.69 KB)

When using sizers, you don't need to (and shouldn't) set a position for
your widgets. Also, your Nav_Buttons class should probably inherit from
wx.Panel, not wx.Frame (there are more things in your code that could be
optimized, but they're not critical).

···

Am 11.09.2014 um 19:40 schrieb Mark Halegua:

I've created a button bar I want to reuse as class and want to nest it
in another boxsizer where eventually another button bar will go. When I
do these two button bars directly in the panel, they come out correctly,
one below the other, and both below some static text and some entry fields.

When I try to place the button bar class in, it goes only partially to
the top of the panel. I have no idea why it's doing this.

I will attach the code for the two files so you can see what's happening.

In the file table_entry2.py you can see how I created two button series
and placed them in BoxSizers horinontally, then added them to another
boxsizer, mainsizer. When I do each button series without refactoring
they work fine. However, nav_butn.py is an attempt (it seems successful
to a point) of creating a class for the navigation buttons. I return
them to table_entry2, but it doesn't place the button bar at the bottom,
either before or after the action buttons or under the static text and
the fields.

Can anyone explain this behavior?

Thanks

Mark

--
Florian Höch