[comp.windows.x] problems with scrollbar widget/XtSetArg

rob@cetia.UUCP (Rob Gordon) (06/06/89)

Below is a reply to a previous posting,
it solved our problems exactly!
(i was looking at the wrong end of the piece of string!)

i'm posting it on, just in case anyone else finds it useful

cheers
rob

 - Subject: XtGetValues() and the scrollbar widget
 - 
 - The scrollbar widget is the only one to use a resource of
 - type XtRFloat.  The only way I've gotten XtSetValues to
 - work in my widgets is to define XtSetFloatArg to be
 - 
 - #define XtSetFloatArg(arg, n, d) \
 -	 ( (arg).name = (n) , (arg).value = *(XtArgVal*)&(d) )
 - 
 - and make sure that I give it a variable and not an expression
 - for d.  The usual XtSetArg is
 - 
 - #define XtSetArg(arg, n, d) \
 -     ( (arg).name = (n), (arg).value = (XtArgVal)(d) )
 - 
 - where value is of type XtArgVal which is a typedef for long.
 - Coercing the float to long destroys its value.
 - 
 - Are you sure your problem is in XtGetValues?  I've tried
 - to avoid float valued resources because of problems like
 - this.
 - 
 - 	Bill Dunlap
 - 	bill@elk.stat.washington.edu
-- 
Rob Gordon
				rob@inset.co.uk
				...!mcvax!ukc!inset!rob