Re: Cut & past support in NSTableView
Re: Cut & past support in NSTableView
- Subject: Re: Cut & past support in NSTableView
- From: Brian Webster <email@hidden>
- Date: Wed, 20 Feb 2002 11:50:18 -0600
On Tuesday, February 19, 2002, at 10:23 PM, cocoa-dev-
email@hidden wrote:
How do I go about adding cut, copy, paste and clear support to an
NSTableView?
As far as I can see, I should subclass NSTableView, add cut,
copy, paste
and clear methods to it. I imagine that I'll just pass those straight
on to the delegate and actually do the hard work in there. Anybody got
an alternative solution?
I think this is probably the cleanest solution for this. You
could probably implement the action methods in, say, your
window's delegate, but then you'd have to check which view is
the first responder anyway, so it'd kind of defeat the whole
purpose of the responder chain.
On a related note, how would I get the NSTableView to treat the delete
key as a request to delete the currently selected row(s)?
I believe that the delete key is bound by default to call the
deleteBackward: action method, so if you implement that method
in your NSTableView subclass, you should be able to handle it
there. You can also implement deleteForward: if you want to
support the DEL key as well.
--
Brian Webster
email@hidden
http://homepage.mac.com/bwebster
_______________________________________________
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.