• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Superimpose a NSTextField over NSImageView?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Temporary text display over NSTableView (was NSTextField over NSImageView?)
      • From: James Bucanek <email@hidden>
References: 
 >Superimpose a NSTextField over NSImageView? (From: desktoast music productions <email@hidden>)
 >Re: Superimpose a NSTextField over NSImageView? (From: Andy Lee <email@hidden>)
 >Re: Superimpose a NSTextField over NSImageView? (From: Alan Hart <email@hidden>)
 >Re: Superimpose a NSTextField over NSImageView? (From: Ondra Cada <email@hidden>)
 >Re: Superimpose a NSTextField over NSImageView? (From: Dave Rosborough <email@hidden>)
 >Re: Superimpose a NSTextField over NSImageView? (From: glenn andreas <email@hidden>)
 >Re: Superimpose a NSTextField over NSImageView? (From: Andy Lee <email@hidden>)

  • Prev by Date: Re: Superimpose a NSTextField over NSImageView?
  • Next by Date: Screenshot code for Tiger
  • Previous by thread: Re: Superimpose a NSTextField over NSImageView?
  • Next by thread: Temporary text display over NSTableView (was NSTextField over NSImageView?)
  • Index(es):
    • Date
    • Thread