/* Generated by wbuild from "RadioGrp.w"
** (generator version $Revision: 2.5 $ of $Date: 94/07/29 15:31:49 $)
*/
#include <X11/IntrinsicP.h>
#include <X11/StringDefs.h>
#line 83 "RadioGrp.w"
#include <Xfwf/Toggle.h>
#include <Xfwf/RadioGrpP.h>
static void _resolve_inheritance(
#if NeedFunctionPrototypes
WidgetClass
#endif
);
#line 38 "RadioGrp.w"
static void initialize(
#if NeedFunctionPrototypes
Widget ,Widget,ArgList ,Cardinal *
#endif
);
#line 48 "RadioGrp.w"
static Boolean  set_values(
#if NeedFunctionPrototypes
Widget ,Widget ,Widget,ArgList ,Cardinal *
#endif
);
#line 64 "RadioGrp.w"
static void create_toggles(
#if NeedFunctionPrototypes
Widget
#endif
);
#line 64 "RadioGrp.w"
/*ARGSUSED*/static void create_toggles(self)Widget self;
{
    Cardinal i;
    StringArray s;

    for (i = 0; i < ((XfwfRadioGroupWidget)self)->composite.num_children; i++) 
	XtDestroyWidget(((XfwfRadioGroupWidget)self)->composite.children[i]);

    if (((XfwfRadioGroupWidget)self)->xfwfRadioGroup.labels == NULL) return;

    for (s = ((XfwfRadioGroupWidget)self)->xfwfRadioGroup.labels, i = 0; s[i] != NULL; i++) {
	(void) XtVaCreateManagedWidget
	    (s[i], xfwfToggleWidgetClass, self, XtNlabel, s[i], XtNshrinkToFit,
	     True, XtNborderWidth, 0, XtNframeWidth, 0, NULL);
    }
}

static XtResource resources[] = {
#line 29 "RadioGrp.w"
{XtNlabels,XtCLabels,XtRStringArray,sizeof(((XfwfRadioGroupRec*)NULL)->xfwfRadioGroup.labels),XtOffsetOf(XfwfRadioGroupRec,xfwfRadioGroup.labels),XtRImmediate,(XtPointer)NULL },
};

XfwfRadioGroupClassRec xfwfRadioGroupClassRec = {
{ /* core_class part */
(WidgetClass) &xfwfGroupClassRec,
"XfwfRadioGroup",
sizeof(XfwfRadioGroupRec),
NULL,
_resolve_inheritance,
FALSE,
initialize,
NULL,
XtInheritRealize,
NULL,
0,
resources,
1,
NULLQUARK,
True ,
XtExposeCompressMultiple ,
True ,
False ,
NULL,
XtInheritResize,
XtInheritExpose,
set_values,
NULL,
XtInheritSetValuesAlmost,
NULL,
XtInheritAcceptFocus,
XtVersion,
NULL,
NULL,
XtInheritQueryGeometry,
XtInheritDisplayAccelerator,
NULL 
},
{ /* composite_class part */
XtInheritGeometryManager,
XtInheritChangeManaged,
XtInheritInsertChild,
XtInheritDeleteChild,
NULL
},
{ /* XfwfCommon_class part */
XtInherit_compute_inside,
XtInherit_total_frame_width,
XtInherit_highlight_border,
XtInherit_unhighlight_border,
XtInherit_would_accept_focus,
XtInherit_traverse,
XtInherit_lighter_color,
XtInherit_darker_color,
NULL ,
},
{ /* XfwfFrame_class part */
0
},
{ /* XfwfBoard_class part */
XtInherit_set_abs_location,
},
{ /* XfwfRowCol_class part */
XtInherit_layout,
},
{ /* XfwfGroup_class part */
0
},
{ /* XfwfRadioGroup_class part */
0
},
};
WidgetClass xfwfRadioGroupWidgetClass = (WidgetClass) &xfwfRadioGroupClassRec;
static void _resolve_inheritance(class)
WidgetClass class;
{
  XfwfRadioGroupWidgetClass c = (XfwfRadioGroupWidgetClass) class;
  XfwfRadioGroupWidgetClass super;
  static CompositeClassExtensionRec extension_rec = {
    NULL, NULLQUARK, XtCompositeExtensionVersion,
    sizeof(CompositeClassExtensionRec), True};
  CompositeClassExtensionRec *ext;
  ext = (XtPointer)XtMalloc(sizeof(*ext));
  *ext = extension_rec;
  ext->next_extension = c->composite_class.extension;
  c->composite_class.extension = ext;
  if (class == xfwfRadioGroupWidgetClass) return;
  super = (XfwfRadioGroupWidgetClass)class->core_class.superclass;
}
#line 38 "RadioGrp.w"
/*ARGSUSED*/static void initialize(request,self,args,num_args)Widget  request;Widget self;ArgList  args;Cardinal * num_args;
{
    ((XfwfRadioGroupWidget)self)->xfwfRadioGroup.labels = newStringArray(((XfwfRadioGroupWidget)self)->xfwfRadioGroup.labels);
    create_toggles(self);
}
#line 48 "RadioGrp.w"
/*ARGSUSED*/static Boolean  set_values(old,request,self,args,num_args)Widget  old;Widget  request;Widget self;ArgList  args;Cardinal * num_args;
{
    if (((XfwfRadioGroupWidget)old)->xfwfRadioGroup.labels != ((XfwfRadioGroupWidget)self)->xfwfRadioGroup.labels) {
	freeStringArray(((XfwfRadioGroupWidget)old)->xfwfRadioGroup.labels);
	((XfwfRadioGroupWidget)self)->xfwfRadioGroup.labels = newStringArray(((XfwfRadioGroupWidget)self)->xfwfRadioGroup.labels);
	create_toggles(self);
    }
    return False;
}
#line 87 "RadioGrp.w"
