X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d6071228a9c77a0353f3723f6a338aa449cedf9e..1a83b9bd10b7d92520c202e6ed6cff2015f13315:/src/common/tbarbase.cpp diff --git a/src/common/tbarbase.cpp b/src/common/tbarbase.cpp index f2310dc1a9..2496b8a974 100644 --- a/src/common/tbarbase.cpp +++ b/src/common/tbarbase.cpp @@ -41,7 +41,7 @@ #include "wx/toolbar.h" // ---------------------------------------------------------------------------- -// wxWindows macros +// wxWidgets macros // ---------------------------------------------------------------------------- BEGIN_EVENT_TABLE(wxToolBarBase, wxControl) @@ -141,6 +141,7 @@ wxToolBarToolBase *wxToolBarBase::DoAddTool(int id, wxCoord WXUNUSED(xPos), wxCoord WXUNUSED(yPos)) { + InvalidateBestSize(); return InsertTool(GetToolsCount(), id, label, bitmap, bmpDisabled, kind, shortHelp, longHelp, clientData); } @@ -621,6 +622,12 @@ void wxToolBarBase::UpdateWindowUI(long flags) { wxWindowBase::UpdateWindowUI(flags); + // There is no sense in updating the toolbar UI + // if the parent window is about to get destroyed + wxWindow *tlw = wxGetTopLevelParent( this ); + if (tlw && wxPendingDelete.Member( tlw )) + return; + wxEvtHandler* evtHandler = GetEventHandler() ; for ( wxToolBarToolsList::compatibility_iterator node = m_tools.GetFirst();