• 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: Detecting a focus change in a window?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Detecting a focus change in a window?


  • Subject: Re: Detecting a focus change in a window?
  • From: "email@hidden" <email@hidden>
  • Date: Sat, 23 Sep 2006 19:56:48 -0700

I have an NSStepper that controlls two NSTextFields. When focus changes from one field to the other, I want to update the stepper to relect the new value. However, I can't seem to find anything that allows me to detect the focus change.

In my NSWIndowController subclass, I added a -(BOOL) becomeFirstResponder. However, it is never called. Do I need to subclass my NSTextField views & implement becomeFirstResponder there? Or is there some other way?

You probably want to use the NSTextField delegate method - controlTextDidEndEditing:.


Except that only tells me that the focus is leaving a text field--it could be going somewhere else. In that case, I still need to associate my stepper with that last focused field. "controlTextShouldBeginEditing" doesn't work, either, because it doesn't get called until a character has been entered. If the user tabs or mouses from one field to the other and uses the stepper, it should now be associated with the new text field.

Thanks,

mark

_______________________________________________
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: 
 >Detecting a focus change in a window? (From: Mark Dawson <email@hidden>)
 >Re: Detecting a focus change in a window? (From: Nick Zitzmann <email@hidden>)

  • Prev by Date: Re: Cocoa dialog in CarbonLib App
  • Next by Date: Re: Detecting a focus change in a window?
  • Previous by thread: Re: Detecting a focus change in a window?
  • Next by thread: Guidelines for disabling controls
  • Index(es):
    • Date
    • Thread