• 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
Tabbing thru tables
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Tabbing thru tables


  • Subject: Tabbing thru tables
  • From: Bert Torfs <email@hidden>
  • Date: Tue, 4 Jan 2005 22:19:29 +0100

Dear all,

I have a dialog with some textFields and three tables. I treat the individual cells of the table as if they were editfields, so when the first table becomes first responder, its first cell of its first row will be editable. When I tab out of the last cell of the last row of the first table, the first cell of the second table becomes editable etc... .
So far so good, but in some cases, a new table row is created in a table when the user tabs out of its last column. This is done by the window controller in a method that is called from the tables '<x-tad-smaller>textDidEndEditing</x-tad-smaller>' method if the editedColumn/row was the last one.
After the controller finished creating the new row, it redraws the table by calling the setter of the NSArray object to which the table is bound. (I tried to do an insert on that NSArray, but that did not make the table redraw. A call to the setter of the array with itself did do the trick though).
After the new row is created and the table is redrawn, I do the following :

<x-tad-smaller>//number of rows does reflect the fact that the new row was added to the table
int</x-tad-smaller>
<x-tad-smaller> numberOfRows = [newTable numberOfRows];
</x-tad-smaller><x-tad-smaller>[newTable editColumn:0 row:numberOfRows-1 withEvent:NULL select:TRUE];

</x-tad-smaller>
<x-tad-smaller>
</x-tad-smaller>
But these statements are completely ignored : nothing becomes editable and next tab brings me back to the first NSTextField of my dialog.
I did try to make that new table first responder (which I think it is already) by calling

<x-tad-smaller>[[newTable window] makeFirstResponder:newTable];

</x-tad-smaller>
I also tried to post a notification and call the editColumn when receiving the notification. But that did not help neither. Anyone having any idea.
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: NSTextView replaceCharactersInRange performance and thread safety
  • Next by Date: Re: NSTextView replaceCharactersInRange performance and thread safety
  • Previous by thread: Re: NSOutlineViewDataSource on panel window
  • Next by thread: If my program is compiled under XCode can I sell it without distributing the source...
  • Index(es):
    • Date
    • Thread