I am not sure how you want this to look. So I can't say exactly what you
should do. However, in general I think you need a better understanding of
sizers in wxWindows/wxPython. This is a difficulty that everyone must face
when beginning to use this package.
For example, you may need to put a sizer *inside* your panel -- in order to
correctly size what you want to appear there (such as a grid). Probably
the best way to do this is to define your own class which is subclassed
from wxPanel and create your sizer(s) in it with methods that also will
then place things within those sizers.
The way you have things now, you have created a panel and made your buttons
children of the panel, but there is no sizer in the panel to control sizing
of its children. The only sizer you have is an "outer" sizer that is
sizing the entire panel. The buttons are children of the panel, but you
are "controlling" their sizes and layout with the outer sizer that is
really controlling the panel they are within -- -- or at least this is how
it looks to me.
If you want the buttons to be *in* the panel, then you should have a sizer
*in* the panel that will handle the buttons (and anything else in the panel
(in fact you may want several sizers, depending on how complex the contents
of teh panel will be). If you want the buttons *outside* the panel, then
you should not make them *children of* the panel.
If possible, I would recommend that you get wxDesigner if you can afford
the minor expense. While it has shortcomings, I think it is the best way
to quickly learn how sizers actually work and the effect that the various
parameter values have. Also, look carefully at the demos that come with
wxPython, concentrating on those involving buttons, panels, and their
relations to the sizers that control them.
···
--------------------------------------
Gary H. Merrill
Director and Principal Scientist, New Applications
Data Exploration Sciences
GlaxoSmithKline Inc.
(919) 483-8456