#include "wx/button.h"
#endif
+#include <gtk/gtk.h>
#include "wx/gtk/private.h"
extern bool g_blockEventsOnDrag;
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));
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;
}
void wxToggleButton::DoApplyWidgetStyle(GtkRcStyle *style)
{
- gtk_widget_modify_style(m_widget, style);
- gtk_widget_modify_style(gtk_bin_get_child(GTK_BIN(m_widget)), style);
+ GTKApplyStyle(m_widget, style);
+ GTKApplyStyle(gtk_bin_get_child(GTK_BIN(m_widget)), style);
}
// Get the "best" size for this control.