• 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
Selected text in NSTextField
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Selected text in NSTextField


  • Subject: Selected text in NSTextField
  • From: Dany Golubitsky <email@hidden>
  • Date: Tue, 31 Jan 2012 03:14:41 -0500
  • Acceptlanguage: en-US
  • Thread-topic: Selected text in NSTextField

Hello Everyone!

I am interested in opening NSAlert window that includes editable text field. I would like that the text field will be immediately in focus and all characters will be selected. Meaning that the user can immediately start to type another name if he interested.

In other words it should look like this:

http://i30.fastpic.ru/big/2012/0131/9d/33a982de75d6e7221508f41902504b9d.png

I tried to use both NSTextField with selectText:0 and NSTextView with setSelectedRange:range. It still looks like this:

http://i28.fastpic.ru/big/2012/0131/82/f6e1e63c6dccb5170f892ad8f19a2a82.png

I also tried to use becomeFirstResponder - still, you need to click inside the text field in both cases in order to start editing.

Can someone help?

Thanks!

_______________________________________________

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


  • Follow-Ups:
    • Re: Selected text in NSTextField
      • From: Conrad Shultz <email@hidden>
References: 
 >NSPopUpButton Binding Frustration (From: Seth Willits <email@hidden>)
 >Re: NSPopUpButton Binding Frustration (From: Keary Suska <email@hidden>)
 >Re: NSPopUpButton Binding Frustration (From: Leo <email@hidden>)

  • Prev by Date: How to deactivate an app
  • Next by Date: Re: How do you run an app on the device with Instruments?
  • Previous by thread: Re: NSPopUpButton Binding Frustration
  • Next by thread: Re: Selected text in NSTextField
  • Index(es):
    • Date
    • Thread