Re: NSTableView behavior changes
Re: NSTableView behavior changes
- Subject: Re: NSTableView behavior changes
- From: Harry Plate <email@hidden>
- Date: Wed, 18 Mar 2009 11:18:56 -0700
- Thread-topic: NSTableView behavior changes
Matt,
<snip>
>> 1) I defined my controller class:
>> @interface MCController : NSResponder
>>
>> 2) I then defined (void)deleteBackward:(id)
>>
>> 3) in -awakeFromNib, I set my controller as 1st responder:
>>
>> [sourceTableView setNextResponder:self]
>
> Instead of 2, define keyDown and check to see if ([[theEvent characters]
> isEqualToString: @"\177"]).
>
After more googling last night, I found similar suggestions; in fact I ended
up subclassing the NSTableView, and overriding keyDown:
This worked very nicely.
One problem that still troubles me is I cannot seem to trap <cmd>A - I was
hoping to implement a "select all" functionality for my "uneditable" table
view. I can get <option>A, or <control>A --- but it appears that someone
else swallows the <cmd>A
Still researching that issue...
BTW, couldn't the same thing be done for an NSTextView? Ie, override the
keyDown: method to get the "delete" functionality that I was striving for
above?
Comments appreciated!
-harry
_______________________________________________
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