]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/bmpbuttn.cpp
Fix for toolbar workaround (mustn't set flag unless we're in Classic mode
[wxWidgets.git] / src / gtk1 / bmpbuttn.cpp
index 8be33e83f7de06ef90ce59e4eab8892a1759f024..795f5c5eb924de6116c1a7dd602b9988bd3cee04 100644 (file)
@@ -137,10 +137,7 @@ bool wxBitmapButton::Create( wxWindow *parent,
         return FALSE;
     }
 
-    m_bmpNormal   =
-    m_bmpDisabled =
-    m_bmpFocus    =
-    m_bmpSelected = bitmap;
+    m_bmpNormal = bitmap;
 
     m_widget = gtk_button_new();
 
@@ -184,7 +181,6 @@ void wxBitmapButton::SetLabel( const wxString &label )
     wxCHECK_RET( m_widget != NULL, wxT("invalid button") );
 
     wxControl::SetLabel( label );
-    PostSetLabel();
 }
 
 wxString wxBitmapButton::GetLabel() const
@@ -206,6 +202,8 @@ void wxBitmapButton::OnSetBitmap()
 {
     wxCHECK_RET( m_widget != NULL, wxT("invalid bitmap button") );
 
+    InvalidateBestSize();
+    
     wxBitmap the_one;
     if (!m_isEnabled)
         the_one = m_bmpDisabled;
@@ -259,6 +257,7 @@ wxSize wxBitmapButton::DoGetBestSize() const
         best.x = m_bmpNormal.GetWidth()+border;
         best.y = m_bmpNormal.GetHeight()+border;
     }
+    CacheBestSize(best);
     return best;
 }