• 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: NSButton Text Color?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSButton Text Color?


  • Subject: Re: NSButton Text Color?
  • From: "Alan Smith" <email@hidden>
  • Date: Mon, 29 Jan 2007 08:55:52 -0500

Hi,

There is not a cell associated with the button, the string is drawn
directly. To change the color I would imagine something like this
should work:

- (void)setButtonTextColor:(NSColor*)color
{
 NSAttributedString *attributedString = [[NSAttributedString alloc]
initWithString: [button title] attributes: [NSDictionary
dictionaryWithObjectsAndKeys: color, NSForegroundColorAttributeName,
nil]];

 [button setAttributedTitle: attributedString];
}

Good luck, Alan


-- // Quotes from yours truly ------------------------- "You don't forget, you just don't remember." "Maturity resides in the mind." "Silence is the Universe's greatest gift." "When the World realizes that religion really is unnecessary, then it shall evolve." _______________________________________________

Cocoa-dev mailing list (email@hidden)

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: NSButton Text Color?
      • From: "I. Savant" <email@hidden>
References: 
 >NSButton Text Color? (From: maximilian marcoll <email@hidden>)

  • Prev by Date: Re: Trouble centering window after mode switch
  • Next by Date: NSTableView with bindings as a drag destination.
  • Previous by thread: NSButton Text Color?
  • Next by thread: Re: NSButton Text Color?
  • Index(es):
    • Date
    • Thread