Overlapping a Static Box with a wxGrid control

Hi guys,

I;m trying to have on a panel a simple staticbox and in the center
a wxgrid control. I also want to have the possiblity of adjusting the
position and the size of the two items when trying to maximize or
minimize the window containg these controls. I tried to use a sizer,
but with the sizer I could only manipulate one control , either the
grid or the static box. The problem is that I can attach only one sizer
to the panel . Do you have any solution ? Did any of you got a similar
problem ?

Any solution is wellcome.

Thank you again for your great job.

jupan ghe wrote:

Hi guys,
I;m trying to have on a panel a simple staticbox and in the center a wxgrid control. I also want to have the possiblity of adjusting the position and the size of the two items when trying to maximize or minimize the window containg these controls. I tried to use a sizer, but with the sizer I could only manipulate one control , either the grid or the static box. The problem is that I can attach only one sizer to the panel . Do you have any solution ? Did any of you got a similar problem ?

Use a wx.StaticBoxSizer, and then add the grid to that sizer. It will automatically manage the size and position of the grid (and anything else added to that sizer) such that it is within the static box. You can then add that sizer to other sizers as needed to implement the rest of your layout.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Dear Robin,

I will try that and then I will tell my impression.

Thanks,

···

On 2/21/07, Robin Dunn < robin@alldunn.com> wrote:

jupan ghe wrote:

Hi guys,

I;m trying to have on a panel a simple staticbox and in the center a

wxgrid control. I also want to have the possiblity of adjusting the
position and the size of the two items when trying to maximize or
minimize the window containg these controls. I tried to use a sizer, but

with the sizer I could only manipulate one control , either the grid or
the static box. The problem is that I can attach only one sizer to the
panel . Do you have any solution ? Did any of you got a similar problem ?

Use a wx.StaticBoxSizer, and then add the grid to that sizer. It will
automatically manage the size and position of the grid (and anything
else added to that sizer) such that it is within the static box. You

can then add that sizer to other sizers as needed to implement the rest
of your layout.


Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!


To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org

For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org