• 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
Don't highlight button's text when clicked
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Don't highlight button's text when clicked


  • Subject: Don't highlight button's text when clicked
  • From: Gustavo Pizano <email@hidden>
  • Date: Wed, 4 Nov 2009 21:21:06 +0100

Hello.

I have a custom NSButtonCell, also my CustomButton, I draw a glossy BackGround in the ButtonCell, and set the text to white-bold color.
now I overrode the method:


- (void)highlight:(BOOL)flag withFrame:(NSRect)cellFrame inView: (NSView *)controlView{
so set but a little darker glossy background color, but then I see that the text stays behind the new color im applying.


I did some research, and found the method setHighlightsBy of NSButtonCell, so in the initialization of my custom button cell, I did:

[self setHighlightsBy:NSChangeBackgroundCellMask|NSChangeGrayCellMask];

but nothing happened, still the text its behind the new color.
then I tried applying the text-color with an attributedstring as I did in the - (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *) controlView to change the text color, but then nothing happens, not even the new color its applied ...


Any ideas?

Thanks


Gustavo _______________________________________________

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:
    • [fixed]Re: Don't highlight button's text when clicked
      • From: Gustavo Pizano <email@hidden>
  • Prev by Date: Re: Programmatic Binding KVC KVO
  • Next by Date: sorting xml using tableview datasource method?
  • Previous by thread: Re: Working around SBObject limitations
  • Next by thread: [fixed]Re: Don't highlight button's text when clicked
  • Index(es):
    • Date
    • Thread