• 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
Re: NSRulerView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSRulerView


  • Subject: Re: NSRulerView
  • From: Graham Cox <email@hidden>
  • Date: Wed, 29 Jul 2009 11:42:08 +1000


On 29/07/2009, at 7:58 AM, David Blanton wrote:

Any insight on why this does not change the ruler measurement units:

[[[NSRulerView alloc] initWithScrollView:_scrollView orientation:NSHorizontalRuler] setMeasurementUnits:@"Centimeters"];
TIA!


Yes, because NSRulerView knows nothing of these "Centimeters" of which you speak.

You have to register the units you want to use with NSRulerView prior to use, using:

+ (void)registerUnitWithName:(NSString *)unitName abbreviation: (NSString *)abbreviationunitToPointsConversionFactor: (CGFloat)conversionFactor stepUpCycle:(NSArray *)stepUpCycle stepDownCycle:(NSArray*)stepDownCycle

This sets up an internal table associated with the name "Centimeters"* (or whatever) that tells the ruler how to lay out its marks.

You know, you could do worse than to spend a few hours actually reading the documentation - most of the questions you are rapidly firing at the list are answered therein.

--Graham

*P.S. it's "Centimetres"
_______________________________________________

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
      • From: Dave Keck <email@hidden>
    • Re: NSRulerView
      • From: Andy Lee <email@hidden>
References: 
 >NSRulerView (From: David Blanton <email@hidden>)

  • Prev by Date: Re: Copying Managed Objects from App to Doc MOContext
  • Next by Date: Re: NSSplitView autosave troubles
  • Previous by thread: NSRulerView
  • Next by thread: Re: NSRulerView
  • Index(es):
    • Date
    • Thread