X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c0e6c0513862fc9a33e5800526058193b7492d8b..a685a06c96085e01d0b38432eac2ec0b887c2dcb:/src/gtk1/tglbtn.cpp

diff --git a/src/gtk1/tglbtn.cpp b/src/gtk1/tglbtn.cpp
index 8ac7ec5a3c..973299339a 100644
--- a/src/gtk1/tglbtn.cpp
+++ b/src/gtk1/tglbtn.cpp
@@ -7,7 +7,7 @@
 // Created:     08.02.01
 // RCS-ID:      $Id$
 // Copyright:   (c) 2000 Johnny C. Norris II
-// License:     Rocketeer license
+// License:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 // For compilers that support precompilation, includes "wx.h".
@@ -123,6 +123,7 @@ void wxToggleBitmapButton::SetLabel(const wxBitmap& label)
     wxCHECK_RET(m_widget != NULL, wxT("invalid toggle button"));
 
     m_bitmap = label;
+    InvalidateBestSize();
     
     OnSetBitmap();
 }
@@ -192,7 +193,7 @@ void wxToggleBitmapButton::OnInternalIdle()
         UpdateWindowUI(wxUPDATE_UI_FROMIDLE);
 }
 
-// wxSize DoGetBestSize() const
+
 // Get the "best" size for this control.
 wxSize wxToggleBitmapButton::DoGetBestSize() const
 {
@@ -204,6 +205,7 @@ wxSize wxToggleBitmapButton::DoGetBestSize() const
         best.x = m_bitmap.GetWidth()+border;
         best.y = m_bitmap.GetHeight()+border;
     }
+    CacheBestSize(best);
     return best;
 }
 
@@ -332,7 +334,7 @@ void wxToggleButton::OnInternalIdle()
         UpdateWindowUI(wxUPDATE_UI_FROMIDLE);
 }
 
-// wxSize DoGetBestSize() const
+
 // Get the "best" size for this control.
 wxSize wxToggleButton::DoGetBestSize() const
 {
@@ -343,8 +345,8 @@ wxSize wxToggleButton::DoGetBestSize() const
         if (ret.x < 80) ret.x = 80;
     }
     
-
-   return ret;
+    CacheBestSize(ret);
+    return ret;
 }
 
 // static