• 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: Unclear on NSView's isOpaque concept (and optimization in general)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unclear on NSView's isOpaque concept (and optimization in general)


  • Subject: Re: Unclear on NSView's isOpaque concept (and optimization in general)
  • From: Leon McNeill <email@hidden>
  • Date: Thu, 6 Nov 2003 15:11:51 +0000

On 6 Nov 2003, at 12:45, Alastair Houghton wrote:
The order in which sibling views are rendered isn't defined and may even change during a single run of your program due to optimisations in the frameworks. So if you overlap them, you may find that they don't always display correctly. Using overlapping sibling views won't degrade the performance of your app., but it might make it misbehave.

And on 6 Nov 2003, at 13:05, Clark Cox wrote:
The order in which sibling views are drawn is completely undefined. You have no way of knowing which of two overlapping views will be drawn first, and which will be drawn second.

Far from undefined, indeed, I have found nothing in either documentation nor in real world testing which implies or indicates that my NSView subclasses will *ever* draw in any order other than the order in which they were added to their superview (or inserted via addSubview:positioned:relativeTo:). I can certainly understand Stiphane's point of avoiding putting any view on top of another view that is dynamic or interactive! These may be issues if I were subclassing something higher level than a vanilla NSView. In my case, however, the only views I have that are overlapped by others are my own opaque non-interactive views that simply draw something.

On 6 Nov 2003, at 13:51, lbland wrote:
NSWindow:
- (void) useOptimizedDrawing: (BOOL) flag
Informs the receiver whether to optimize focusing and drawing when displaying its NSViews. The optimizations may prevent sibling subviews from being displayed in the correct order-which matters only if the subviews overlap. You should always set flag to YES if there are no overlapping subviews within the NSWindow. The default is NO .

Thanks, Lance! Unfortunately, I just tested [myWindow useOptimizedDrawing:YES] in awakeFromNib and didn't notice any performance gain, nor did I notice my overlapping siblings drawing in the wrong order, which I obviously would have needed to deal with if this method had helped.

Instead, it really looks like I need to concentrate on eliminating most of my little NSViews, and have what are currently their superviews intelligently draw the rects that they'd be drawing. Panther NSView's new needsToDrawRect: method will be quite helpful with this, I'm sure.

--
Leon McNeill email@hidden www.lairware.com
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Unclear on NSView's isOpaque concept (and optimization in general)
      • From: Alastair Houghton <email@hidden>
References: 
 >Re: Unclear on NSView's isOpaque concept (and optimization in general) (From: lbland <email@hidden>)

  • Prev by Date: Disabling the Run <appname> window in XCode
  • Next by Date: Re: Using an NSString to refer to a variable
  • Previous by thread: Re: Unclear on NSView's isOpaque concept (and optimization in general)
  • Next by thread: Re: Unclear on NSView's isOpaque concept (and optimization in general)
  • Index(es):
    • Date
    • Thread