diff --git a/src/gtk/frame.cpp b/src/gtk/frame.cpp index 075ed1e7f6..c0631c4fce 100644 --- a/src/gtk/frame.cpp +++ b/src/gtk/frame.cpp @@ -258,6 +258,10 @@ void wxFrame::OnSize( wxSizeEvent &WXUNUSED(event) ) if ( GetAutoLayout() ) Layout(); else { + // no child: go out ! + if (!GetChildren()->First()) + return; + // do we have exactly one child? wxWindow *child = NULL; for(wxNode *node = GetChildren()->First(); node; node = node->Next()) diff --git a/src/gtk1/frame.cpp b/src/gtk1/frame.cpp index 075ed1e7f6..c0631c4fce 100644 --- a/src/gtk1/frame.cpp +++ b/src/gtk1/frame.cpp @@ -258,6 +258,10 @@ void wxFrame::OnSize( wxSizeEvent &WXUNUSED(event) ) if ( GetAutoLayout() ) Layout(); else { + // no child: go out ! + if (!GetChildren()->First()) + return; + // do we have exactly one child? wxWindow *child = NULL; for(wxNode *node = GetChildren()->First(); node; node = node->Next())