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:
@@ -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
|
||||
|
Reference in New Issue
Block a user