Contents

NSRulerView

A ruler and the markers above or to the side of a scroll view’s document view.

Declaration

class NSRulerView

Overview

Views within the scroll view can become clients of the ruler view, having it display markers for their elements, and receiving messages from the ruler view when the user manipulates the markers.

Principal Attributes

  • Displays markers that represent elements of the client view.

  • Displays in arbitrary units.

  • Provides for an accessory view containing extra controls.

Creation

Commonly Used Methods

clientView

Changes the ruler’s client view.

markers

Sets the markers displayed by the ruler view.

accessoryView

Sets the accessory view.

trackMarker(_:withMouseEvent:)

Allows the user to add a new marker.

Overview

See NSRulerMarkerClientViewDelegation for delegate methods that may be of interest.

Topics

Creating a Ruler View

Altering measurement units

Setting the client view

Setting an accessory view

Setting the zero mark position

Adding and removing markers

Drawing temporary ruler lines

Drawing

Ruler layout

See Also

Rulers