Initializes a newly allocated ruler marker, associating it with (but not adding it to) a specified ruler view and assigning the attributes provided.
- macOS 10.0+
The ruler view with which to associate the ruler marker. This method raises an
The x or y position of the marker in the client view’s coordinate system, depending on whether the ruler view is horizontal or vertical.
The image displayed at the marker location. This method raises an
The point within the image positioned at the marker location, expressed in pixels relative to the lower-left corner of the image.
An initialized ruler marker object.
The image used to draw the marker must be appropriate for the orientation of the ruler. Markers may need to look different on a horizontal ruler than on a vertical ruler, and the ruler view neither scales nor rotates the images.
To add the new ruler marker to
a, use either of NSRulerView’s
add immediately puts the marker on the ruler, while
track allows the client view to intercede in the addition and placement of the marker.
A new ruler marker can be moved on its ruler view, but not removed. Use
removable to change these attributes. The new ruler marker also has no represented object; use
represented to set one.
This method is the designated initializer for the NSRulerMarker class.