Re: How to delete table rows to delete by dragging them to trash in the dock
Re: How to delete table rows to delete by dragging them to trash in the dock
- Subject: Re: How to delete table rows to delete by dragging them to trash in the dock
- From: Guy English <email@hidden>
- Date: Tue, 8 Feb 2005 16:57:11 -0500
On Mon, 7 Feb 2005 09:47:13 +0530, JanakiRam <email@hidden> wrote:
> I Have a NSTableView which shows the data of the students. By pressing
> the delete button i was able to delete them, now my requirement is when
> i drag my rows from table view to trash in the dock i should be able to
> delete them. Please let me know how can i achieve this.
If you drag items to the trash you'll get a NSDragOperationDelete
operation. Subclass NSTableView to handle that. My implementation
talks to the tables delegate and datasource to work out what to do.
Basically once you get an NSDragOperationDelete read your objects
out of the pasteboard, pass them to the delegate to see if it's ok to
delete them, if so then pass them to the datasource telling it to do
the actual delete. My subclass passes the pasteboard around directly,
that way it doesn't need to know how the data source has stashed it's
information in there.
And, for the record, I think dragging to the trash to delete is a fine idea.
Hope that helps,
Guy
_______________________________________________
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