• 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: NSTextField has cursor in it?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTextField has cursor in it?


  • Subject: Re: NSTextField has cursor in it?
  • From: Ron Ballesteros <email@hidden>
  • Date: Fri, 5 Dec 2003 09:17:25 -0800

I'm wondering if this is the same method they used in System Preferences/EnergySaver
to determine which NSTextField to update when the user clicks on the NSStepper button?

This is the behavior I am trying to duplicate...

I open the nib file for the EnergySaver and they created a subclass of NSControl
as the delegate for the NSTextFields of the hour and minute and I'm not sure which delegate methods of NSTextField to implement to determine which field the user 's cursor is on?

Thanks.

ron

On Dec 5, 2003, at 6:44 AM, email@hidden wrote:

Message: 5
Cc: Cocoa Dev Dev <email@hidden>
From: j o a r <email@hidden>
Subject: Re: NSTextField has cursor in it?
Date: Fri, 5 Dec 2003 09:35:01 +0100
To: "Louis C. Sacha" <email@hidden>

NSWindow has a "firstResponder" method that is suitable to use here.
How about something like this:

id firstResponder = [[self window] firstResponder];
id fieldEditor;
if ((firstResponder != myTextField) &&
(((fieldEditor = [myTextField currentEditor]) == nil) ||
(firstResponder != fieldEditor)))
{
NSLog(@"The text field doesn't have focus");
}

j o a r
_______________________________________________
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: NSTextField has cursor in it?
      • From: Stephane Sudre <email@hidden>
  • Prev by Date: Re: reading iTunesDB
  • Next by Date: Re: make a list
  • Previous by thread: Re: NSTextField has cursor in it?
  • Next by thread: Re: NSTextField has cursor in it?
  • Index(es):
    • Date
    • Thread