Re: Lining up NSViews in NSScrollView
Re: Lining up NSViews in NSScrollView
- Subject: Re: Lining up NSViews in NSScrollView
- From: Ricky Sharp <email@hidden>
- Date: Mon, 21 Feb 2005 14:18:03 -0600
On Monday, February 21, 2005, at 02:00PM, Michael Marmarou <email@hidden> wrote:
>Wel, this has kind of strayed away from my original topic, which was
>really how to draw in a NSTextView. I had heard that it was in the
>2003 WWDC cocoa tips session, but i didn't attend that session, and
>don't have my dvd's anymore. My suggestion was to use overlapping
>views. Is this the best way?
I think a couple things have already been suggested (e.g. using an overlay window). Have you tried looking into the work involved for the various approaches?
In terms of what is 'best', I would personally go with the overlay window approach. If you think about it, an overlapping view is really the same thing. i.e. you have a separate view that you'll draw all your adornments into. I believe you'll get better performance if the view in question is an overlay window. A con is that you'll need to keep the text view and overlay in sync (e.g. you move the window containing the text view, or you change properties of the text view).
Or, you can always look into subclassing NSTextView (actually, probably just NSTextViewCell). In drawInteriorWithFrame:inView:, you could call super's implementation and then draw your extra stuff. The advantage here is that you just have one view.
--
Rick Sharp
Instant Interactive(tm)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden