Benjamin Ragheb
unread,May 4, 2013, 10:27:04 PM5/4/13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to cocoah...@googlegroups.com
I'm working on a Mac app and I'm hoping your collective experience may save me from having to learn from my own mistakes. I want to write a document editor, where a document consists of:
- one or more images, layered on top of each other;
- a collection of points, drawn over the images, which can be created, selected, and moved around;
- line segments, which join some of the points.
My first idea is to simply fill the window with a custom NSView subclass in which I draw all of these things, handle the mouse events, track which point is selected, etc. I know how to do this, but I wonder if there isn't a better way. It feels like there would be too much going on in this one view object.
Is this the right way to do it? Is it advisable to use CALayer instead of overriding drawRect:? Are there lesser-known things in AppKit that might be useful?
-- Ben