Overlapping a Static Box with a wxGrid control

You can add more than one item to a sizer:
sizer = wx.BoxSizer(wx.VERTICAL)
sizer.Add(myStaticCtl)
sizer.Add(myGridCtl, 1, wx.EXPAND, 4)
self.setSizer(sizer)
sizer.Fit(self)

The "1" is a measure of the weight given to the control when laying it out, and EXPAND says to expand the control. "4" is a margin.

The trick with sizers is that they can be nested. Instead of a control, they can also take another sizer or a spacer in the form (x,y). For example, you could add a row of buttons to the above with
hsizer = BoxSizer(wx.HORIZONTAL)
hsizer.Add(myButton1)
hsizer.Add(myButton2)
hsizer.Add(myButton3)
sizer.Add(hsizer)

(However, you say "overlapping". I hope you didn't mean that you want the controls to physically overlap each other, because that doesn't work!)

Phil

···

At 12:52 AM 2/21/2007, you 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 ?

Any solution is wellcome.

Thank you again for your great job.

Dear Phil,
I know that the sizers can be nested, but I still need to place the static box and in the center I want to have the grid. Do you know if it is possible to place a sizer on the static box, because this would solve the problem.

Thank you very much,

···