• 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: How do I change behavior of NSTableView textDidEndEditing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do I change behavior of NSTableView textDidEndEditing


  • Subject: Re: How do I change behavior of NSTableView textDidEndEditing
  • From: Andreas Mayer <email@hidden>
  • Date: Fri, 1 Nov 2002 15:02:18 +0100

Am Donnerstag, 31.10.02 um 20:06 Uhr schrieb Bob Peterson:

in NSTableView, I want to cause TAB, ENTER and RETURN to terminate editing, but not open another cell for editing. I don't see any property or delegate method for managing this. Can anyone offer a suggestion how to accomplish it?

Subclass NSTableView and overwrite textDidEndEditing:

I think I posted some sample code in the macosx-dev list a few days ago ... here it is:

- (void)textDidEndEditing:(NSNotification *)aNotification
{
BOOL doEdit = YES;

[super textDidEndEditing:aNotification];

switch ([[[aNotification userInfo] objectForKey:@"NSTextMovement"] intValue]) {
case NSReturnTextMovement: // return
{
doEdit = NO;
break;
}
case NSBacktabTextMovement: // shift tab
{
doEdit = YES;
break;
}
//case NSTabTextMovement: // tab
default:
{
doEdit = YES;
}
} // switch

if (!doEdit) {
[self validateEditing];
[self abortEditing];
// do something else ...
}
}


bye. Andreas.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: Newbie Locating Fonts Question
  • Next by Date: Re: metallized interface
  • Previous by thread: Re: Newbie Locating Fonts Question
  • Next by thread: Re: metallized interface
  • Index(es):
    • Date
    • Thread