On 23 Aug 2011, at 22:18, Julie Porter wrote:

How do I do setup the ruler and scrollviews programetically without interface builder?
On 8/23/11 2:30 PM, Thomas Davie wrote:

Your best bet is to not completely dump IB, but to simply set the contentSize programatically as soon as you load your document.

This is what I am having issue with. How and where to put the delegates? Specifically what file would I place them into? Or do I create a new file for the delegate that does this?

This all said, I'd recommend against using a scroll view here. Extremely long scroll views can get very difficult for the user to navigate. Instead, it might be worth considering some kind of scrubbing interface. Maybe something like a movie editor that shows a miniature visualisation of each section of roll, and allows the user to easily scrub through.

I am not familiar with what a scrubbing interface would be. Can you suggest some examples.

Re your specific example though – you should not be drawing anything based on a scroller position. Instead, the NSScrollView will ask for a specific rectangle of your contentView to be drawn using - (void)drawRect:(NSRect)r. Simply draw the area you've been asked to draw and all will go well.

I may be unclear here. My existing code is based on what line number of the file to display. Piano rolls are viewed from bottom to top, so I am using a postscript style interface.

My understanding once I get the view set up drawRect will give me a rectangle, where the bottom of the rectangle would be the line to start drawing. The top of the rectangle would be the limit to stop drawing at. The rectangle would be in my coordinate space and scaled appropriately.

This seems so much better than the carbon way of having to find the scroller position in QD points, then scale them to postscript points. Why I was surprised at the 10K limit.


I don't really see what you're saying about cocoa obfuscating things, it's one of the most clear APIs out there, and I'm not sure what you mean by v2.0 either.
Simply that there are too many choices to choose from. Ironic in that I am a postscript programmer, a language that is the definition of obfuscation. Perhaps I am thinking backwards here?

Do I use delegates or bindings? There are some setup wizards, but when one runs them, there are no code parameters to change. It is like I have to read the mind of the application engineer that defined the class.
But I digress ..

Bob


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to