Path: utzoo!attcan!uunet!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!sdd.hp.com!samsung!xylogics!bu.edu!snorkelwacker!bloom-beacon!EXPO.LCS.MIT.EDU!kit From: kit@EXPO.LCS.MIT.EDU (Chris D. Peterson) Newsgroups: comp.windows.x Subject: Re: floats and XtSetArg Message-ID: <9007021441.AA14934@expo.lcs.mit.edu> Date: 2 Jul 90 14:41:10 GMT References: <9007021151.AA13264@expo.lcs.mit.edu> Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 30 > How can I use XtSetArg to send a float to my widget? Here is some code that sets the "shown" resource of the Athena Scrollbar widget. This is in the Athena R4 widget documentation, for those of you who have it. top = 0.5; if (sizeof(float) > sizeof(XtArgVal)) { /* * If a float is larger than an XtArgVal then pass this * resource value by reference. */ XtSetArg(args[0], XtNshown, &top); } else { /* * Convince C not to perform an automatic conversion, which * would truncate 0.5 to 0. */ XtArgVal * l_top = (XtArgVal *) ⊤ XtSetArg(args[0], XtNshown, *l_top); } Chris D. Peterson MIT X Consortium Net: kit@expo.lcs.mit.edu Phone: (617) 253 - 9608 Address: MIT - Room NE43-213