Instance Method

lockFocusIfCanDraw

Locks the focus to the view atomically if the canDraw method returns YES and returns the value of canDraw.

Declaration

- (BOOL)lockFocusIfCanDraw;

Discussion

Your thread will not be preempted by other threads between the canDraw method and the lock. This method fails to lock focus and returns NO, when the view is hidden and the current context is drawing to the screen (as opposed to a printing context).

See Also

Focusing

- lockFocus

Locks the focus on the view, so subsequent commands take effect in the view’s window and coordinate system.

Deprecated
- lockFocusIfCanDrawInContext:

Locks the focus to the view atomically if drawing can occur in the specified graphics context.

Deprecated
- unlockFocus

Unlocks focus from the current view.

Deprecated
focusView

Returns the currently focused NSView object, or nil if there is none.