Re: Lining up NSViews in NSScrollView
Re: Lining up NSViews in NSScrollView
- Subject: Re: Lining up NSViews in NSScrollView
- From: Michael Marmarou <email@hidden>
- Date: Sun, 20 Feb 2005 11:05:43 -0500
An overlying window would work if I didn't want to edit the text
underneath, but I do. I was thinking more along the lines of using an
NSTextView (scrolling) with a clearColor background, then placing at
the same location (same frame) a scrolling view to draw. Then if the
userscrolled which ever one was on top, i would update the view on the
bottom. It would be pretty easy to switch and send one to the
background.
What I wanted to know was if there was a way to have more than one
NSView as a documentView of NSScrollView. If that was possible, then
I could eliminate using seperate ScrollViews.
On Sun, 20 Feb 2005 09:50:51 -0600, Ricky Sharp <email@hidden> wrote:
> On Feb 20, 2005, at 2:45 AM, daniel wrote:
>
> > You can't "put views on top of other views." You can only put views
> > inside other views. There must be a hierarchical relationship between
> > all views in your window.
>
> This isn't true. You can overlap views, but must be a bit more
> careful. For example, you shouldn't instruct the containing window to
> use optimized drawing (see useOptimizedDrawing:) when views overlap.
>
> > You might accomplish what you are trying to do by creating a custom
> > subclass of NSTextView that is capable of drawing embellishments on
> > top of whatever the base class draws. For any views you have in mind
> > that have corresponding cells, you could use cells to draw their
> > representations on top of the text view. If they don't have cells,
> > you could render the views into an NSImage and then draw them on top
> > of the view.
> >
> > If your requirements are much more complicated than that, then the
> > answer might involve secondary, borderless windows that are positioned
> > over your primary window, set up with an appropriate scrolling view
> > that is scrolled in sync with the main window. If you are envisioning
> > a limitless number of "layers" then perhaps this is your answer.
>
> Either of these approaches should work well. I'd make a guess that the
> overlay window may ultimately provide for better performance since if
> there's no change to the content of the underlying window, it can be
> redrawn very quickly.
>
> ___________________________________________________________
> Ricky A. Sharp mailto:email@hidden
> Instant Interactive(tm) http://www.instantinteractive.com
>
>
_______________________________________________
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