[wxpython-users] GridBagSizer

E. A. Tacao e.a.tacao at estadao.com.br
Thu Apr 3 05:00:54 PDT 2008


Thursday, April 3, 2008, 3:59:24 AM, Werner F. Bruhin wrote:

> The Boa GUI designer when working with a gridbagsizer does:

> gbs.GetChildren()  this returns a list of wxGBSizerItem

> I just tested this and it works in 2.8.4.0, however when I try it with
> 2.8.7.1 I get an exception.

> Problem seems that gbs.GetChildren() returns wx.SizerItem instead of 
> wxGBSizerItem.

> I guess that this was introduced in 2.8.4.2 by the change listed first
> "Added some SWIG magic that allows wx C++ lists to be exposed to 
> wxPython as sequence-like wrappers around the real list,.....".

> If my guess is correct is there a way to get the wxGBSizerItem?


I also noticed that change and I´m currently using the following
workaround to fetch the wxGBSizerItems:

        # my_gbs is the GridBagSizer in question
        
        windows = my_gbs.GetContainingWindow().GetChildren()
        gbsizeritems = []
        for window in windows:
            item = self.FindItem(window)
            gbsizeritems.append(item)

       # now gbsizeritems is a list of wxGBSizerItems...


-- tacao

No bits were harmed during the making of this e-mail. 



More information about the wxpython-users mailing list