• 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: Passing focus to a control
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Passing focus to a control


  • Subject: Re: Passing focus to a control
  • From: Mike Abdullah <email@hidden>
  • Date: Tue, 30 Sep 2008 00:11:09 +0100

Directly quoting the -becomeFirstResponder: docs:

Use the NSWindow makeFirstResponder: method, not this method, to make an object the first responder. Never invoke this method directly.

Also, it's called a method, not a function.

On 29 Sep 2008, at 09:36, Cocoader wrote:

I have a window of controls, a NSComboBox and some NSTextFields. I want to be able to place the cursor in the NSComboBox when the user selects Cmd-J.

All of the code for managing the window is in an .h and .m file:

@interface HF_Browser : NSDocument {
...

When I press Cmd-J I get my function called but can't work out how to get the control to get the focus. I've tried becomeFirstResponder but nothing happens and no error occurs.

Please help! I'm sure this is an obvious error, but after 3 hours I still can't get it working for me :-/

--
Paul Harvey

Lead Programmer
email@hidden

Hiddenfield Software
"Creating useful software for Mac OS X"
www.hiddenfield.com


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Passing focus to a control (From: Cocoader <email@hidden>)

  • Prev by Date: Re: Passing focus to a control
  • Next by Date: Re: Load launchd job immediately, without restart - how?
  • Previous by thread: Re: Passing focus to a control
  • Next by thread: Window Shadow
  • Index(es):
    • Date
    • Thread