Why does sizer.GetChildren return SizerItems instead of widgets?

Showing 1-3 of 3 messages
Why does sizer.GetChildren return SizerItems instead of widgets? Mike Driscoll 8/22/12 6:24 AM
Hi,

I was attempting to help someone on StackOverflow yesterday (see http://stackoverflow.com/q/12031522/393194) and they were trying to get the children of a BoxSizer using its GetChildren method. This returns a list of SizerItems instead of the actual widgets though. Is there a way to get the widgets like you do when you call a panel's GetChildren method?

- Mike
Re: [wxPython-users] Why does sizer.GetChildren return SizerItems instead of widgets? Cody Precord 8/22/12 6:32 AM
Hi,
Because the 'children' of a sizer may not all be windows/widgets. They
may be other sizers, spacers, ect...

Each of the SizerItem's has a reference to the Window object it
manages if it has one. Use either the Window property or GetWindow
method.


Cody
Re: [wxPython-users] Why does sizer.GetChildren return SizerItems instead of widgets? Mike Driscoll 8/22/12 7:32 AM

GetWindow? I knew I should have tried that, but I figured that would just return the frame or panel. Thanks Cody!

- Mike