[wxpython-users] GridBagSizer
Werner F. Bruhin
werner.bruhin at free.fr
Thu Apr 3 07:43:07 PDT 2008
Tacao,
E. A. Tacao wrote:
> 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...
>
Thanks for this.
Will wait and see what Robin has to say on this before making any
changes. In the meantime I run Boa against 2.8.4.2, which is no big
deal for me.
Werner
More information about the wxpython-users
mailing list