Don't Want To Receive Focus?

Discussion in 'Mac Programming' started by Fritzables, Oct 31, 2011.

  1. Fritzables macrumors regular

    Joined:
    May 6, 2011
    Location:
    Brisbane AUSTRALIA
    #1
    Hi All,

    If I have a number of controls set within a window and some of them I don't want them to receive Focus when I hit the Tab key - how is this best done?

    Pete
     
  2. jiminaus macrumors 65816

    jiminaus

    Joined:
    Dec 16, 2010
    Location:
    Sydney
    #2
    I know to override acceptFirstResponder in an NSResponder (and therfore NSView) subclass to return NO when I want a view to not accept focus. But if you're not already dealing with subclasses, this would be PITA.

    BTW When you're researching this, the concept you know of as focus is known as first responder in Cocoa. It's related to the concept of the responder chain.
     
  3. Fritzables thread starter macrumors regular

    Joined:
    May 6, 2011
    Location:
    Brisbane AUSTRALIA
  4. Sydde macrumors 68020

    Sydde

    Joined:
    Aug 17, 2009
    #4
    If you are constructing your UI in a nib, you can define the key view loop using dragged connections.
     

Share This Page