Instance Method

setNeedsDisplayInRect:

Marks the region of the view within the specified rectangle as needing display, increasing the view’s existing invalid region to include it.

Declaration

- (void)setNeedsDisplayInRect:(NSRect)invalidRect;

Parameters

invalidRect

The rectangular region of the view to mark as invalid; it should be specified in the coordinate system of the view.

Discussion

A later displayIfNeeded method will then perform drawing only within the invalid region. View objects marked as needing display are automatically redisplayed on each pass through the application’s event loop. (View objects that need to redisplay before the event loop comes around can of course immediately be sent the appropriate display method.)

See Also

Invalidating the View’s Content

needsDisplay

A Boolean value that determines whether the view needs to be redrawn before being displayed.

- display

Displays the view and all its subviews if possible, invoking each of the NSView methods lockFocus, drawRect:, and unlockFocus as necessary.

- displayRect:

Acts as display, but confining drawing to a rectangular region of the view.

- displayRectIgnoringOpacity:

Displays the view but confines drawing to a specified region and does not back up to the first opaque ancestor—it simply causes the view and its descendants to execute their drawing code.

- displayRectIgnoringOpacity:inContext:

Causes the view and its descendants to be redrawn to the specified graphics context.

- displayIfNeeded

Displays the view and all its subviews if any part of the view has been marked as needing display.

- displayIfNeededInRect:

Acts as displayIfNeeded, confining drawing to a specified region of the view.

- displayIfNeededIgnoringOpacity

Acts as displayIfNeeded, except that this method doesn’t back up to the first opaque ancestor—it simply causes the view and its descendants to execute their drawing code.

- displayIfNeededInRectIgnoringOpacity:

Acts as displayIfNeeded, but confining drawing to aRect and not backing up to the first opaque ancestor—it simply causes the view and its descendants to execute their drawing code.

- translateRectsNeedingDisplayInRect:by:

Translates the display rectangles by the specified delta.

opaque

A Boolean value indicating whether the view fills its frame rectangle with opaque content.

- viewWillDraw

Informs the view that it will be required to draw content.