Sizer.GetItem returns None

Hello,

I'm attempting to insert at runtime objects in a sizer but when I try to locate the sizer to add objects sizer.GetItem return none.

mastersizer = self.GetSizer() # OK
itemsizer = masterziser.GetItem(widget) # -> returns None

I also try:

itemsizer = masterziser.GetItem(widget, recursive=True)

TypeError: 'recursive' is an invalid keyword argument for this function

How can get the sizer of an widget?

wx version: '2.8.0.1 (msw-unicode)'

Thanks

···

--
*****************************************
Oswaldo Hernández
oswaldo (@) soft-com (.) es
*****************************************

Oswaldo Hernández wrote:

Hello,

I'm attempting to insert at runtime objects in a sizer but when I try to locate the sizer to add objects sizer.GetItem return none.

I don't think that sizer.GetItem is what you want to use for this, (even if the recursive parameter hadn't been forgotten.) It returns the wx.SizerItem that manages the item, not the Sizer that it belongs to. For that you can use widget.GetContainingSizer.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!