• 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:21:28 -0500


On Apr 23, 2006, at 9:02 AM, Dave Rosborough wrote:

What about:
- (void)addSubview:(NSView *)aView positioned:(NSWindowOrderingMode) place relativeTo:(NSView *)otherView


"Inserts aView among the receiver’s subviews so it’s displayed immediately above or below otherView according to whether place is NSWindowAbove or NSWindowBelow. If otherView is nil (or isn’t a subview of the receiver), aView is added above or below all of its new siblings. Also sets the receiver as the next responder of aView."

This should do what the OP was looking for, and in fact very likely forms the basis for "Bring to Front" and "Send to Back". It doesn't seem like the drawing order of sibling NSViews is really undefined at all.


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.

For the OP, they can simply make the NSTextField a subview of the NSImageView to guarantee that it is drawn correctly.


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:
    • Re: Superimpose a NSTextField over NSImageView?
      • From: Andy Lee <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>)

  • Prev by Date: Re: Superimpose a NSTextField over NSImageView?
  • Next by Date: Re: Superimpose a NSTextField over NSImageView?
  • Previous by thread: Re: Superimpose a NSTextField over NSImageView?
  • Next by thread: Re: Superimpose a NSTextField over NSImageView?
  • Index(es):
    • Date
    • Thread