An NSRulerMarker object displays a symbol on an NSRulerView object, indicating a location for whatever graphics element it represents in the client of the ruler view (for example, a margin or tab setting, or the edges of a graphic on the page).


Creating instances

init(ruler​View:​ NSRuler​View, marker​Location:​ CGFloat, image:​ NSImage, image​Origin:​ NSPoint)

Initializes a newly allocated ruler marker, associating it with (but not adding it to) a specified ruler view and assigning the attributes provided.

Getting the ruler view

var ruler:​ NSRuler​View

The receiver's ruler view.

Setting the image

var image:​ NSImage

The receiver’s image.

var image​Origin:​ NSPoint

The point in the receiver’s image that is positioned at the receiver’s location on the ruler view.

var image​Rect​In​Ruler:​ NSRect

The rectangle occupied by the receiver’s image.

var thickness​Required​In​Ruler:​ CGFloat

The amount of the receiver’s image that’s displayed above or to the left of the ruler view's baseline.

Setting movability

var is​Movable:​ Bool

A boolean which indicates whether the user can move the receiver in its ruler view.

var is​Removable:​ Bool

A boolean that indicates whether the user can remove the receiver from its ruler view.

Setting the location

var marker​Location:​ CGFloat

The location of the receiver in the coordinate system of the ruler view's client view.

Setting the represented object

var represented​Object:​ NSCopying?

The object the receiver represents.

Drawing and event handling

func draw(NSRect)

Draws the receiver’s image that appears in the supplied rectangle.

var is​Dragging:​ Bool

A Boolean that indicates whether the receiver is being dragged.

func track​Mouse(with:​ NSEvent, adding:​ Bool)

Handles user manipulation of the receiver in its ruler view.


Inherits From