Re: Cocoa "canvas" view ?
Re: Cocoa "canvas" view ?
- Subject: Re: Cocoa "canvas" view ?
- From: "Kyle Sluder" <email@hidden>
- Date: Fri, 21 Nov 2008 11:20:01 -0500
On Fri, Nov 21, 2008 at 9:50 AM, Guillaume Laurent
<email@hidden> wrote:
> Indeed I could :-). This is a very impressive work, thank you for it. Can
> you tell me more about its scalability ? What I'm planning to write is a
> music classical notation editor, so I'll typically need to handle a number
> of objects in the 10k order of magnitude, in a very large view.
In your position I would hesitate to actually model your graphical
elements as objects. Rather, I would just have my view figure out
what portion of the score needs to be drawn, and then just draw to the
view. Perhaps I would use a cell class like NoteCell to do the dirty
work. My view would know how to convert bounds-oriented coordinates
into sections of staffs, and then would draw the staves, followed by
iterating through each note in each staff, calling -setObjectValue: on
the view's cell and then drawing the cell at the appropriate place.
This is conceptually similar to how NSTableView works. It doesn't
really care about objects; the OO illusion is not necessary at the
level it's dealing with, and the complexity of dealing with it will
probably make your head spin, your app slow, or both.
--Kyle Sluder
_______________________________________________
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