Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!elroy.jpl.nasa.gov!decwrl!infopiz!lupine!jcb From: jcb@NCD.COM (Jim Becker) Newsgroups: comp.windows.open-look Subject: Re: Bug in XView TEXTSW package? Message-ID: Date: 2 May 91 00:58:23 GMT References: Lines: 32 warsaw@nlm.nih.gov (Barry A. Warsaw) writes: System: Sun SS1+, OS4.1.1, X11R4.18, MIT XSun, XView2 I *think* I have found a bug in XView's TEXTSW package. The problem is that getting the font of the TEXTSW returns the incorrect font. I haven't been able to track this down to any XView code (the TEXTSW stuff is fairly hairy), but I do have an example you can compile -- see below. I use Guide to create a window with a TEXTSW in it called textpane1. Then I do the following: Xv_Font font = (Xv_Font)xv_get( textpane1, XV_FONT ); This will return the default font for the application, *not* the font the textpane1 actually uses, which is a fixedwidth version of this default font. This really screws up you horizontal width calculations when you're trying to correctly size the TEXTSW! try finding the font for the first view in the textsw: Xv_Font font = (Xv_Font)xv_get( textsw_first(textpane1), XV_FONT ); that should do it, if anything will. -Jim Becker -- -- Jim Becker / jcb@ncd.com / Network Computing Devices (NCD)