Re: [Q] mapping graphical items to NSViews
Re: [Q] mapping graphical items to NSViews
- Subject: Re: [Q] mapping graphical items to NSViews
- From: Scott Anguish <email@hidden>
- Date: Wed, 17 Mar 2004 00:37:10 -0500
On Mar 16, 2004, at 10:25 PM, Steve Christensen wrote:
This is one of those "which is the better way" kinda questions, so I'm
soliciting opinions.
I'm working on an application that manages a document containing
multiple items (pictures, movies, ...). The document view shows a
graphical representation of the items. One way of managing the items
would be to create a NSView to draw each object, ordering the views in
the same z-order as the items. Another way would be to draw all of the
items in a single view with more forward items just drawing on top of
items in back of them.
Ugh.. No. Using multiple views is just not the way to do that. Using
an array containing the data and then stepping through that array to
draw them would be the better way (even better still, use a double
linked list, since it makes moving items around, grouping, etc, very
easy).
I need to be able to select one or more items and do things like move
them around, align them, etc. Would it be more efficient to just
redraw the view(s) where something changed and then let Cocoa handle
drawing the rest of the items that haven't moved, or just go with a
single view and calculate/redraw the modified areas myself?
Calculate them yourself and schedule the redraws. Also, have a look
at Sketch in the /Developer/Examples/AppKit directory.
_______________________________________________
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.