Re: Superimpose a NSTextField over NSImageView?
Re: Superimpose a NSTextField over NSImageView?
- Subject: Re: Superimpose a NSTextField over NSImageView?
- From: glenn andreas <email@hidden>
- Date: Sun, 23 Apr 2006 09:48:17 -0500
On Apr 23, 2006, at 9:37 AM, Andy Lee wrote:
On Apr 23, 2006, at 10:21 AM, glenn andreas wrote:
From <http://developer.apple.com/documentation/Cocoa/Conceptual/
CocoaViewsGuide/WorkingWithAViewHierarchy/chapter_4_section_5.html>
Note: For performance reasons, Cocoa 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.
It's been explicitly documented (and has for as long as there has
been OS X, probably even before), that the behavior of drawing
overlapping views is undefined.
I think the doc for -addSubview:positioned:relativeTo: should
include a caveat to this effect. Maybe the method should really
have been private and was accidentally exposed? Maybe it *is*
guaranteed to work, but only under certain conditions (and maybe it
was used to implement Send to Back/Front in IB)? I submitted a
feedback note about this using the link at the bottom of the NSView
doc page.
I'd *guess* two things:
1) At one point it was guaranteed to work, but that was back when
Hair Metal Bands ruled the world.
2) Hit testing has to go through the list of subviews - the
addSubview:positioned:relativeTo: probably directly impacts that
(since there's nothing stated about hit testing not working, only
invalidation & drawing).
But those are just guess (the former is somewhat supported by the
lack of any such disclaimer in <http://docs.sun.com/app/docs/doc/
802-2112/6i63mn62o?l=fr&a=view>, the latter due to Occam)
Glenn Andreas email@hidden
<http://www.gandreas.com/> wicked fun!
quadrium | build, mutate, evolve | images, textures, backgrounds, art
_______________________________________________
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