• 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: Changing NSTableView cell editing behaviour
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Changing NSTableView cell editing behaviour


  • Subject: Re: Changing NSTableView cell editing behaviour
  • From: Christoph Priebe <email@hidden>
  • Date: Wed, 3 Mar 2004 15:59:15 +0100

First thank your all for your reply.

I tried Allan's method but id did not work for me because pressing
return end the editing and move the focus to the next cell. (And I don't
whant the focus move.) But Allan showed me the way. What I do now
is looking for a 'NSReturnTextMovement' in the user info of the notification.
If I find one I create a new notification with 'NSOtherTextMovement' as
text movement and pass the changed notification to [super ...].

What do you think?

Thank you all,
Christoph


- (void) textDidEndEditing: (NSNotification*) aNotification {
// is the editing stoped by a 'return movement'?
int movement = [[[aNotification userInfo] objectForKey:@"NSTextMovement"] intValue];
if (movement == NSReturnTextMovement) {
// copy the existing user info into a mutable dictionary...
NSMutableDictionary* newUserInfo = [NSMutableDictionary dictionaryWithCapacity:[[aNotification userInfo] count]];
[newUserInfo addEntriesFromDictionary:[aNotification userInfo]];

// (THE MAGIC:) change the 'return' text movement to something different...
[newUserInfo setObject:[NSNumber numberWithInt:NSOtherTextMovement] forKey:@"NSTextMovement"];

// create a new notification with the data from the old...
aNotification = [NSNotification notificationWithName:[aNotification name] object:[aNotification object] userInfo:newUserInfo];
}
[super textDidEndEditing:aNotification];
[[self window] makeFirstResponder:self];
}
_______________________________________________
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.


  • Follow-Ups:
    • Re: Changing NSTableView cell editing behaviour
      • From: Allan Odgaard <email@hidden>
References: 
 >Changing NSTableView cell editing behaviour (From: Christoph Priebe <email@hidden>)
 >Re: Changing NSTableView cell editing behaviour (From: Allan Odgaard <email@hidden>)

  • Prev by Date: NSTextStorage: Deadlock
  • Next by Date: Re: Thanks for the TableView hint.
  • Previous by thread: Re: Changing NSTableView cell editing behaviour
  • Next by thread: Re: Changing NSTableView cell editing behaviour
  • Index(es):
    • Date
    • Thread