Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / Mac Programming / May 2007



Tip: Looking for answers? Try searching our database.

how to finish editing of table cell

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Wizumwalt@gmail.com - 14 Apr 2007 06:19 GMT
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?
matt neuburg - 14 Apr 2007 16:48 GMT
> 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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.