+ m_needParent = true;
+ m_acceptsFocus = true;
+
+ 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_label("");
+
+ 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;
+
+ if (GTK_IS_MISC(BUTTON_CHILD(m_widget)))
+ gtk_misc_set_alignment (GTK_MISC (BUTTON_CHILD (m_widget)),
+ x_alignment, y_alignment);
+
+ SetLabel(label);
+
+ if (style & wxNO_BORDER)
+ gtk_button_set_relief( GTK_BUTTON(m_widget), GTK_RELIEF_NONE );
+
+ gtk_signal_connect_after( GTK_OBJECT(m_widget), "clicked",
+ GTK_SIGNAL_FUNC(gtk_button_clicked_callback), (gpointer*)this );
+
+ gtk_signal_connect_after( GTK_OBJECT(m_widget), "style_set",
+ GTK_SIGNAL_FUNC(gtk_button_style_set_callback), (gpointer*) this );
+
+ m_parent->DoAddChild( this );
+
+ PostCreation(size);
+
+ return true;
+}
+
+
+void wxButton::SetDefault()
+{
+ wxTopLevelWindow *tlw = wxDynamicCast(wxGetTopLevelParent(this), wxTopLevelWindow);
+ wxCHECK_RET( tlw, _T("button without top level window?") );