-#ifdef __WXGTK20__
- wxString label2 = PrepareLabelMnemonics( label );
- gtk_button_set_label( GTK_BUTTON(m_widget), wxGTK_CONV(label2) );
-#else
- gtk_label_set( GTK_LABEL( BUTTON_CHILD(m_widget) ), wxGTK_CONV( GetLabel() ) );
-#endif
+ 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 );