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

NSRulerMarker — Mac OS X 10.0

Synopsis

Instances of this class are used to display symbolic markers in an NSRulerView. An example of ruler view markers are those that text documents use to indicate the position of tab stops or table columns. Markers are initialized with an associated ruler view, a position in that view, an image used to represent the marker in the ruler view, and an NSPoint that specifies what point in the image should be treated as the marker origin.

image with no caption

@interface NSRulerMarker : NSObject <NSCoding, NSCopying>
                                  // Initializers
   - (id)initWithRulerView:(NSRulerView *)ruler 
                                 markerLocation:(float)location 
                                 image:(NSImage *)image
                                 imageOrigin:(NSPoint)imageOrigin;
                                  // Accessor Methods
   - (void)setRepresentedObject:(id <NSCopying>)representedObject;
   - (id <NSCopying>)representedObject;
   - (void)setImageOrigin:(NSPoint)imageOrigin;
   - (NSPoint)imageOrigin;
   - (void)setMarkerLocation:(float)location;
   - (float)markerLocation;
   - (void)setMovable:(BOOL)flag;
   - (void)setImage:(NSImage *)image;
   - (NSImage *)image;
   - (void)setRemovable:(BOOL)flag;
                                  // Instance Methods
   - (void)drawRect:(NSRect)rect;
   - (NSRect)imageRectInRuler;
   - (BOOL)isDragging;
   - (BOOL)isMovable;
   - (BOOL)isRemovable;
   - (NSRulerView *)ruler;
   - (float)thicknessRequiredInRuler;
   - (BOOL)trackMouse:(NSEvent *)mouseDownEvent 
                                 adding:(BOOL)isAdding;
                                  // Methods Implementing ...

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