Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!cmcl2!lanl!mikeg%monsoon.c3 From: mikeg%monsoon.c3@lanl.gov (Michael P. Gerlek) Newsgroups: comp.windows.x Subject: Re: XtConvert & SetValues for floats Message-ID: <14000@lanl.gov> Date: 24 Jul 89 22:05:07 GMT References: <1600@bacchus.dec.com> Sender: news@lanl.gov Lines: 32 From article <1600@bacchus.dec.com>, by asente@decwrl.dec.com (Paul Asente): > In article <1208@quintus.UUCP> pds@quintus.UUCP (Peter Schachte) writes: >> I'm trying to convert strings to the appropriate argument types to be >> put into the ArgList to be passed to XtCreateWidget() or >> XtAppCreateShell(), so I don't have a widget yet to pass to XtConvert(). >> Can I pass it a NULL? > > No. When creating a widget the right thing is usually to pass in some > other widget on the same display, usually the new widget's parent. If > you're creating the very first widget in the application you can't do > conversions; create the widget then use XtSetValues. I have a related problem: I've written a widget which needs to use floats in it's resource list, but I can't get it to work quite right: 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). And yet a parallel resource which I kludged into using strings (manually converted into floats) for the same purpose works fine. So, okay, I'm new to Xt -- what am I missing? Should I be declaring a Converter? If so, _why_? I've R'ed the FM, and found no help. And there aren't any other widgets that use floats to look at for a hint. Is there something wierd about floats, or have I made a mistake in my code somewhere [minimal test case +150 lines, too long to include here]? Help! And thanks... [ M.P.Gerlek (mikeg@watson.c3.lanl.gov) "Unix is just Public ] [ Los Alamos Nat'l Lab / Merrimack College Domain VMS." ] [ Disclaimer: Yes, Mom, I'll play nice. -anonymous ]