Re: NSSlider and NSSliderCell
Re: NSSlider and NSSliderCell
- Subject: Re: NSSlider and NSSliderCell
- From: Michael Watson <email@hidden>
- Date: Mon, 15 Jan 2007 18:55:33 -0500
Right, NSSlider uses NSSliderCell to implement its interface and
transmitting mouse clicks back to the control itself. I've read it,
but I'm still not getting how to get an NSSlider subclass to use a
custom NSSliderCell subclass.
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.
@implementation CustomSlider
+ (void)initialize
{
[CustomSlider setCellClass:[CustomSliderCell class]];
}
+ (Class)cellClass
{
return [CustomSliderCell class];
}
@end
When the slider wakes up from the nib, those two methods are called.
None of the methods in CustomSliderCell are, though. I still end up
with the standard slider bar/knob look. So, I figure I still need to
override -(id)initWithFrame:, create the custom cell, and call -
setCell: to complete the process, so I do just that. But -
initWithFrame: is never called.
I know I'm screwing up here, but I'm not sure where. How do I get the
slider to use the custom cell?
--
On 15 Jan, 2007, at 18:11, I. Savant wrote:
Michael:
The core concept you're missing you're missing is "Control and
Cell Programming"
http://developer.apple.com/documentation/Cocoa/Conceptual/
ControlCell/index.html
--
I.S.
On Jan 15, 2007, at 5:38 PM, Michael Watson wrote:
Are there any good tutorials on creating custom sliders? I must
admit that I'm a bit lost as to how NSSlider/NSSliderCell are
subclassed correctly to change their appearance and/or
functionality. Lots of example code floating around, but nothing
that's looked complete and decipherable. (In other words, I'm
missing some core concept, and it's blocking progress!)
--
_______________________________________________
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:
40gmail.com
This email sent to email@hidden
_______________________________________________
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