• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Detecting option key down/up during drag [solution]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Detecting option key down/up during drag [solution]


  • Subject: Re: Detecting option key down/up during drag [solution]
  • From: Keith Renz <email@hidden>
  • Date: Mon, 17 Nov 2003 22:42:02 -0500
  • Resent-date: Mon, 17 Nov 2003 22:42:39 -0500
  • Resent-from: Keith Renz <email@hidden>
  • Resent-message-id: <email@hidden>
  • Resent-to: Cocoa-Dev List <email@hidden>

The solution to this dilemma is to subclass NSTableView and in your subclass, override both of the following methods. You will then get the Finder-like behavior of instantly changing the drag operation type (including the cursor) during the drag operation.

Dragging source method:
- (NSDragOperation)draggingSourceOperationMaskForLocal:(BOOL)flag;

Dragging destination method:
- (NSDragOperation)draggingUpdated:(id <NSDraggingInfo>)sender;

A few notes:

You must still provide the the standard dragging methods in your table view data source.

Invoke super first in draggingUpdated:.

Olivier, thanks for pointing me in the right direction!

Keith
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Controllers, NSTableView & DragNDrop?
  • Next by Date: Re: Strange characters in Toolbar
  • Previous by thread: Re: Controllers, NSTableView & DragNDrop?
  • Next by thread: No warnings of missing prototypes during builds
  • Index(es):
    • Date
    • Thread