+
+ wxString label(lbl);
+
+ if (label.empty() && wxIsStockID(m_windowId))
+ label = wxGetStockLabel(m_windowId);
+
+ wxAnyButton::SetLabel(label);
+
+ // don't use label if it was explicitly disabled
+ if ( HasFlag(wxBU_NOTEXT) )
+ return;
+
+ if (wxIsStockID(m_windowId) && wxIsStockLabel(m_windowId, label))
+ {
+ const char *stock = wxGetStockGtkID(m_windowId);
+ if (stock)
+ {
+ gtk_button_set_label(GTK_BUTTON(m_widget), stock);
+ gtk_button_set_use_stock(GTK_BUTTON(m_widget), TRUE);
+ return;
+ }
+ }
+
+ // this call is necessary if the button had been initially created without
+ // a (text) label -- then we didn't use gtk_button_new_with_mnemonic() and
+ // so "use-underline" GtkButton property remained unset
+ gtk_button_set_use_underline(GTK_BUTTON(m_widget), TRUE);
+ const wxString labelGTK = GTKConvertMnemonics(label);
+ gtk_button_set_label(GTK_BUTTON(m_widget), wxGTK_CONV(labelGTK));
+ gtk_button_set_use_stock(GTK_BUTTON(m_widget), FALSE);
+
+ GTKApplyWidgetStyle( false );
+}
+
+#if wxUSE_MARKUP
+bool wxButton::DoSetLabelMarkup(const wxString& markup)
+{
+ wxCHECK_MSG( m_widget != NULL, false, "invalid button" );
+
+ const wxString stripped = RemoveMarkup(markup);
+ if ( stripped.empty() && !markup.empty() )
+ return false;
+
+ wxControl::SetLabel(stripped);
+
+ GtkLabel * const label = GTKGetLabel();
+ wxCHECK_MSG( label, false, "no label in this button?" );
+
+ GTKSetLabelWithMarkupForLabel(label, markup);
+
+ return true;