Re[2]: clearing the contents of a GridSizer

Thanks, Tacao.

That works, though I still have the original issue with the sizer containing self.sizers["ParamEntries"] not resizing properly to display it.

-mike

···

At 08:31 PM 11/3/2005, you wrote:

items = self.sizers["ParamEntries"].GetChildren()

for item in items:
     child = item.GetWindow()
     self.sizers["ParamEntries"].Detach(child)
     child.Destroy()

Wow, thanks a lot for send me the code Tacao! I changed around the layout of the GUI and also changed the gridSizer clearing code to not get rid of a few staticText controls and this seems to have done the trick, but I have incorporated the Refresh call just in case.

Again, thanks for all your help,
-mike

···

At 10:12 PM 11/3/2005, you wrote:

Friday, November 4, 2005, 12:34:26 AM, mike cantor wrote:

> That works, though I still have the original issue with the sizer
> containing self.sizers["ParamEntries"] not resizing properly to
> display it.

I couldn't figure the problem, but I attached a small working app that
I hope may help.

It destroys and repopulates a row of items whenever you click on the
top button. (When its label is "Clear", it will destroy the row of
controls and changes its label to "Refill"; when it's label is
"Refill", it repopulates the row.)

I tried to reproduce your layout (sizers and a gridsizer inside a
boxsizer.)

The controls are randomly chosen during refill on purpose: each one
of the possible choices has a different size (but the layout will
remain unchanged).

You'll see that the position of the last row won't change, but the
responsible for this is the line #22. If you comment out that line,
the sizer's min size will be the undocummented sizer's default min
size, which seems to be (10, 10).

The line #75 may be needed to work around a small bug (one of the
sizers won't display its controls correctly after a
Detach/Add/Layout) that seems to happen with gridsizer.

Hope this helps.

-- tacao

No bits were harmed during the making of this e-mail.
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org