• 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: Focus issues with NSTableView in NSPanel
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Focus issues with NSTableView in NSPanel


  • Subject: Re: Focus issues with NSTableView in NSPanel
  • From: Corbin Dunn <email@hidden>
  • Date: Tue, 21 Aug 2012 09:40:51 -0700

On Aug 21, 2012, at 9:02 AM, Kyle Sluder <email@hidden> wrote:

> On Aug 21, 2012, at 8:43 AM, Corbin Dunn <email@hidden> wrote:
>
>> Override:
>>
>> - (BOOL)needsPanelToBecomeKey
>>
>> and return NO. If you think about it...that is conceptually what you want. Also, the window could return YES from becomesKeyOnlyIfNeeded, and it should also work.
>
> I don't know what Jean Suisse needs, but we've been trying to achieve a very similar goal: clicking on a table view in a non-key window should cause the selection to change *and* should cause that window to become key (with the table view as first responder).
>
> Yes, we understand this is a departure from standard behavior. But this is the behavior we desire. (The table view lives in an inspector window and shows a fair bit of data, and users expect to be able to navigate it with the keyboard.)
>
> Unfortunately, the only thing we've done that seems to work is to override -acceptsFirstMouse: to call [self.window makeKeyAndOrderFront:] before returning YES. This feels incredibly hacky. Is there no other way?

Return NO from needsPanelToBecomeKey. Override mouseDown: in the table, and the first thing you do is make the window key, and then call super. This way, you are manually implementing needsPanelToBecomeKey (well, sort of..)

corbin



>
> --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: 
 >Focus issues with NSTableView in NSPanel (From: Jean Suisse <email@hidden>)
 >Re: Focus issues with NSTableView in NSPanel (From: Corbin Dunn <email@hidden>)
 >Re: Focus issues with NSTableView in NSPanel (From: Kyle Sluder <email@hidden>)

  • Prev by Date: Re: Focus issues with NSTableView in NSPanel
  • Next by Date: Re: Focus issues with NSTableView in NSPanel
  • Previous by thread: Re: Focus issues with NSTableView in NSPanel
  • Next by thread: Cocoa and SQL (microsoft SQL 2008)
  • Index(es):
    • Date
    • Thread