Path: utzoo!attcan!uunet!ncrlnk!ncrcae!hubcap!gatech!bloom-beacon!ATHENA.MIT.EDU!kit From: kit@ATHENA.MIT.EDU (Chris D. Peterson) Newsgroups: comp.windows.x Subject: Re: Bug in Athena scrollbar widget (float resource) Message-ID: <8812161858.AA16158@DORA.MIT.EDU> Date: 16 Dec 88 18:58:02 GMT Sender: daemon@bloom-beacon.MIT.EDU Organization: The Internet Lines: 40 > From: Oliver Laumann > > The srollbar widget has resources of the representation type XtRFloat > (e.g. `shown'). These resources are declared as `float'. > > This is wrong; it is impossible to set a resource of type `float' > using XtSetValues() (for instance, a float cannot be assigned to an > XtArgVal). The type should be float* instead. > > (By the way, is this the reason why the widget class exports a function > XtScrollbarSetThumb, which would not be necessary if one could set > the resources directly? :-) In general there is no requirement that a resource be able to fit into an XtArgVal and the float is no exception. If the resource is larger than a XtArgVal then you need to pass a pointer to the resource into XtSetValues. The Toolkit does all of the right things to store that actual of then resource into the Widget instance. Now on to the specific problem: A float is a special case, since it will sometimes fit into an XtArgVal, and sometimes it won't (it depends on the machine that you are using). At compile time you should know whether or not it will fit, so that you can decide to pass the value of the float, or a pointer to the float to XtSetValues. Although using the convience routine XtScrollbarSetThumb() makes all of the ugly size checking unnecessary in this particular case. Chris D. Peterson MIT X Consortium / Project Athena Net: kit@athena.mit.edu Phone: (617) 253 - 1326 USMail: MIT - Room E40-342C 77 Massachusetts Ave. Cambridge, MA 02139