• 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: Custom dimmed graphic for NSButton?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Custom dimmed graphic for NSButton?


  • Subject: Re: Custom dimmed graphic for NSButton?
  • From: jeff ganyard <email@hidden>
  • Date: Sun, 15 Oct 2006 07:13:36 -0700

On Oct 14, 2006, at 10:52 PM, Trygve Inda wrote:

I have an NSButton that has custom images for pressed and normal states all
done only in IB. I want to have a custom graphic for the dimmed state as
well. I am guessing the only way is to subclass NSButton... What do I need
to override to only customize the dimmed state?

I think something like this in an NSButton subclass should be sufficient:


// typed in mail, may have errors
- (void)setEnabled:(BOOL)enabled
{
if (enabled != [self enabled]) {
[self setImage:enabled ? [NSImage imageNamed:@"activeButtonImage"] : [NSImage imageNamed:@"dimmedButtonImage"]];
[super setEnabled:enabled];
}
}
_______________________________________________
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: 
 >Custom dimmed graphic for NSButton? (From: Trygve Inda <email@hidden>)

  • Prev by Date: Compositing a CIImage to NSBitmapImage planar problems
  • Next by Date: Re: How to forward mouse events to another view?
  • Previous by thread: Custom dimmed graphic for NSButton?
  • Next by thread: NSFont and determining the advancement of a given string
  • Index(es):
    • Date
    • Thread