Restoring Tiger NSTableView behaviour in Leopard
Restoring Tiger NSTableView behaviour in Leopard
- Subject: Restoring Tiger NSTableView behaviour in Leopard
- From: "K. Darcy Otto" <email@hidden>
- Date: Fri, 11 Apr 2008 11:38:15 -0700
The application I am working on is essentially one big table, and I'd
like to restore at least one aspect the default tab behaviour that
Tiger used when editing tables. Namely, when the user is at the end
of the row and hits tab, I'd like editing to begin at the beginning of
the next row. I note that here,
http://www.cocoabuilder.com/archive/message/cocoa/2007/10/31/191866
the issue is acknowledged, and a solution proposed. The solution is
to subclass NSTableView and implement -(void)textDidEndEditing:
(NSNotification *)notification, but I'm having a problem with the
implementation. Here is what I have so far:
-(void)textDidEndEditing:(NSNotification *)notification
{
NSDictionary *userInfo = [notification userInfo];
int textMovement = [[userInfo valueForKey:@"NSTextMovement"] intValue];
if (textMovement == NSTabTextMovement)
{
// Tab pressed!
[super textDidEndEditing:notification];
}
}
So, I get to "Tab pressed!", but then don't know how to implement
editing of the first column of the next row. I think I could do this
if I could figure out what column had just finished being edited. I
suppose I could create a variable in the subclass that stores this
information when editing begins; but I was thinking there should be a
property I can just read (and I'm not sure what property that is).
When I use -selectedColumn on the NSTableView, I don't get anything
useful (-1), because apparently no column is selected (I do get useful
information from -selectedRow; but this isn't quite what I need).
Thanks.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden