bounds, width & height question
bounds, width & height question
- Subject: bounds, width & height question
- From: Tom Gray <email@hidden>
- Date: Mon, 28 Oct 2002 22:08:37 -0500
I have a NSTextView subclass in which I am displaying a fixed 24X80
screen (emulating an old VT-100 terminal.)
My NSTextView has a frame, bounds and visible rectangle width which is
353.
The font I am using has a line height of 14.
So, my terminal has a height of ( 14 * 24 ) or 336.
It works fine. My 12 point Courier (line height of 14) display of 24X80
fits just fine.
Why then do I get a width and height of 560 X 720 when I use the
methods:
// Size of a single line. The terminal is 24 lines tall.
NSSize terminalSize = [full80ColumnLine
sizeWithAttributes:terminalcharAttributes];
and
// Width of a full 80 character line in the terminal font, Courier 12.
[terminalFont widthOfString: full80ColumnLine ]
Something is funny here. My terminal is working just fine. But when I
check the methods that should show me the width of a line of text or
the rectangle necessary to enclose my line of text I get a size which
is approximately twice as large.
The reason I am interested in this issue is that one of my alpha
testers is reporting on his OS 10.1.5 system, the terminal does not
vertically fit in the terminal NSTextView. None of my other alpha
testers are reporting that. In other words, for most of my alpha
testers my old style VT-100 terminal displays correctly in the
NSTextView. For one user however, the bounds of the NSTextView are a
few pixels to small and one of the lines of display is not visible.
Tom Gray
-------------
email@hidden
or
email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.