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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to