X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/178a12204bcdb9d98af14cc133432c7359b1b969..166bcebb8e87aefb42de52d22d567a8fa316928d:/src/gtk1/bmpbuttn.cpp diff --git a/src/gtk1/bmpbuttn.cpp b/src/gtk1/bmpbuttn.cpp index 2c7762f095..34f5bab890 100644 --- a/src/gtk1/bmpbuttn.cpp +++ b/src/gtk1/bmpbuttn.cpp @@ -149,13 +149,6 @@ bool wxBitmapButton::Create( wxWindow *parent, if (m_bmpNormal.Ok()) { - wxSize newSize = size; - wxSize bestSize = DoGetBestSize(); - if (newSize.x == -1) - newSize.x = bestSize.x; - if (newSize.y == -1) - newSize.y = bestSize.y; - SetSize( newSize.x, newSize.y ); OnSetBitmap(); } @@ -173,10 +166,7 @@ bool wxBitmapButton::Create( wxWindow *parent, m_parent->DoAddChild( this ); - PostCreation(); - InheritAttributes(); - - Show( TRUE ); + PostCreation(size); return TRUE; } @@ -203,18 +193,20 @@ wxString wxBitmapButton::GetLabel() const return wxControl::GetLabel(); } -void wxBitmapButton::ApplyWidgetStyle() +void wxBitmapButton::DoApplyWidgetStyle(GtkRcStyle *style) { if ( !BUTTON_CHILD(m_widget) ) return; - wxButton::ApplyWidgetStyle(); + wxButton::DoApplyWidgetStyle(style); } void wxBitmapButton::OnSetBitmap() { wxCHECK_RET( m_widget != NULL, wxT("invalid bitmap button") ); + InvalidateBestSize(); + wxBitmap the_one; if (!m_isEnabled) the_one = m_bmpDisabled; @@ -268,6 +260,7 @@ wxSize wxBitmapButton::DoGetBestSize() const best.x = m_bmpNormal.GetWidth()+border; best.y = m_bmpNormal.GetHeight()+border; } + CacheBestSize(best); return best; }