Separating elements in an NSView subclass
Separating elements in an NSView subclass
- Subject: Separating elements in an NSView subclass
- From: Paul Bruneau <email@hidden>
- Date: Fri, 8 Aug 2008 08:14:31 -0400
Hi-
Some time ago I got some great advice to help me optimize the refresh
rate of my NSView subclass (the answer is, just draw the minimum that
you need to).
So I am working to do this, but I am having some trouble with the
inter-dependence of various elements that appear in my view.
Here is the screenshot of it:
http://special-lite.com/satellite/Schedule.pdf
Currently, everything is a single NSView subclass that does too much
(the docs refer to such a view as "monolithic" and I'm sure mine
qualifies). I believe this is making it hard for me to draw the minimum.
The elements consist of:
- the order steps (all those colorful rectangles)
- the list of workcenters on the left
- the grid drawn behind the order steps (including the pink grid
rectangles indicating "off-line" time)
- The timeline along the bottom
- lines that connect order steps to "sibling" order steps (you can see
an example of this on the right side--when a particular order is
selected, it is highlighted green with connecting lines)
I have started by creating a new view that has the workcenters, the
timeline, and the grid, and a second view with just the order steps on
it.
The problem that I think I have is that if the user moves an order
step, it reveals some of the "background" view below it. This will
then cause the background view to be redrawn, which, if I understand
things, is going to force the "order step" view to be completely
redrawn.
This would not help me any, since I am redrawing everything on every
update now.
I think I have read enough about CALayer to think that it could help
me with caching that it does, but I am writing for 10.4.
I'm hopeful that I am missing something, or thinking about this
incorrectly and that someone can point me in the right direction. If
you look in the lower left corner, you can see that with the increased
number of orders we have during our busy season, I am down to an
abysmal 1.2 fps.
Thank you all for you help, past and future.
_______________________________________________
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