Re: Lining up NSViews in NSScrollView
Re: Lining up NSViews in NSScrollView
- Subject: Re: Lining up NSViews in NSScrollView
- From: glenn andreas <email@hidden>
- Date: Sun, 20 Feb 2005 11:02:23 -0600
On Feb 20, 2005, at 9:50 AM, Ricky Sharp 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.
It's also documented as not being guaranteed to work:
file:///Developer/ADC Reference Library/documentation/Cocoa/
Conceptual/DrawViews/Concepts/ViewHierarchy.html#//apple_ref/doc/uid/
20000909/BBCECAIF
For performance reasons, the Application Kit does not enforce clipping
among sibling views, or guarantee correct invalidation and drawing
behavior when sibling views overlap. If you want a view to be drawn in
front of another view, you should make the front view a subview (or
descendant) of the rear view.
"App Kit does not [..] guarantee correct [..] drawing behavior when
sibling views overlap" pretty much scares me away from trying such
things. That you might be able to make it work as you expect it to
doesn't mean that it's going to work the same in all versions of OS X
either - seems like a good way to get some ugly drawing/event
handling/whatever bugs that are going to be subtle and difficult to
track down, consistently reproduce, and resolve across system
versions...
Glenn Andreas email@hidden
<http://www.gandreas.com/> oh my!
Mad, Bad, and Dangerous to Know
_______________________________________________
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