Re: Starting editing for a Row as soon as it is Added.
Re: Starting editing for a Row as soon as it is Added.
- Subject: Re: Starting editing for a Row as soon as it is Added.
- From: "Sean McBride" <email@hidden>
- Date: Thu, 27 Aug 2009 15:18:10 -0400
- Organization: Rogue Research Inc.
On 8/27/09 4:42 PM, Joshua Garnham said:
>I have an NSOutlineView and what I want to happen is that when a row is
>added I want the row that has been added to Start Editing immediately
>like when you double click on a row.
@implementation NSTableView (RRExtra)
- (void)makeEditableSelectedCellOfColumnIdentifier:
(NSString*)inColumnIdentifier
{
NSTableColumn* column = [self tableColumnWithIdentifier:inColumnIdentifier];
if (column && ![column isHidden])
{
if ([self numberOfSelectedRows] == 1)
{
NSInteger columnIndex = [self columnWithIdentifier:inColumnIdentifier];
NSInteger selectRowIndex = [self selectedRow];
if ((columnIndex != -1) && (selectRowIndex != -1))
{
[self editColumn:columnIndex row:selectRowIndex withEvent:nil select:YES];
}
}
}
}
@end
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
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