• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Restoring Tiger NSTableView behaviour in Leopard
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Restoring Tiger NSTableView behaviour in Leopard
      • From: Corbin Dunn <email@hidden>
  • Prev by Date: Re: NSArrayController's "selectionIndex" weirdness
  • Next by Date: Re: Efficient object wrappers and GC
  • Previous by thread: Re: Core Data and the Document Dirty indicator
  • Next by thread: Re: Restoring Tiger NSTableView behaviour in Leopard
  • Index(es):
    • Date
    • Thread