Re: NSOutlineView and the trash can, take 2
Re: NSOutlineView and the trash can, take 2
- Subject: Re: NSOutlineView and the trash can, take 2
- From: Guy English <email@hidden>
- Date: Wed, 3 Aug 2005 01:56:09 -0400
Hi John,
Below you'll find some code from my table view subclass that
deletes on drag to trash. It actually gets it's delegate to delete.
The delegate is handed the pasteboard and does the deed. There's a
good post here: http://cocoa.mamasam.com/COCOADEV/2002/07/2/40890.php
on handling keyboard input and deleting that way.
Good luck,
Guy
- (void)draggedImage:(NSImage *)anImage endedAt:(NSPoint)aPoint
operation:(NSDragOperation)operation
{
[super draggedImage: anImage endedAt: aPoint operation: operation];
if ( operation == NSDragOperationDelete )
{
if ( [self delegate] &&
[[self delegate] respondsToSelector: @selector(
tableView:itemsWereDraggedToTrash: )] )
{
[[self delegate] tableView: self itemsWereDraggedToTrash:
[NSPasteboard pasteboardWithName: NSDragPboard]];
}
}
}
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden