Instance Method

rulerView:shouldAddMarker:

Returns whether a new marker can be added.

Declaration

- (BOOL)rulerView:(NSRulerView *)ruler shouldAddMarker:(NSRulerMarker *)marker;

Parameters

aRulerView

The ruler view sending the message.

aMarker

The marker to be added.

Return Value

YES if aMarker can be added, NO otherwise.

Discussion

The receiver checks for permission to make the change by invoking shouldChangeTextInRange:replacementString: and returning the return value of that message. If the change is allowed, the receiver is then sent a rulerView:didAddMarker: message.

See Also

NSRulerView Client Methods

- rulerView:didMoveMarker:

Modifies the paragraph style of the paragraphs containing the selection to record the new location of the marker.

- rulerView:willMoveMarker:toLocation:

Returns a potentially modified location to which the marker should be moved.

- rulerView:shouldMoveMarker:

Returns whether the marker should be moved.

- rulerView:didRemoveMarker:

Modifies the paragraph style of the paragraphs containing the selection—if possible—by removing the specified marker.

- rulerView:shouldRemoveMarker:

Returns whether the marker should be removed.

- rulerView:didAddMarker:

Modifies the paragraph style of the paragraphs containing the selection to accommodate a new marker.

- rulerView:willAddMarker:atLocation:

Returns a potentially modified location to which the marker should be added.

- rulerView:handleMouseDown:

Adds a left tab marker to the ruler at the location clicked.