From 94f145095605aa3aafaab289b9d3e1630587f821 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 5 Jul 2002 13:20:54 +0000 Subject: [PATCH] fixed SetToolBar(NULL) behaviour -- don't leave a hole from toolbar git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16044 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/frame.cpp | 12 +++++++++++- src/gtk1/frame.cpp | 12 +++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) 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 -- 2.45.2