Re: Custom dimmed graphic for NSButton?
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