• 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: Changing order of views dynamically
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Changing order of views dynamically


  • Subject: Re: Changing order of views dynamically
  • From: Andy Lee <email@hidden>
  • Date: Tue, 20 Mar 2007 11:17:48 -0400

On Mar 20, 2007, at 3:16 AM, Sergey Shapovalov wrote:
1. What is [NSView addSubview:positioned:relativeTo:] intended for if relative positioning of overlapping subviews is not guaranteed to work anyway? If "correct invalidation and drawing behavior when sibling views overlap" is not guaranteed, is it just a misleading API which will never work?

I don't know if it'll never work, but IMO it is indeed misleading, because the doc for that function says quite clearly: "Inserts a view among the receiver’s subviews so it’s displayed immediately above or below another view."


This issue comes up often enough that I would expect the NSView documentation to have been clarified. When I scan the NSView docs and find a method that clearly claims to do what I want, I don't go looking for a reason why that method shouldn't be relied on.

I'm incredibly late for work, but I'll try to remember to file a bug. Perhaps you could do the same.

2. When I build a NIB resource in Interface Builder, I can choose several sibling subviews in a parent view, and for each of them say "Layout > Bring To Front" or "Layout > Send To Back". Is this also illegal in case these sibling subviews overlap? I mean, is there no guarantee that what was brought to front will be drawn above what was sent to back?

The "Bring To Front" and "Send To Back" could just be conveniences in case while running Interface Builder you hide one view behind another. It could be that IB doesn't do the optimizations that are referred to in the CocoaViewsGuide doc, which makes z-ordering work in *IB*. This doesn't mean it'll work in your application.


I agree it's confusing, because if you've ever used a drawing program, you make certain assumptions about what "Bring To Front" and "Send To Back" mean.

--Andy

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: Changing order of views dynamically (From: Sergey Shapovalov <email@hidden>)

  • Prev by Date: Re: Debugging Core Data unresolved keypath save error
  • Next by Date: Re: Image manipulation on 10.3
  • Previous by thread: Re: Changing order of views dynamically
  • Next by thread: Re: Changing order of views dynamically
  • Index(es):
    • Date
    • Thread