• 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: NSOutlineView and the trash can, take 2
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >NSOutlineView and the trash can, take 2 (From: John Stiles <email@hidden>)

  • Prev by Date: RE: NSOutlineView and the trash can, take 2
  • Next by Date: Re: NSOutlineView and the trash can, take 2
  • Previous by thread: Re: NSOutlineView and the trash can, take 2
  • Next by thread: Re: NSOutlineView and the trash can, take 2
  • Index(es):
    • Date
    • Thread