• 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: Best place to set custom NSButtonCell?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Best place to set custom NSButtonCell?


  • Subject: Re: Best place to set custom NSButtonCell?
  • From: August Trometer <email@hidden>
  • Date: Wed, 28 Dec 2005 10:13:54 -0500

As far as I can tell, NSButton doesn't respond to init.

It _does_ respond to initWithCoder:, but setCellClass is a class method and won't work inside initWithCoder:. Same for awakeFromNib.

I'm trying to keep this all self contained (no external setting of the class, etc.), but there doesn't seem to be a good way to do it.



-- August



On Dec 28, 2005, at 10:01 AM, Camillo Lugaresi wrote:


On 28/dic/05, at 15:42, August Trometer wrote:

I'd like to subclass NSButton. In doing so, I also need to subclass NSButtonCell. So, I'd like to setCellClass: of the NSButton, but I can't seem to figure out the best place to do this. If I do it in initialize:, then the cell class doesn't stick. Of course, awakFromNib: is too late in the process.

Is there a good technique for doing this?

Have you tried doing it in the instance initializer?

- (id)init
{
NSButton *instance = [super init];
[instance setCellClass:...];
return instance;
}

Just a guess.

Camillo

_______________________________________________
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: Best place to set custom NSButtonCell?
      • From: Camillo Lugaresi <email@hidden>
    • Re: Best place to set custom NSButtonCell?
      • From: Daniel Jalkut <email@hidden>
References: 
 >Best place to set custom NSButtonCell? (From: August Trometer <email@hidden>)
 >Re: Best place to set custom NSButtonCell? (From: Camillo Lugaresi <email@hidden>)

  • Prev by Date: Re: Best place to set custom NSButtonCell?
  • Next by Date: Re: Best place to set custom NSButtonCell?
  • Previous by thread: Re: Best place to set custom NSButtonCell?
  • Next by thread: Re: Best place to set custom NSButtonCell?
  • Index(es):
    • Date
    • Thread