• 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: NSTextFieldCell setPlaceholderAttributedString Query
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTextFieldCell setPlaceholderAttributedString Query


  • Subject: Re: NSTextFieldCell setPlaceholderAttributedString Query
  • From: Douglas Davidson <email@hidden>
  • Date: Fri, 7 Oct 2005 11:12:29 -0700


On Oct 7, 2005, at 11:06 AM, John Bishop wrote:

If I have a NSTextField with centered text (ie: [theNSTextFieldCell alignment]
== NSCenterTextAlignment) and I set the cell's placeholder string:


[theNSTextFieldCell setPlaceholderString:anNSString];

the resulting placeholder is, like any entered text, center aligned, as
expected. If, however, I set the placeholder with an attributed string:


[theNSTextFieldCell setPlaceholderAttributedString:anNSAttributedString];

the resulting placeholder is left aligned, unlike any entered text, which is
properly centered. Is this a bug, or am I supposed to supply an alignment
attribute in the placeholder's NSAttributedString? If it's not a bug, how to
I specify that NSCenterTextAlignment attribute?



For attributed strings, alignment is set using NSParagraphStyle and NSParagraphStyleAttributeName.


Douglas Davidson

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >NSTextFieldCell setPlaceholderAttributedString Query (From: John Bishop <email@hidden>)

  • Prev by Date: NSTextFieldCell setPlaceholderAttributedString Query
  • Next by Date: Re: only defined for abstract class
  • Previous by thread: NSTextFieldCell setPlaceholderAttributedString Query
  • Next by thread: Stop screensaver blanking
  • Index(es):
    • Date
    • Thread