• 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: background of NSButton and NSPopUpButton
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: background of NSButton and NSPopUpButton
      • From: Don Willems <email@hidden>
References: 
 >background of NSButton and NSPopUpButton (From: Don Willems <email@hidden>)
 >Re: background of NSButton and NSPopUpButton (From: Michael Becker <email@hidden>)
 >Re: background of NSButton and NSPopUpButton (From: Don Willems <email@hidden>)
 >Re: background of NSButton and NSPopUpButton (From: Michael Becker <email@hidden>)
 >Re: background of NSButton and NSPopUpButton (From: Don Willems <email@hidden>)
 >Re: background of NSButton and NSPopUpButton (From: Ryan Stevens <email@hidden>)

  • Prev by Date: Image creation and compositing
  • Next by Date: Re: background of NSButton and NSPopUpButton
  • Previous by thread: Re: background of NSButton and NSPopUpButton
  • Next by thread: Re: background of NSButton and NSPopUpButton
  • Index(es):
    • Date
    • Thread