O'Reilly logo

Cocoa in a Nutshell by James Duncan Davidson, Michael Beam

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

NSRulerView — Mac OS X 10.0

Synopsis

This is a subclass of NSView and is used to draw rulers in an NSScrollView. A ruler view keeps track of the units used to convert measurements between pixels and whatever unit the client specifies should be displayed by the ruler view. A ruler view may contain ruler markers, which are instances of the class NSRulerMarker.

image with no caption

@interface NSRulerView : NSView
                                  // Initializers
   - (id)initWithScrollView:(NSScrollView *)scrollView 
                                 orientation:(NSRulerOrientation)orientation;
                                  // Accessor Methods
   - (void)setReservedThicknessForAccessoryView:(float)thickness;
   - (float)reservedThicknessForAccessoryView;
   - (void)setScrollView:(NSScrollView *)scrollView;
   - (NSScrollView *)scrollView;
   - (void)setOriginOffset:(float)offset;
   - (float)originOffset;
   - (void)setOrientation:(NSRulerOrientation)orientation;
   - (NSRulerOrientation)orientation;
   - (void)setClientView:(NSView *)client;
   - (NSView *)clientView;
   - (void)setReservedThicknessForMarkers:(float)thickness;
   - (float)reservedThicknessForMarkers;
   - (void)setMarkers:(NSArray *)markers;
   - (NSArray *)markers;
   - (void)setRuleThickness:(float)thickness;
   - (float)ruleThickness;
   - (void)setAccessoryView:(NSView *)accessory;
   - (NSView *)accessoryView;
   - (void)setMeasurementUnits:(NSString *)unitName;
   - (NSString *)measurementUnits;
                                  // Class Methods
   + (void)registerUnitWithName ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required