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
This commit is contained in:
Vadim Zeitlin
2002-07-05 13:20:54 +00:00
parent 2ab30ebf65
commit 94f1450956
2 changed files with 22 additions and 2 deletions

View File

@@ -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