Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Basic: How to go about implementing such a view?



Hi!

I am trying to figure out how to implement a 'Piano Roll' view in Cocoa. Attached is a screenshot of what I'm trying to accomplish. Disregard the keyboard on the left of the window and let's just focus on the area with the colorful rectangles, symbolizing notes.

1. When drawing the light and dark grey rows which make up a background, should I just use a loop with Quartz 2D/Cocoa Drawing calls?
2. When drawing the vertical lines, should I just use a loop with Quartz 2D/Cocoa Drawing calls?
3. Should I put the notes (colorful rectangles) each in a separate view (or Core Animation layer), or is it effective to just draw them directly in the main view (same view in which the rows are drawn)? I am eventually going to want to resize them and change their position by dragging them around.
4. How would I go about changing the view's width as more notes (rectangles) are added to the view? When enclosed in a NSScrollView, would manipulating the width of the view also hide/show the horizontal scrollbar appropriately?


Thanks!

~Matt


JPEG image


_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.