Re: background of NSButton and NSPopUpButton
Re: background of NSButton and NSPopUpButton
- Subject: Re: background of NSButton and NSPopUpButton
- From: Don Willems <email@hidden>
- Date: Fri, 26 Nov 2004 09:15:56 +0100
So, I would subclass NSButton, in its -initWithCoder: I would create
the cell and then [self setCell:theCell];
I did, and that is when I get those ugly buttons.
- (id)initWithCoder:(NSCoder *)decoder
{
[super initWithCoder:decoder];
XTBarButtonCell *cell = [[[XTBarButtonCell alloc] init]
autorelease];
[self setCell:cell];
return self;
}
It seems to me that what I have to do is set all the properties of the
original NSButtonCell which were set using Interface Builder for the
new cell, am I rigth?
For instance:
- (id)initWithCoder:(NSCoder *)decoder
{
[super initWithCoder:decoder];
NSButtonCell *original = [self cell];
XTBarButtonCell *cell = [[[XTBarButtonCell alloc] init]
autorelease];
[cell setTitle:[original title]];
[cell setFont:[original font]];
[cell setImage:[original image]];
...
[self setCell:cell];
return self;
}
_______________________________________________
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