• 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: Checking if NSButton is key view
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Checking if NSButton is key view


  • Subject: Re: Checking if NSButton is key view
  • From: Shawn Erickson <email@hidden>
  • Date: Sat, 05 Aug 2006 12:31:26 -0700


On Aug 5, 2006, at 12:13 PM, Bobby B wrote:

Hello everyone,

I'm subclassing NSButton, and I'm trying to find out how to know if my
view is the "key view."  Say I have 8 buttons on a screen, and you can
tab through them.  I want my button subclass to be able to respond to
the fact that it is now "selected" as the keyView (by drawing itself
differently, as it's a graphical program), through the nextKeyView
chain.

I've looked through the documentation from NSButton all the way up to
NSObject, and the only thing I can seem to find is the -nextKeyView
and previousKeyView methods, but I can't seem to find something like
"-isKeyView:".

Almost like the FocusRing, but instead of drawing the focus ring, I
want to modify the button itself.

That leads me to believe I am tackling this problem the completely wrong way.

I've read the documentation on NSResponder, all the stuff on keyboard
input, View programming, etc.  There has to be something that isn't
clicking.

-[NSResponder becomeFirstResponder] & -[NSResponder resignFirstResponder]


Also you can ask the window you are in for the first responder and see if that is yourself.

-Shawn
_______________________________________________
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


References: 
 >Checking if NSButton is key view (From: "Bobby B" <email@hidden>)

  • Prev by Date: Checking if NSButton is key view
  • Next by Date: FSCopyObjectASync callback handler
  • Previous by thread: Checking if NSButton is key view
  • Next by thread: FSCopyObjectASync callback handler
  • Index(es):
    • Date
    • Thread