diff --git a/src/gtk/frame.cpp b/src/gtk/frame.cpp index 1b4e646433..48b191aaa0 100644 --- a/src/gtk/frame.cpp +++ b/src/gtk/frame.cpp @@ -605,9 +605,11 @@ wxToolBar* wxFrame::CreateToolBar( long style, wxWindowID id, const wxString& na void wxFrame::SetToolBar(wxToolBar *toolbar) { + bool hadTbar = m_frameToolBar != NULL; + wxFrameBase::SetToolBar(toolbar); - if (m_frameToolBar) + if ( m_frameToolBar ) { // insert into toolbar area if not already there if ((m_frameToolBar->m_widget->parent) && @@ -619,6 +621,14 @@ void wxFrame::SetToolBar(wxToolBar *toolbar) GtkUpdateSize(); } } + else // toolbar unset + { + // still need to update size if it had been there before + if ( hadTbar ) + { + GtkUpdateSize(); + } + } } #endif // wxUSE_TOOLBAR diff --git a/src/gtk1/frame.cpp b/src/gtk1/frame.cpp index 1b4e646433..48b191aaa0 100644 --- a/src/gtk1/frame.cpp +++ b/src/gtk1/frame.cpp @@ -605,9 +605,11 @@ wxToolBar* wxFrame::CreateToolBar( long style, wxWindowID id, const wxString& na void wxFrame::SetToolBar(wxToolBar *toolbar) { + bool hadTbar = m_frameToolBar != NULL; + wxFrameBase::SetToolBar(toolbar); - if (m_frameToolBar) + if ( m_frameToolBar ) { // insert into toolbar area if not already there if ((m_frameToolBar->m_widget->parent) && @@ -619,6 +621,14 @@ void wxFrame::SetToolBar(wxToolBar *toolbar) GtkUpdateSize(); } } + else // toolbar unset + { + // still need to update size if it had been there before + if ( hadTbar ) + { + GtkUpdateSize(); + } + } } #endif // wxUSE_TOOLBAR