Re: NSSlider and NSSliderCell
Re: NSSlider and NSSliderCell
- Subject: Re: NSSlider and NSSliderCell
- From: Murat Konar <email@hidden>
- Date: Mon, 15 Jan 2007 17:16:58 -0800
On Jan 15, 2007, at 3:55 PM, Michael Watson wrote:
I've tried eleventeen different ways of setting the cell class so
the slider subclass creates and uses the custom subclassed cell,
but it always uses the standard NSSliderCell, not the custom cell.
[snip]
When the slider wakes up from the nib...
Stop right there.
What happens when your slider is reanimated from a nib is that it is
unarchived from the bits that you indirectly archived when you made
your nib. Since Interface Builder only knows about NSSlider and
NSSliderCell, that's what gets archived. That means your sliders
values, and crucially, the cell it uses are restored directly from
the archived nib data, not created dynamically by your subclass.
You have a couple of things you could try:
(a) write your own Interface Builder Palette that makes your subclass
directly available to Interface Builder
(b) in your subclass' initWithCoder: method, call the super
implementation. At this point your cell should be an instance of
NSSliderCell. Dump it and substitute your own.
Option (a) is probably more trouble than it is worth. Option (b) may
or may not be more work than its worth (I've never tried it myself,
so there may be potholes I haven't anticipated).
_murat
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden