• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSRulerView cusom hashMarks
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSRulerView cusom hashMarks


  • Subject: NSRulerView cusom hashMarks
  • From: josh hughes <email@hidden>
  • Date: Mon, 20 Oct 2008 19:40:11 +0100

Hi,

I need to alter the hashMarks of an NSRulerView so that the labels increment from 1 rather than the default: 0. As I understand it, this should be done by either subclassing NSRulerView and overriding drawHashMarkAndLabelsInRect: or using a delegate.

I must admit, I'm quite new to cocoa and don't have much experience with delegation so I decided to try subclassing instead.

The first problem I've run into in my subclass is that I can't access of the NSRulerView's instance variables as they are defined as private. I can however access details about measurementUnits by overriding NSRulerView's registerUnitWithName:abbreviation:unitToPointsConversionFactor:stepUpCycle:stepDownCycle :

Should I be gathering this information in order to calculate my own hashMarks / labels etc.. or is there a much simpler way of doing things?

I would also be interested in understanding what the documentation means by using a delegate to create the custom markers?


Many thanx in advance.

Josh





_______________________________________________

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


  • Follow-Ups:
    • Re: NSRulerView cusom hashMarks
      • From: Graham Cox <email@hidden>
  • Prev by Date: Using Core Animation to animate view properties?
  • Next by Date: NSURL, NSURLRequest, and NSURLConnection
  • Previous by thread: Re: Using Core Animation to animate view properties?
  • Next by thread: Re: NSRulerView cusom hashMarks
  • Index(es):
    • Date
    • Thread