From: Vadim Zeitlin Date: Sun, 27 Feb 2011 12:47:15 +0000 (+0000) Subject: Don't call base class SetLabel() from GTKSetLabelForLabel(). X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/6ea2bc50c8f343b1919c5583706163fd157ddc6f?ds=sidebyside Don't call base class SetLabel() from GTKSetLabelForLabel(). Calling wxControlBase::SetLabel() only from GTKSetLabelForLabel() made its behaviour inconsistent with GTKSetLabelWithMarkupForLabel() and also was redundant in all but two places from which it was called, so remove this call from this function itself and instead add it to its callers where it's really needed. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67054 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/gtk/control.cpp b/src/gtk/control.cpp index 7012a7572c..7fcdb2192e 100644 --- a/src/gtk/control.cpp +++ b/src/gtk/control.cpp @@ -123,9 +123,6 @@ void wxControl::GTKFixSensitivity(bool onlyIfUnderMouse) void wxControl::GTKSetLabelForLabel(GtkLabel *w, const wxString& label) { - // save the original label - wxControlBase::SetLabel(label); - const wxString labelGTK = GTKConvertMnemonics(label); gtk_label_set_text_with_mnemonic(w, wxGTK_CONV(labelGTK)); } @@ -160,6 +157,8 @@ GtkWidget* wxControl::GTKCreateFrame(const wxString& label) void wxControl::GTKSetLabelForFrame(GtkFrame *w, const wxString& label) { + wxControlBase::SetLabel(label); + GtkLabel* labelwidget = GTK_LABEL(gtk_frame_get_label_widget(w)); GTKSetLabelForLabel(labelwidget, label); } diff --git a/src/gtk/radiobut.cpp b/src/gtk/radiobut.cpp index f465958df1..9cb0c7fe16 100644 --- a/src/gtk/radiobut.cpp +++ b/src/gtk/radiobut.cpp @@ -99,6 +99,9 @@ void wxRadioButton::SetLabel( const wxString& label ) { wxCHECK_RET( m_widget != NULL, wxT("invalid radiobutton") ); + // save the original label + wxControlBase::SetLabel(label); + GTKSetLabelForLabel(GTK_LABEL(GTK_BIN(m_widget)->child), label); }