• 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
Drag to Finder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Drag to Finder


  • Subject: Drag to Finder
  • From: Lorenzo <email@hidden>
  • Date: Tue, 26 Aug 2003 08:12:27 +0200

Hi,
I drag a row from an NSTableView to the Finder.
The row contains a file pathname, so if I drag the row to the Desktop, the
Finder moves that file from his original folder to the desktop.
Everything works well, and this is what I want.

Now, since moving great amount of files coming from different folders to the
desktop (without the possibility to undone the task) is a very dangerous
task I would like to notify the user with a dialog, such a way he could
cancel the task.

I would like to display the dialog just after the mouseUp onto the Finder,
so I know that the final target is really the Finder (and not other
applications). If so, I display the dialog sunch a way if the user cancel
the task, the Finder DOESN'T move the files anymore.

____________________________________________________________________
THE QUESTIONS ARE:
- Where is the exact point of the drag I should display the dialog?
- And how to do that?
____________________________________________________________________


----------------------------------
If I display the dialog during the

- (BOOL)tableView:(NSTableView *)tv writeRows:(NSArray*)rows
toPasteboard:(NSPasteboard*)pboard

it's too earlier, firstly because the mouse is still down, secondly because
the dialog appears just after the mouse has been moved for few millimeters
and I don't know yet what is the destination of the drag. The destination
could even be a different application, and in this case I dont' need to show
the dialog.

----------------------------------
If I display the dialog during the

- (NSDragOperation)draggingSourceOperationMaskForLocal:(BOOL)isLocal

I can't show the dialog here because this routine is being called
continuously, at any mouse movement. I also tried to capture here the
mouseUp and I returned NSDragOperationNone, but the Finder performed the
task anyway(!).

----------------------------------
If I display the dialog during the

- (void)draggedImage:(NSImage *)anImage endedAt:(NSPoint)aPoint
operation:(NSDragOperation)operation

it's too late. The Finder already performed the task.

----------------------------------

Do you know how to do?
Thank you.



Best Regards
--
Lorenzo
email: email@hidden
_______________________________________________
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.

References: 
 >Stop a drag. When? (From: Lorenzo <email@hidden>)

  • Prev by Date: Fwd: Highlighting labels
  • Next by Date: Custom Views in a NSForm/NSMatrix
  • Previous by thread: Stop a drag. When?
  • Next by thread: Applying text attributes in Cocoa
  • Index(es):
    • Date
    • Thread