This following episode of Late Night Cocoa gives a solution to this precise
problem of implementing the delete functionality on TableViews and
OutlineViews without having to subclass it.

http://www.mac-developer-network.com/podcasts/latenightcocoa/episode9/index.html

Hope it helps :)


-Dalzhim


2008/10/20 Sean McBride <[EMAIL PROTECTED]>

> On 10/20/08 2:27 PM, Corbin Dunn said:
>
> >> Overriding deleteBackward: (from NSResponder) doesn't seem to work.
> >> For
> >> some reason, it is never called.
> >
> >For various reasons, NSTableView doesn't implement -
> >interpretKeyEvents:, that's why it isn't called.
>
> Thanks for your reply Corbin!
>
> I assume NSOutlineView is the same?
>
> >This will work well, and is the only good way to implement it.
> >Ideally, you would only want to do this if there isn't an active "type
> >select" going on, but there is no API to tell if that is happening or
> >not. (As usual, feel free to log requests for that). Theoretically,
> >backspacing while type selecting could undo the last character; in
> >practice, that is a dangerous thing to do, since you might
> >accidentally delete something you didn't intend to.
>
> A few quickie followups, if I may:
>
> - so will this actually work with custom keybindings?  Or is there just
> no good way to support that?
> - did I miss a constant for the backward delete char (an analogue to
> NSDeleteCharacter)?  I'm using 0xf728, discovered via gdb. :(
>
> Cheers,
>
> --
> ____________________________________________________________
> Sean McBride, B. Eng                 [EMAIL PROTECTED]
> Rogue Research                        www.rogue-research.com
> Mac Software Developer              Montréal, Québec, Canada
>
>
> _______________________________________________
>
> 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/dalzhim.mlist%40gmail.com
>
> This email sent to [EMAIL PROTECTED]
>
_______________________________________________

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