Path: utzoo!attcan!uunet!cs.utexas.edu!rutgers!apple!sun-barr!decwrl!ucbvax!bloom-beacon!ATHENA.MIT.EDU!swick From: swick@ATHENA.MIT.EDU (Ralph R. Swick) Newsgroups: comp.windows.x Subject: Re: XtConvert & SetValues for floats Message-ID: <8907260505.AA26883@LYRE.MIT.EDU> Date: 26 Jul 89 05:05:04 GMT References: <14000@lanl.gov> Sender: daemon@bloom-beacon.MIT.EDU Organization: DEC/MIT Project Athena Lines: 15 > The initialize procedure assigns the correct default values, but when I > try to do a set_values after realizing the widget on the float resource > I get garbage (0). ... > Is > there something wierd about floats, or have I made a mistake in my code Yeah, there's something wierd about floats. If you try to pass floats by value rather than by reference and assign a float value to an arglist entry in one of the normal ways, the C compiler will cleverly convert the float to a long. You have to do some ugly stuff with unions to convince the compiler not to convert the value when storing it in the arglist.