+ if (!label1.empty())
+ {
+ wxXmString text(label1);
+ m_labelWidget = (WXWidget)
+ XtVaCreateManagedWidget( label1.c_str(),
+#if wxUSE_GADGETS
+ style & wxCOLOURED ? xmLabelWidgetClass
+ : xmLabelGadgetClass,
+ (Widget)m_mainWidget,
+#else
+ xmLabelWidgetClass, (Widget)m_mainWidget,
+#endif
+ wxFont::GetFontTag(), m_font.GetFontTypeC(dpy),
+ XmNlabelString, text(),
+// XmNframeChildType is not in Motif 1.2, nor in Lesstif,
+// if it was compiled with 1.2 compatibility
+// TODO: check this still looks OK for Motif 1.2.
+#if (XmVersion > 1200)
+ XmNframeChildType, XmFRAME_TITLE_CHILD,
+#else
+ XmNchildType, XmFRAME_TITLE_CHILD,
+#endif
+ XmNchildVerticalAlignment, XmALIGNMENT_CENTER,
+ NULL);
+ }
+
+ Arg args[3];
+
+ m_majorDim = (n + m_majorDim - 1) / m_majorDim;
+
+ XtSetArg (args[0], XmNorientation, ((style & wxHORIZONTAL) == wxHORIZONTAL ?
+ XmHORIZONTAL : XmVERTICAL));
+ XtSetArg (args[1], XmNnumColumns, m_majorDim);
+ XtSetArg (args[2], XmNadjustLast, False);
+
+ Widget radioBoxWidget =
+ XmCreateRadioBox ((Widget)m_mainWidget, wxMOTIF_STR("radioBoxWidget"), args, 3);
+
+ m_radioButtons.reserve(n);
+ m_radioButtonLabels.reserve(n);
+
+ int i;
+ for (i = 0; i < n; i++)
+ {
+ wxString str(wxStripMenuCodes(choices[i]));
+ m_radioButtonLabels.push_back(str);
+ Widget radioItem = XtVaCreateManagedWidget (
+ wxConstCast(str.c_str(), char),
+#if wxUSE_GADGETS
+ xmToggleButtonGadgetClass, radioBoxWidget,
+#else
+ xmToggleButtonWidgetClass, radioBoxWidget,
+#endif
+ wxFont::GetFontTag(), m_font.GetFontTypeC(dpy),
+ NULL);
+ m_radioButtons.push_back((WXWidget)radioItem);
+ XtAddCallback (radioItem, XmNvalueChangedCallback,
+ (XtCallbackProc) wxRadioBoxCallback,
+ (XtPointer) this);
+ }
+
+ ChangeFont(false);
+
+ SetSelection (0);
+
+ XtRealizeWidget((Widget)m_mainWidget);
+ XtManageChild (radioBoxWidget);
+ XtManageChild ((Widget)m_mainWidget);
+
+ AttachWidget (parent, m_mainWidget, NULL, pos.x, pos.y, size.x, size.y);
+
+ ChangeBackgroundColour();
+
+ return true;