X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/906c935a80b10d53cecf57f71ab5f3f4f1d529ec..ab7049776d45e622f621dd06216a4c1a1ad34b15:/src/gtk/tglbtn.cpp diff --git a/src/gtk/tglbtn.cpp b/src/gtk/tglbtn.cpp index 4886ce1fcc..47a55a53af 100644 --- a/src/gtk/tglbtn.cpp +++ b/src/gtk/tglbtn.cpp @@ -166,6 +166,14 @@ void wxToggleButton::SetLabel(const wxString& label) wxAnyButton::SetLabel(label); + if ( HasFlag(wxBU_NOTEXT) ) + { + // Don't try to update the label for a button not showing it, this is + // unnecessary and can also actually replace the image we show with the + // label entirely breaking the button code, see #13693. + return; + } + const wxString labelGTK = GTKConvertMnemonics(label); gtk_button_set_label(GTK_BUTTON(m_widget), wxGTK_CONV(labelGTK)); @@ -184,10 +192,13 @@ bool wxToggleButton::DoSetLabelMarkup(const wxString& markup) wxControl::SetLabel(stripped); - GtkLabel * const label = GTKGetLabel(); - wxCHECK_MSG( label, false, "no label in this toggle button?" ); + if ( !HasFlag(wxBU_NOTEXT) ) + { + GtkLabel * const label = GTKGetLabel(); + wxCHECK_MSG( label, false, "no label in this toggle button?" ); - GTKSetLabelWithMarkupForLabel(label, markup); + GTKSetLabelWithMarkupForLabel(label, markup); + } return true; }