Re: Inline tableview editing problem (table doesn't end editing)
Re: Inline tableview editing problem (table doesn't end editing)
- Subject: Re: Inline tableview editing problem (table doesn't end editing)
- From: Stéphane Sudre <email@hidden>
- Date: Wed, 14 Apr 2004 18:52:57 +0200
On 14 avr. 2004, at 18:29, Robert La Ferla wrote:
I have a table view in a Cocoa (Java) application that allows the user
to add rows to it. When a new row is added, the cell at that row (and
at a predetermined column) is made editable and it's contents
selected. This is accomplished by a call to editLocation() However,
after the user finishes editing by pressing return, the cell does not
end editing. I would like to deselect the cell and take it out of
editing mode when the user presses return or tabs out of the field. I
tried various delegate and notification hooks to coerce it and the
field editor but nothing quite worked. Perhaps, I am overlooking
something simple or perhaps I should use something other than
editLocation() to begin editing of the cell in the first place?
BTW - Most of the example apps that I've looked at don't use in-line
editing on table views. Instead, when a row is added, they use a modal
panel to get user input.
NSTableView
public void editLocation(int columnIndex, int rowIndex, NSEvent
theEvent, boolean flag)
I also found this statement in NSCell's "editWithFrameInView()"
documentation:
"Its the responsibility of the delegate to end editing when
responding to textShouldEndEditing. In doing this, it should remove
any data from textObj."
I tried asking the cell to endEditing() within textShouldEndEditing
but that didn't work either.
With the Obj-C API, you have to subclass NSTableView to have this
behavior. The OmniGroup has a NSTableView subclass which is showing
this in the OmniAppKit IIRC.
_______________________________________________
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.