+ if (!PreCreation( parent, pos, size ) ||
+ !CreateBase( parent, id, pos, size, style, validator, name ))
+ {
+ wxFAIL_MSG( wxT("wxButton creation failed") );
+ return false;
+ }
+
+ m_widget = gtk_button_new_with_mnemonic("");
+
+ float x_alignment = 0.5;
+ if (HasFlag(wxBU_LEFT))
+ x_alignment = 0.0;
+ else if (HasFlag(wxBU_RIGHT))
+ x_alignment = 1.0;
+
+ float y_alignment = 0.5;
+ if (HasFlag(wxBU_TOP))
+ y_alignment = 0.0;
+ else if (HasFlag(wxBU_BOTTOM))
+ y_alignment = 1.0;
+
+ gtk_button_set_alignment(GTK_BUTTON(m_widget), x_alignment, y_alignment);
+
+ SetLabel(label);
+
+ if (style & wxNO_BORDER)
+ gtk_button_set_relief( GTK_BUTTON(m_widget), GTK_RELIEF_NONE );
+
+ g_signal_connect_after (m_widget, "clicked",
+ G_CALLBACK (gtk_button_clicked_callback),
+ this);
+
+ g_signal_connect_after (m_widget, "style_set",
+ G_CALLBACK (gtk_button_style_set_callback),
+ this);
+
+ m_parent->DoAddChild( this );
+
+ PostCreation(size);
+
+ return true;
+}
+
+
+wxWindow *wxButton::SetDefault()
+{
+ wxWindow *oldDefault = wxButtonBase::SetDefault();
+
+ GTK_WIDGET_SET_FLAGS( m_widget, GTK_CAN_DEFAULT );
+ gtk_widget_grab_default( m_widget );
+
+ // resize for default border
+ gtk_button_style_set_callback( m_widget, NULL, this );
+
+ return oldDefault;