+
+ wxString label1(wxStripMenuCodes(label));
+
+ XmString text = XmStringCreateSimple ((char*) (const char*) label1);
+ Widget parentWidget = (Widget) parent->GetClientWidget();
+
+ XmFontList fontList = (XmFontList) m_windowFont.GetFontList(1.0, XtDisplay(parentWidget));
+
+ /*
+ * Patch Note (important)
+ * There is no major reason to put a defaultButtonThickness here.
+ * Not requesting it give the ability to put wxButton with a spacing
+ * as small as requested. However, if some button become a DefaultButton,
+ * other buttons are no more aligned -- This is why we set
+ * defaultButtonThickness of ALL buttons belonging to the same wxPanel,
+ * in the ::SetDefaultButton method.
+ */
+ m_mainWidget = (WXWidget) XtVaCreateManagedWidget ("button",
+ xmPushButtonWidgetClass,
+ parentWidget,
+ XmNfontList, fontList,
+ XmNlabelString, text,
+ // XmNdefaultButtonShadowThickness, 1, // See comment for wxButton::SetDefault
+ NULL);
+
+ XmStringFree (text);
+
+ XtAddCallback ((Widget) m_mainWidget, XmNactivateCallback, (XtCallbackProc) wxButtonCallback,
+ (XtPointer) this);
+
+ SetCanAddEventHandler(TRUE);
+ AttachWidget (parent, m_mainWidget, (WXWidget) NULL, pos.x, pos.y, size.x, size.y);
+
+ ChangeBackgroundColour();
+
+ return TRUE;