Refreshing GridBagSizer

Steve S steveshaw89 at
Fri Nov 23 19:48:26 CET 2007

Hey guys,

I'm stuck with using a GridBagSizer (wxPython) in a GUI Dialog and am having
a frustrating time with refreshing it properly.

Essentially, I've got to refresh the contents of the GridBagSizer on
occasion with new values.  The way I'm doing it works 4 times out of 5 but
on the 5th, *all* of the grid objects that are set to various positions in
the GBS are set to (0,0) :|

So, the way I refresh it is that I keep a record of all grid objects
inserted into the GridBagSizer and on refresh, I first iterate through that
list and destroy everything in it.  I then call Clear() and then Layout()
and start adding new grid objects.
i.e. I do this:
for obj in self.gridObjects:
self.gridObjects = []
// Add all new gridObjects, recording them in self.gridObjects

Again, this works most all the time *except* that sometimes all newly added
grid objects will end up at (0,0) in the GBS :|

Am I refreshing it correctly?  Has anybody experienced a similar issue?

I appreciate any help :)
View this message in context:
Sent from the Python - python-list mailing list archive at

More information about the Python-list mailing list