• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Can I use NSTextView this way?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can I use NSTextView this way?


  • Subject: Re: Can I use NSTextView this way?
  • From: Douglas Davidson <email@hidden>
  • Date: Wed, 1 Oct 2003 10:30:14 -0700

On Tuesday, September 30, 2003, at 03: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 don't see any reason offhand why you couldn't do this, but I would do this a little differently--I would subclass NSLayoutManager and override drawGlyphsForGlyphRange:atPoint:, to do special drawing for certain characters in addition to or instead of the standard drawing. NSTextView's drawRect: is a little tricky, and you probably don't want to replace it entirely--although you might override it to do some extra drawing in addition to what it normally does.

Douglas Davidson
_______________________________________________
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.

  • Follow-Ups:
    • Re: Can I use NSTextView this way?
      • From: Fritz Anderson <email@hidden>
  • Prev by Date: Embedding CFM Carbon plugin in Cocoa App
  • Next by Date: Re: Can I use NSTextView this way?
  • Previous by thread: Re: Embedding CFM Carbon plugin in Cocoa App
  • Next by thread: Re: Can I use NSTextView this way?
  • Index(es):
    • Date
    • Thread