Skip navigation.
 
mlRe: Choosing a view for terminal like app
FROM : David Remahl
DATE : Sun Dec 15 08:52:02 2002

Dave,

I ran into this program this morning: <http://iterm.sf.net>.

Performance appears to be comparable to Terminal.app, without too much
loss of functionality (and with some gain). It is open source, so that
would allow you to investigate its implementation.

/ Regards, David

On Sunday, December 15, 2002, at 05:43 PM, Dave Dribin wrote:

>
> 1) Convert my backing store into an NSTextStorage so that it can be
> placed inside NSTextView.
>
> 2) Subclass NSTextStorage using my backing store as the real storage
> and use NSTextView.
>
> 3) Create a custom view using my backing store as the model.
>
> Option 1 seems very inefficient.  If my backing store changes often
> and is large, then this conversion could be very slow.  My gut tells
> me this will be way to slow and inefficient to be practical.
>
> Option 2 seems like an OK idea.  However, this means I will have to
> implement all the methods, which seems like a lot of work.  This
> includes all methods that modify NSTextStorage and
> NSMutableAttributedString.  Since all modifications will not happen
> through the view, these methods will not really be used, so
> implementing these methods seem like unnecessary work and may not be
> efficient to implement for my backing store.  Also, NSTextView doesn't
> really fit well with what I need, either.  I do not need probably 90%
> of the interface.
>
> Option 3 seems like the best idea, but I do not even know how to
> approach it.  I do not want to draw the text using drawAtPoint from
> NSString.  That would seem very slow.  Using NSBezierPath doesn't seem
> right, either.  Especially when you have to resort to using private,
> undocumented methods of NSFont to access glyphs, as described in the
> Cocoa book.
>
> I decided to open up Terminal.app's NIB and sure enough they are using
> their own custom TermView.  That makes Option 3 even more attractive. 
> I do not know how they implemented it, but it shows they did not use
> NSTextView or NSText.
>
> So, does my decision process sound sane?  And if I go for the custom
> view, what's the best way to draw lots of text efficiently?  Convert
> glyphs to bitmaps and just copy them on the screen?  Use NSBezierPath?
>  Is there some other method I've overlooked?  Thanks!
>
> -Dave



Related mailsAuthorDate
mlChoosing a view for terminal like app Dave Dribin Dec 15, 08:44
mlRe: Choosing a view for terminal like app David Remahl Dec 15, 08:52
mlRe: Choosing a view for terminal like app Dave Dribin Dec 15, 09:52
mlRe: Choosing a view for terminal like app Nicholas Riley Dec 15, 11:36
mlRe: Choosing a view for terminal like app Greg Hurrell Dec 15, 11:45
mlRe: Choosing a view for terminal like app Mike Ferris Dec 15, 13:45
mlRe: Choosing a view for terminal like app Dave Dribin Dec 15, 14:33