• 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
How to highlight only part of the text in a text field?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to highlight only part of the text in a text field?


  • Subject: How to highlight only part of the text in a text field?
  • From: Ulf Dunkel <email@hidden>
  • Date: Mon, 13 Sep 2010 16:46:29 +0200
  • Organization: invers Software

When I open an openPanel in any application, I often see the file name field's content partly highlighted (or name it pre-selected), e.g.

   "[myFileName].extension"

where the string part in [] is already selected and ready to be overwritten, keeping the ".extension" part untouched by default.

I would like to use a similar behaviour in an editable text field of my document window, which I activate when the window is shown, using

   [mainWindow makeFirstResponder:myTextField];

The myTextField content has already be composed (like e.g. @"foo: bar").

I would like to see only "bar" preselected when the window opens and the myTextField is selected for editing.

I guess you folks know how to, while I poke through the documentation.
Can you help me out?

Thanks in advance,
Ulf Dunkel
_______________________________________________

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: How to highlight only part of the text in a text field?
      • From: Vincent Habchi <email@hidden>
  • Prev by Date: Re: web-based Cocoa dev docs inaccessible
  • Next by Date: Re: How to highlight only part of the text in a text field?
  • Previous by thread: Problem managing BLOB containing images
  • Next by thread: Re: How to highlight only part of the text in a text field?
  • Index(es):
    • Date
    • Thread