X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fe161a2685012cf90bb5bfe95f2260aee71d8ad7..ab86c659ac3093dc5513ff0c5001d2fa2979b30c:/src/gtk1/tglbtn.cpp diff --git a/src/gtk1/tglbtn.cpp b/src/gtk1/tglbtn.cpp index 7bccf53080..cb4db530d7 100644 --- a/src/gtk1/tglbtn.cpp +++ b/src/gtk1/tglbtn.cpp @@ -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; } @@ -287,8 +289,6 @@ void wxToggleButton::SetLabel(const wxString& label) wxControl::SetLabel(label); gtk_label_set(GTK_LABEL(BUTTON_CHILD(m_widget)), wxGTK_CONV( GetLabel() ) ); - - PostSetLabel(); } bool wxToggleButton::Enable(bool enable /*=TRUE*/) @@ -334,7 +334,7 @@ void wxToggleButton::OnInternalIdle() UpdateWindowUI(wxUPDATE_UI_FROMIDLE); } -// wxSize DoGetBestSize() const + // Get the "best" size for this control. wxSize wxToggleButton::DoGetBestSize() const { @@ -345,8 +345,8 @@ wxSize wxToggleButton::DoGetBestSize() const if (ret.x < 80) ret.x = 80; } - - return ret; + CacheBestSize(ret); + return ret; } // static