Discussion:
boxsizer not nesting in proper place in parent boxsizer
Mark Halegua
2014-09-11 17:40:30 UTC
Permalink
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 wxpython-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Florian Höch
2014-09-11 22:12:54 UTC
Permalink
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).
Post by 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 wxpython-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...