Re: Properly supporting 'delete' key presses in NSTableView
Re: Properly supporting 'delete' key presses in NSTableView
- Subject: Re: Properly supporting 'delete' key presses in NSTableView
- From: Andy Lee <email@hidden>
- Date: Tue, 21 Oct 2008 09:32:01 -0400
On Oct 20, 2008, at 5:07 PM, Sean McBride wrote:
In 10.5, NSTableView handles many keypresses automatically: up arrow,
down arrow, page up, page down, home, end, and even 'type select'.
I also need to (robustly!) support the 'delete' key.
I just noticed this (thanks to a reference to Opacity on another
discussion thread):
<http://likethought.com/myriad/2008/04/11/a-slightly-improved-nstableview/
>
For Opacity, I put together a subclass of NSTableView that adds a
few more features-specifically for handling keyboard presses.
LTKeyPressTableView adds enter or return to edit a row, delete to
delete the current row, and hooks to intercept left and right key
presses.
It's a lightweight subclass that (at a glance) seems to take the same
approach as you did, but abstracts the behavior into delegate methods.
Thought it might be worth looking at if only to compare notes.
--Andy
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden