Re: Best technology to use for overlays?
Re: Best technology to use for overlays?
- Subject: Re: Best technology to use for overlays?
- From: Daniel Vollmer <email@hidden>
- Date: Fri, 24 Apr 2009 11:15:47 +0200
On Apr 24, 2009, at 11:06 , Frederik Slijkerman wrote:
Hi Daniel,
Why not move the overlay drawing to a separate custom view, that you
insert as a direct subview of the scroll view? In this way, the
composition system takes care of all the redrawing in the most
efficient way.
The thing that makes this difficult is that I need to draw the heading
for each of the subviews of the NSCollectionView, and thus the layout
and current y-position of where to draw the headers is not really
known in superviews of the collection view (although I could probably
ask them =)).
Also, somewhere in the back of my mind was the mention of a
restriction that subviews were not allowed to overlap, but I may be
wrong on that account.
Best regards,
Frederik Slijkerman.
Daniel.
Daniel Vollmer wrote:
Hi,
I want to optimise my drawing code a bit. Essentially, I have a
custom NSView embedded in an NSCollectionView embedded in an
NSScrollView. In my custom view, I always want to display an
overlay (consisting of something like a description string of what
is being displayed). This overlay is of course expected to be
always visible no matter where I scroll, which usually leads me to
redrawing the whole view when scrolling.
What's the usual approach to this? Move the "header" drawing code
to a subclass of NSScrollView? Conceptually, I think I want
something that uses the same back-end as the window compositing, as
that that's closest to what I want (the heading stays where it is,
drawn on top of the NSScrollView, while the custom view only has to
draw the given subRect that's being scrolled into the visible
portion).
An example of the views is here: http://maven.de/code/wowplot/example_chains.png
. The description at the top-left of each plot always stays in the
same position even when scrolling left or right.
Thanks for any suggestions,
Daniel.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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