boxsizer not nesting in proper place in parent boxsizer

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

boxsizer not nesting in proper place in parent boxsizer

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

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

nav_butn.py (1K) Download Attachment
table_entry2.py (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: boxsizer not nesting in proper place in parent boxsizer

Florian Höch
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

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.