• 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: Tabbing a NSTableView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Tabbing a NSTableView


  • Subject: Re: Tabbing a NSTableView
  • From: Pierre-Olivier Latour <email@hidden>
  • Date: Mon, 08 Jul 2002 00:03:41 +0200

>> I'd also like the NSTableView to have the focus rect.
>
> <http://cocoa.mamasam.com/COCOADEV/2002/03/2/29535.php>
>
> (Really, other people can search the archives too...)

Thanks & Sorry, I didn't know about _these_ archives (I usually go to
lists.apple.com, but finding something here is rather difficult).

Anyway, I copy-pasted your code: It seems to work fine as long as I do not
start clicking into the NSTableView. Any time I select a line, it redraws
the focus ring and displays a vertical blue line in the middle of the
table... I had to add a line to this method:

- (void)drawRect:(NSRect)rect {
[super drawRect: rect];
NSLog(@"%@ drawing focus ring? %hd", self, shouldDrawFocusRing);
if (shouldDrawFocusRing) {
[self setKeyboardFocusRingNeedsDisplayInRect: [self bounds]]; <---
NSSetFocusRingStyle(NSFocusRingOnly);
NSRectFill(rect);
}
}

It seems to solve the problem.


Regarding how to tab to a NSTableView, I'm really stuck: I tried every
possible possibility in IB: setting the next responder to the NSTableView,
the NSScrollView, etc...

I also defined the initial first responder as the NSTableView, but it does
not work: at startup, the first NSTextField get selected instead. Curiously,
if I call "[window makeFirstResponder:tableView];" it works...

I think these problems come from the fact that the NSTableView is inside a
NSScrollView, which can't become first responder by tabbing.

Any idea?

_____________________________________________________________

Pierre-Olivier Latour email@hidden
Manager and Lead Programmer
French Touch software http://www.french-touch.net

Cool source code: http://www.french-touch.net/CodeWareHouse
_______________________________________________
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.

  • Follow-Ups:
    • Re: Tabbing a NSTableView
      • From: Bill Cheeseman <email@hidden>
References: 
 >Re: Tabbing a NSTableView (From: Nicholas Riley <email@hidden>)

  • Prev by Date: Re: Avoiding Cached ImageReps?
  • Next by Date: Re: Non-standard Cocoa RTF Unicode encoding?
  • Previous by thread: Re: Tabbing a NSTableView
  • Next by thread: Re: Tabbing a NSTableView
  • Index(es):
    • Date
    • Thread