I have a GridBagSizer (sizer) with w x h bottons (one each cell),
I would like to destroy all buttons to reload them (with different w & h):
for row in range(h):
for c in range(w):
item = sizer.FindItemAtPosition((row, c))
if item:
obj = item.GetWindow()
sizer.Detach(obj)
obj.Destroy()
self.SetSizerAndFit(sizer)
for a in range(t):
button[a] = BitmapButton(self, id=a, bitmap=backImage, size=(xIm, yIm))
RegisterId(a)
sizer.Add(button[a], ( a/w, (a-(a/w)*w) ))
self.Bind(EVT_BUTTON, self.OnButtonClick1, button[a])
sizer.Fit(self)
[complete code on http://sourceforge.net/projects/pmemory/]
A few positions (where I expect buttons) are left empty in Windows,
while the code works as expected in Linux.
rosros
···
--
Email.it, the professional e-mail, gratis per te: http://www.email.it/f
Sponsor:
Scopri il Blog di Email.it: curiosità , tendenze, storie in diretta dal Web
Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=8135&d=31-7