Path: utzoo!attcan!uunet!husc6!bloom-beacon!TUB.BITNET!net From: net@TUB.BITNET (Oliver Laumann) Newsgroups: comp.windows.x Subject: Re: Bug in Athena scrollbar widget (float resource) Message-ID: <8812191103.AA16776@tub.UUCP> Date: 19 Dec 88 11:03:09 GMT Sender: daemon@bloom-beacon.MIT.EDU Organization: The Internet Lines: 39 > > 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. > > 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. I don't quite understand what this has to do with the specific problem I mentioned. If I am assumed to store a pointer to a float into an XtArgVal, then the type for XtRFloat is `float*', not `float'. However, the relevant scrollbar fields are declared like this: float top; float shown; and referenced like ScrollbarWidget w = ...; w->scrollbar.top = 0.5; Thus, something like float f = 0.5; Arg a[1]; XtSetArg (a[0], XtNtop, &f); XtSetValues (widget, a, ONE); would not work (I have just tried it). If this is not a bug then I would appreciate if you could show me how the `float' resources can be set by means of XtSetValues. Am I missing something? Regards, -- Oliver Laumann net@TUB.BITNET net@tub.UUCP