I have an NSTableColumn that uses the default cells. When I edit one
cell and press enter, the focus immediately goes on to the next row
highlighting the value inside it and ready for edit.
How do I just press enter for the cell I'm editing and be done with
editing at that point?
> I have an NSTableColumn that uses the default cells. When I edit one
> cell and press enter, the focus immediately goes on to the next row
> highlighting the value inside it and ready for edit.
>
> How do I just press enter for the cell I'm editing and be done with
> editing at that point?
<http://www.cocoabuilder.com/archive/message/cocoa/2007/4/9/181597>
m.

Signature
matt neuburg, phd = matt@tidbits.com, http://www.tidbits.com/matt/
Tiger - http://www.takecontrolbooks.com/tiger-customizing.html
AppleScript - http://www.amazon.com/gp/product/0596102119
Read TidBITS! It's free and smart. http://www.tidbits.com
Wizumwalt@gmail.com - 28 May 2007 05:47 GMT
I'll try to post this one again, seems the last didn't take.
The problem I have is that when I edit a text field in my
NSOutlineView, the editor moves on to the next field and I don't want
this to happen. I only want to edit one field, and when the user
presses done, that's it. I tried using the above links to what others
were doing.
Does anyone see anything wrong with what I've got because this doesn't
seem to be working.
-----------------
- (void)outlineView:(NSOutlineView *)outlineView setObjectValue:
(id)object
forTableColumn:(NSTableColumn *)tableColumn byItem:(id)item
{
...
[self forceEndEditing:outlineView];
}
- (void)forceEndEditing:(NSOutlineView *)outlineView
{
id window = [outlineView window];
if ([window makeFirstResponder:outlineView]) {
//[outlineView deselectAll:self];
[outlineView deselectRow:[outlineView editedRow]];
}
else {
[window endEditingFor:nil];
}
return;
}
David Phillip Oster - 28 May 2007 18:05 GMT
> I'll try to post this one again, seems the last didn't take.
>
[quoted text clipped - 3 lines]
> presses done, that's it. I tried using the above links to what others
> were doing.
See
http://www.borkware.com/quickies/one?topic=NSTableView
it, and
<http://www.cocoabuilder.com/archive/message/cocoa/2007/4/9/181597> ,
the link you were originally following work, by overriding
- (void)textDidEndEditing:
since you are overriding
- (void)outlineView:(NSOutlineView *)outlineView setObjectValue:
(id)object
forTableColumn:(NSTableColumn *)tableColumn byItem:(id)item
I'm not surprised you got different results.