Path: utzoo!utgpu!watmath!watcgl!watnext!jmberkley From: jmberkley@watnext.waterloo.edu (J. Michael Berkley) Newsgroups: comp.windows.x Subject: Re: Instrinsics resource question Message-ID: <8437@watcgl.waterloo.edu> Date: 6 Mar 89 13:17:29 GMT References: <1489@ncar.ucar.edu> Sender: daemon@watcgl.waterloo.edu Reply-To: jmberkley@watnext.waterloo.edu (J. Michael Berkley) Organization: U. of Waterloo, Ontario Lines: 31 In article <1489@ncar.ucar.edu> clyne@redcloud.ucar.edu.UUCP () writes: > >Hello, Can someone tell me why the following code fragment won't return >the font used by the label widget? > > /* > * get font > */ > n = 0; > XtSetArg(args[n], XtNfont, &font); n++; > XtGetValues(comm, args, n); > > /* > * length of string in pixels > */ > width = XTextWidth(&font, "string", strlen("string"); I've been having trouble with this too. Using XtGetValues() didn't work for finding the font, so I started poking around in the public and private structures for the Text Sink. It turns out that the font element is ALWAYS NULL in the public sink struct, but is set correctly in the private sink struct. XtGetValues() must be looking at the public struct. ****************************************** * Mike Berkley, University of Waterloo * * PAMI Lab * * jmberkley@watnext.waterloo.edu * * jmberkley@watnext.UWaterloo.CA * * {utai,uunet}!watmath!watnext!jmberkley * ******************************************