• 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
selectable text field
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

selectable text field


  • Subject: selectable text field
  • From: Ken Victor <email@hidden>
  • Date: Thu, 11 Oct 2007 09:00:21 -0700

i have a (small) nstextfield bound to a method in my controller. the text field is set (in ib) selectable, but not editable. my method returns a NSAttributedString, that contains two strings separated by a slash character. one or the other or both of the strings will either be red or black (ie, have no fore ground color attribute). if i don't do anything special, when i select anything in the field, the text all turns black, and stays black until the contents of the field get changed via my above method. on the other hand, if i set the text field to allow edditing of text attributs, via setAllowsEditingTextAttributes, then altho the text stays red when selected, when selected the text moves down a pixel and the text seems to condense.

how can i make this field selectable and not have the text shift position, layout, and color when selected?

thanx,
ken

ps. this can easily be seen by making a small cocoa document based appliction that only has a NSTextField and some other field that can accept focus.
_______________________________________________


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


  • Prev by Date: Re: NSOpenPanel & NSFileTypeForHFSTypeCode
  • Next by Date: NYC cocoaheads meeting
  • Previous by thread: Re: Setting a shadow in -willDisplayCell causes CGContextSetStyle error?
  • Next by thread: NYC cocoaheads meeting
  • Index(es):
    • Date
    • Thread