Re: Can I use NSTextView this way?
Re: Can I use NSTextView this way?
- Subject: Re: Can I use NSTextView this way?
- From: Fritz Anderson <email@hidden>
- Date: Wed, 1 Oct 2003 12:28:39 -0500
I've figured out my immediate problem: NSLayoutManager's
drawBackgroundForGlyphRange:atPoint: will throw an exception if it is
sent with a range of zero length. It wasn't until I was deep into my
test suite that this happened. So I am a happy man for now.
-- F
On 30 Sep 2003, at 5:14 PM, Fritz Anderson wrote:
I'm trying to build a terminal emulator. I've got an NSView subclass
that puts a vanilla NSTextView at the top, to catch scrollback, and my
custom NSTextView subclass at the bottom, which stays the same size as
the clip view of the enclosing scroller, and serves as the terminal.
The terminal view overrides drawRect: to call the layout manager's
drawBackgroundForGlyphRange:atPoint:, and then, piecewise,
drawGlyphsForGlyphRange:atPoint:, so I can draw or suppress blinking
characters, and double-strike boldfaced characters. The NSTextView
drawRect: never gets called.
...
I use the terminfo-validation tool 'tack' to test my terminal. It
seems that well into the string test, which runs a few megabytes
through the terminal, NSLayoutManager raises an invalid-range
exception as a result of the terminal's -drawRect: sending
-drawBackground... . The stack frame for -drawRect: is either damaged
or irrecoverable, so I can't learn much from gdb. I do know the view
pointer was not nil, and that storage-length and
character-to-glyph-range conversions went through before the offending
message.
_______________________________________________
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.