• 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: How do you tab into an NSTableView?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do you tab into an NSTableView?


  • Subject: Re: How do you tab into an NSTableView?
  • From: Dave Camp <email@hidden>
  • Date: Mon, 11 Aug 2003 09:19:40 -0700

For future list reference, the answer to my question was to subclass the table view and override the following method:

- (BOOL) needsPanelToBecomeKey
{
return YES;
}

That will make the table highlight correctly when you tab in. If there are no rows currently selected, you won't see anything unless you press the up or down arrows. You could work around that by forcing a row (maybe the first row) to be selected when the table is created or something. You might also be able to override another existing method and force a row to be selected if there is not a current selection when the table becomes key.

Hope that helps,
Dave


On Saturday, August 9, 2003, at 03:27 AM, Neil Earnshaw wrote:

On Friday, August 8, 2003, at 06:58 PM, Dave Camp wrote:

I've got a window with three combo-boxes and an NSTableView. The window's first responder is set to the first combo-box, and each combo-box has it's nextKeyView set to the next box. The last box's nextKeyView is set to the NSTableView, and it points to the first box. A nice big loop, just as you would expect.

However, pressing tab only cycles between the combo-boxes. The NSTableView never highlights. If I click a row in the table view and press Tab, it cycles back to the combo-boxes as expected, but subsequent tabbing never makes the table view key again.

I just had a play with one of my windows that has a browser and a table view in a tab view. The browser's nextKeyView is set to the table in IB. When I hit <tab> I can see the browser lose the focus, but the table shows no sign that it's received it ... until I press the down arrow key! Then a row highlights.


Does anyone know if, after tabbing into a table, you can get a table cell into edit mode using just the keyboard? I hate having to resort to the mouse just to start editing.

- Neil



---
The path of least resistance, it's not just for electricity any more.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: How do you tab into an NSTableView? (From: Neil Earnshaw <email@hidden>)

  • Prev by Date: Re: Custom Cocoa control using Carbon? Possible? Examples?
  • Next by Date: Re: Setting focus to text field in drawer
  • Previous by thread: Re: How do you tab into an NSTableView?
  • Next by thread: Re: Why I think I'm so lost
  • Index(es):
    • Date
    • Thread