Looking for Cocoa Drawing Strategy Advice
Looking for Cocoa Drawing Strategy Advice
- Subject: Looking for Cocoa Drawing Strategy Advice
- From: Philip Regan <email@hidden>
- Date: Fri, 14 May 2010 13:41:15 -0400
Howdy--
I am porting a GUI-based MIDI editor from REALbasic to Cocoa to take advantage of the framework for all sorts of reason (though it seems mainly in an effort to torture myself with programming ;-)). I have the model and controller aspects stragetized, and I have cooked up a core working project, but I'm looking for strategies and best practices on certain aspects about drawing with views and hierarchies. I've read the Cocoa Drawing Guide and related materials, but I have some questions that those materials either don't cover well (if at all)
The feature that I'm stuck on sorting on how best to implement is custom rulers—multiple types of horizontal rulers that can be shown and hidden by the user together or alone (or none at all), each with their own editable objects and types of hash marks (if any at all), and a vertical ruler that requires actual art and interaction as opposed to just hash marks. From what I can surmise from the documentation and reading other questions on various forums, there are two ways to handle this...
The first strategy I'm looking at is to use the already supplied NSRulerViews to create my own view hierarchy to manage and draw as I see fit. I'm leaning towards this method because it seems to be more of what Cocoa would expect, but it also seems as though the NSRulerView has a very pre-determined use that really can't be modified too much without a whole lot of trouble.
The second strategy is to draw the rulers in the main NSView nested in the NSScrollView and use NSClipView to maintain their position on the left and top of the NSScrollView. But that seems kludgey to me somehow.
Also, I'm looking to incorporate certain simple 2D drawing techniques like rounded corners, transparency, and possibly drop shadows. In a GUI interface is there a graphics library I should stick with or ones that I should stay away from (I know OpenGL is overkill here, but would CoreAnimation be a bad thing in a drag-and-drop editing scenario).
Just to be clear, I'm not looking for actual code or someone to do the work for me, but I would really appreciate any feedback anyone has based on their experience. I know either way I'm looking at a lot of work, so a point towards the "right" direction is really all I need here to ensure I'm not losing more time that I already am now.
Thanks
--
Philip Regan
http://www.oatmealandcoffee.com
_______________________________________________
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