• 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: Newbie - which NSTextField is the cursor in?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Newbie - which NSTextField is the cursor in?


  • Subject: Re: Newbie - which NSTextField is the cursor in?
  • From: email@hidden
  • Date: Mon, 18 Mar 2002 10:11:32 -0800

[window firstResponder] should be correct in theory. However, I think it might return the field editor for the textfield, not the textfield itself. I'm not sure offhand how to get from the field editor back to the original textfield.

You know whether there is a text field edited currently by checking if the first responder is a NSTextView and responds YES to isFieldEditor. If so, its delegate is the currently edited NSTextField.

Interesting. Sounds generally reliable, although the -isFieldEditor method sounds like it doesn't actually have anything directly to do with whether the NSText object is being used as a field editor; its direct semantic meaning has to do with the way tab, shift-tab, and enter behave, and non-field-editor NSText objects may still return YES for -isFieldEditor, as I read the doc. Furthermore, I can't find anything in the doc about the field editor's delegate; is this a documented behavior that one may rely on, or does it just happen to be the case in the current implementation?
If one needs to get from the field editor back to the editing textfield, this sounds like the way, as the APIs currently stand, but it would be nice for there to be a clearer way, or at least clearer doc. In any case, I don't think it is necessary to solve the problem the original poster had, so given these concerns, perhaps other solutions might be better...

Ben Haller
Stick Software
_______________________________________________
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: Newbie - which NSTextField is the cursor in?
      • From: Thomas Lachand-Robert <email@hidden>
    • Re: Newbie - which NSTextField is the cursor in?
      • From: Douglas Davidson <email@hidden>
References: 
 >Re: Newbie - which NSTextField is the cursor in? (From: Thomas Lachand-Robert <email@hidden>)

  • Prev by Date: Re: Newbie with stupid question
  • Next by Date: Re: expanding the view area of a window - please help
  • Previous by thread: Re: Newbie - which NSTextField is the cursor in?
  • Next by thread: Re: Newbie - which NSTextField is the cursor in?
  • Index(es):
    • Date
    • Thread