Re: ESC while editing NSOutlineView subclass

2009-04-23 Thread Jim Correia
On Thu, Apr 23, 2009 at 5:16 PM, Kevin Gessner wrote: I've got this in MyEditorOutlineView, my NSOutlineView subclass. > > - (void)keyDown:(NSEvent *)theEvent { >[super keyDown:theEvent]; > >NSLog(@"keyDown: %d", [theEvent keyCode]); > >#define returnKeyCode 36 >switch([theEvent ke

Re: ESC while editing NSOutlineView subclass

2009-04-23 Thread Kevin Gessner
I've got this in MyEditorOutlineView, my NSOutlineView subclass. - (void)keyDown:(NSEvent *)theEvent { [super keyDown:theEvent]; NSLog(@"keyDown: %d", [theEvent keyCode]); #define returnKeyCode 36 switch([theEvent keyCode]) { case returnKeyCode: if([[self del

Re: ESC while editing NSOutlineView subclass

2009-04-23 Thread Corbin Dunn
The easiest way to do this is to just subclass tableview and override keyDown:. IE: - (void)keyDown:(NSEvent *)theEvent { NSString *keyString = [theEvent charactersIgnoringModifiers]; unichar keyChar = ([keyString length]) > 0 ? [keyString characterAtIndex:0] : 0; BOOL handledKey

RE: ESC while editing NSOutlineView subclass

2009-04-23 Thread Ulai Beekam
called? U > From: ke...@kevingessner.com > To: cocoa-dev@lists.apple.com > Date: Thu, 23 Apr 2009 15:04:52 +0200 > Subject: ESC while editing NSOutlineView subclass > > Hello list, > > I've created a subclass of NSOutlineView, MyEditorOutlineView > (implements only te

ESC while editing NSOutlineView subclass

2009-04-23 Thread Kevin Gessner
Hello list, I've created a subclass of NSOutlineView, MyEditorOutlineView (implements only textDidEndEditing: and keyDown:). When a row is being edited, I'd like the escape key to stop editing. I'm having trouble working with the field editor. I implemented - (BOOL)control:(NSControl *)co