+ if( !CreateControl( parent, id, pos, size, style, validator, name ) )
+ return false;
+ PreCreation();
+
+ Widget parentWidget = (Widget) parent->GetClientWidget();
+ Display* dpy = XtDisplay(parentWidget);
+
+ wxString label1(GetLabelText(label));
+
+ wxXmString text( label1 );
+
+ Widget radioButtonWidget = XtVaCreateManagedWidget ("toggle",
+#if wxUSE_GADGETS
+ xmToggleButtonGadgetClass, parentWidget,
+#else
+ xmToggleButtonWidgetClass, parentWidget,
+#endif
+ wxFont::GetFontTag(), m_font.GetFontTypeC(dpy),
+ XmNlabelString, text(),
+ XmNfillOnSelect, True,
+ XmNindicatorType, XmONE_OF_MANY, // diamond-shape
+ NULL);
+
+ XtAddCallback (radioButtonWidget,
+ XmNvalueChangedCallback,
+ (XtCallbackProc)wxRadioButtonCallback,
+ (XtPointer)this);
+
+ m_mainWidget = (WXWidget) radioButtonWidget;
+
+ XtManageChild (radioButtonWidget);
+
+ PostCreation();
+ AttachWidget (parent, m_mainWidget, (WXWidget) NULL,
+ pos.x, pos.y, size.x, size.y);
+
+ //copied from mac/radiobut.cpp (from here till "return true;")
+ m_cycle = this ;
+
+ if (HasFlag(wxRB_GROUP))
+ {
+ AddInCycle( NULL ) ;
+ }
+ else
+ {
+ /* search backward for last group start */
+ wxRadioButton *chief = (wxRadioButton*) NULL;
+ wxWindowList::compatibility_iterator node = parent->GetChildren().GetLast();
+ while (node)
+ {
+ wxWindow *child = node->GetData();
+ if (child->IsKindOf( CLASSINFO( wxRadioButton ) ) )
+ {
+ chief = (wxRadioButton*) child;
+ if (child->HasFlag(wxRB_GROUP)) break;
+ }
+ node = node->GetPrevious();
+ }
+ AddInCycle( chief ) ;
+ }
+ return true;