+void wxSizer::SetContainingWindow(wxWindow *win)
+{
+ if ( win == m_containingWindow )
+ return;
+
+ m_containingWindow = win;
+
+ // set the same window for all nested sizers as well, they also are in the
+ // same window
+ for ( wxSizerItemList::compatibility_iterator node = m_children.GetFirst();
+ node;
+ node = node->GetNext() )
+ {
+ wxSizerItem *const item = node->GetData();
+ wxSizer *const sizer = item->GetSizer();
+
+ if ( sizer )
+ {
+ sizer->SetContainingWindow(win);
+ }
+ }
+}
+