Path: utzoo!utgpu!mnetor!david From: david@mnetor.UUCP (David So) Newsgroups: comp.windows.x.motif Subject: Re: writing Widgets with Float resources Message-ID: <5858@mnetor.UUCP> Date: 31 May 91 18:17:47 GMT References: <13743@dog.ee.lbl.gov> Reply-To: david@mnetor.UUCP (David So) Organization: Motorola Technical Systems Division, Toronto Design Centre Lines: 29 In article <13743@dog.ee.lbl.gov> anderson@rubato.lbl.gov () writes: = =>I have started to write a few Motif widgets (subclassing Primitive, =>for instance), and have things working fine as long as various =>resources are "ints" (XmRInt type resources). But I need them =>to be "floats" (XmRFloat types). = = If sizeof(float) is the same as sizeof(long) for your compiler, then the problem is with the compiler trying to cast a float value to long/int. Try this to see if that helps: XtSetArg(arg, resource_name, *((long *)&float_value)); or XtSetArg(arg, resource_name, *((int *)&float_value)); =>Has anyone successfully created a widget of their own using some =>float resources? I find it a bit odd that even OSF doesn't seem =>to have any. = = 'float' resource was quite a recent feature that didn't exist in the early stage of Intrinsics development when Motif widgets were designed. -- David So