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

This email sent to [email protected]

Reply via email to