]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/tbarbase.cpp
SetBackgroundStyle(wxBG_STYLE_CUSTOM) can now be used to optimize
[wxWidgets.git] / src / common / tbarbase.cpp
index d78bcf6fe8886713369a32749aa535d49b2a9da3..2496b8a9749f95617a530d51c375fd42025ffa78 100644 (file)
@@ -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);
 }
@@ -623,7 +624,8 @@ void wxToolBarBase::UpdateWindowUI(long flags)
 
     // There is no sense in updating the toolbar UI
     // if the parent window is about to get destroyed
-    if (GetParent() && wxPendingDelete.Member( GetParent() ))
+    wxWindow *tlw = wxGetTopLevelParent( this );
+    if (tlw && wxPendingDelete.Member( tlw ))
         return;
 
     wxEvtHandler* evtHandler = GetEventHandler() ;