• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: ESC to cancel editing in tableview
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ESC to cancel editing in tableview


  • Subject: Re: ESC to cancel editing in tableview
  • From: Salánki Benjámin <email@hidden>
  • Date: Sat, 6 Jan 2007 01:33:03 +0100

I already thought of that, but keyDown of the table view does not get called while editing of a cell is in progress. So I have to rule that out. I added the cancelOperation: method to my subclass which actually gets called when i press ESC while the cell is being edited, but I can't figure out how to finish the actual edit. (cancelOperation is defined by NSResponder, but not implemented).

Ben

On Jan 6, 2007, at 1:18 AM, Michael Watson wrote:

NSTableView is a descendant of NSResponder, which implements - keyDown: . . . perhaps you could override that to perform your escape key check.


-- m

On 05 Jan, 2007, at 19:01, Salánki Benjámin wrote:

Yes, I just checked, and hitting ESC does not trigger textDidEndEditing.

So there has got to be something else.

Ben


On Jan 6, 2007, at 12:59 AM, Michael Watson wrote:

Here are the results you can get:

enum {

   NSIllegalTextMovement = 0,
   NSReturnTextMovement  = 0x10,
   NSTabTextMovement     = 0x11,
   NSBacktabTextMovement = 0x12,
   NSLeftTextMovement    = 0x13,
   NSRightTextMovement   = 0x14,
   NSUpTextMovement      = 0x15,
   NSDownTextMovement    = 0x16,
   NSCancelTextMovement  = 0x17,
   NSOtherTextMovement    = 0
};

I still seem to be under an incorrect impression that you can catch esc this way.


-- m


On 05 Jan, 2007, at 18:49, Benjámin Salánki wrote:

I will, but according to the docs the NSTextMovement can be return, tab or shift-tab. Maybe the docs are not mentioning all options then.

Ben

On Jan 6, 2007, at 12:47 AM, Michael Watson wrote:

If you've subclassed NSTableView, implement the - (void) textDidEndEditing:(NSNotification *)notification delegate method to look for the keys contained in the notification:

[[notification userInfo] valueForKey:@"NSTextMovement"]


-- mikey

On 05 Jan, 2007, at 18:25, Benjámin Salánki wrote:

Hi there,

I have a subclassed NSTableView in which I want to cancel the editing of a cell by pressing ESC. Could someone point me into the right direction please? I could not find anything in the archives (or maybe i'm just not too good at searching).

Thanks,
Ben
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
40bungie.org


This email sent to email@hidden






_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


  • Follow-Ups:
    • Re: ESC to cancel editing in tableview
      • From: Michael Watson <email@hidden>
References: 
 >ESC to cancel editing in tableview (From: Benjámin Salánki <email@hidden>)
 >Re: ESC to cancel editing in tableview (From: Michael Watson <email@hidden>)
 >Re: ESC to cancel editing in tableview (From: Benjámin Salánki <email@hidden>)
 >Re: ESC to cancel editing in tableview (From: Michael Watson <email@hidden>)
 >Re: ESC to cancel editing in tableview (From: Salánki Benjámin <email@hidden>)
 >Re: ESC to cancel editing in tableview (From: Michael Watson <email@hidden>)

  • Prev by Date: Re: ESC to cancel editing in tableview
  • Next by Date: Re: ESC to cancel editing in tableview
  • Previous by thread: Re: ESC to cancel editing in tableview
  • Next by thread: Re: ESC to cancel editing in tableview
  • Index(es):
    • Date
    • Thread