• 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
Re: Navigating in a NSTableView with tab key
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Navigating in a NSTableView with tab key


  • Subject: Re: Navigating in a NSTableView with tab key
  • From: Kyle Sluder <email@hidden>
  • Date: Thu, 09 Aug 2012 23:58:34 -0700

On Aug 8, 2012, at 11:09 PM, François Pelsser <email@hidden> wrote:

> Hello,
> I want to be able to navigate in a table view with the tab key.  So i
> subclassed NSTableView and i added the overwrite the method
>
>
> - (void) textDidEndEditing: (NSNotification *) notification

Since NSTableView subclasses NSControl, you should instead implement -controlTextDidEditing: on your table view's delegate.

>
> {
>
>    CellLoc editedCell;
>
>    editedCell.col = [super editedColumn];
>
>    editedCell.row = [super editedRow];
>
>
>    NSDictionary *userInfo = [notification userInfo];
>
>    int textMovement = [[userInfo valueForKey:@"NSTextMovement"] intValue];
>
>
>    [super textDidEndEditing:notification];
>
>
>
>    if (textMovement == NSTabTextMovement)
>
>    {
>
>
>        CellLoc nextCell = [self nextEditableCell:editedCell];
>
>
>
>        [self selectRowIndexes:[NSIndexSet indexSetWithIndex:nextCell.row]
> byExtendingSelection:NO];
>
>        if(nextCell.row > editedCell.row)
>
>            [self editColumn:nextCell.col row:nextCell.row withEvent: nil
> select: YES];
>
>
>
>
>    }
>
> }
>
>
>
> CellLoc is a dummy struc containing row and col.
>
> The problem is that the movement in cells is ok but when editColumn is
> called the elements edited are cancelled.  So it is like i didn't change
> the text.  (I use a datasource
> and -tableView:setObjectValue:forTableColumn:row: is not called)

Try sending -validateEditing to the table view before calling -editColumn::::.

--Kyle Sluder
_______________________________________________

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


References: 
 >Navigating in a NSTableView with tab key (From: François Pelsser <email@hidden>)

  • Prev by Date: Missing creating date for items copied with copyItemAtPath:toPath:error:?
  • Next by Date: Re: filtering the values in an NSTableColumn
  • Previous by thread: Navigating in a NSTableView with tab key
  • Next by thread: Re: NSUserDefaults locks up on 10.8
  • Index(es):
    • Date
    • Thread