Instance Method

shouldDelayWindowOrderingForEvent:

Allows the user to drag objects from the view without activating the app or moving the window of the view forward, possibly obscuring the destination.

Declaration

- (BOOL)shouldDelayWindowOrderingForEvent:(NSEvent *)event;

Parameters

theEvent

An object representing an initial mouse-down event.

Return Value

If this method returns YES, the normal window-ordering and activation mechanism is delayed (not necessarily prevented) until the next mouse-up event. If it returns NO, then normal ordering and activation occur.

Discussion

Never invoke this method directly; it’s invoked automatically for each mouse-down event directed at the NSView.

An NSView subclass that allows dragging should implement this method to return YES if theEvent is potentially the beginning of a dragging session or of some other context where window ordering isn’t appropriate. This method is invoked before a mouseDown: message for theEvent is sent. The default implementation returns NO.

If, after delaying window ordering, the view actually initiates a dragging session or similar operation, it should also send a preventWindowOrdering message to NSApp, which completely prevents the window from ordering forward and the activation from becoming active. preventWindowOrdering is sent automatically by the dragImage: and dragFile: methods of NSView.

See Also

Dragging Operations

- registerForDraggedTypes:

Registers the pasteboard types that the view will accept as the destination of an image-dragging session.

- unregisterDraggedTypes

Unregisters the view as a possible destination in a dragging session.

registeredDraggedTypes

The array of pasteboard drag types that the view can accept.

- beginDraggingSessionWithItems:event:source:

Initiates a dragging session with a group of dragging items.

- dragFile:fromRect:slideBack:event:

Initiates a dragging operation from the view, allowing the user to drag a file icon to any application that has window or view objects that accept files.

Deprecated
- dragPromisedFilesOfTypes:fromRect:source:slideBack:event:

Initiates a dragging operation from the view, allowing the user to drag one or more promised files (or directories) into any application that has window or view objects that accept promised file data.

Deprecated