+ Widget parentWidget = (Widget) parent->GetClientWidget();
+
+ m_mainWidget = XtVaCreateWidget ("radioboxframe",
+ xmFrameWidgetClass, parentWidget,
+ XmNshadowType, XmSHADOW_IN,
+ XmNresizeHeight, True,
+ XmNresizeWidth, True,
+ NULL);
+
+ wxString label1(wxStripMenuCodes(title));
+
+ XmFontList fontList = (XmFontList) m_font.GetFontList(1.0, XtDisplay(parentWidget));
+
+ if (label1 != "")
+ {
+ wxXmString text(label1);
+ (void)XtVaCreateManagedWidget(label1.c_str(),
+#if wxUSE_GADGETS
+ style & wxCOLOURED ? xmLabelWidgetClass
+ : xmLabelGadgetClass,
+ (Widget)m_mainWidget,
+#else
+ xmLabelWidgetClass, (Widget)m_mainWidget,
+#endif
+ XmNfontList, fontList,
+ 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);
+
+ Widget radioBoxWidget = XmCreateRadioBox ((Widget)m_mainWidget, "radioBoxWidget", args, 2);
+
+ // if (style & wxFLAT)
+ // XtVaSetValues (radioBoxWidget, XmNborderWidth, 1, NULL);
+
+ m_radioButtons = new WXWidget[n];
+ m_radioButtonLabels = new wxString[n];
+ int i;
+ for (i = 0; i < n; i++)
+ {
+ wxString str(wxStripMenuCodes(choices[i]));
+ m_radioButtonLabels[i] = str;
+ m_radioButtons[i] = (WXWidget) XtVaCreateManagedWidget ((char*) (const char*) str,
+#if wxUSE_GADGETS
+ xmToggleButtonGadgetClass, radioBoxWidget,
+#else
+ xmToggleButtonWidgetClass, radioBoxWidget,
+#endif
+ XmNfontList, fontList,
+ NULL);
+ XtAddCallback ((Widget) m_radioButtons[i], XmNvalueChangedCallback, (XtCallbackProc) wxRadioBoxCallback,
+ (XtPointer) this);
+ }