On 20/12/2012, at 4:55 AM, Todd Heberlein <[email protected]> wrote:
> Is there a common way to create a timeline object like an NSRulerView (or > just repurpose the NSRulerView) to appear at the top of an NSScrollView? > > I am currently using an NSRulerView, but it really doesn't fit the bill. I am > wondering if I am going to have to draw my own view and then just synchronize > the two views or if I am missing the obvious NSTimeView class or incantation > to turn an NSRulerView into a timeline. > > Any good pointers on how to do a timeline? Can you elaborate on how NSRulerVIew doesn't fit the bill? I just used one in its entirely standard incarnation to implement a timeline for a logic analyser and it does a good job (albeit with a rather boring appearance). Don't forget you can set up just about any measurement system for rulers with all sorts of step-up and step-down cycles. If you want to jazz up its appearance it can be subclassed. The advantage of NSRulerView is that is already knows how to work with NSScrollView to keep synchronised with it not only as it scrolls but as any content view is scaled. The only thing I found to really annoy me with the standard ruler view is that NSRulerMarker does some skanky stuff that makes it mostly only suitable for use in the standard NSTextView. Whoever did that at Apple broke the first rule of object design "thou shalt not add specialised behaviour to a generic class instead of subclassing". Probably work given to an intern. --Graham _______________________________________________ Cocoa-dev mailing list ([email protected]) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [email protected]
