• 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: NSSlider and NSSliderCell
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: NSSlider and NSSliderCell
      • From: Andreas Mayer <email@hidden>
    • Re: NSSlider and NSSliderCell
      • From: Murat Konar <email@hidden>
    • Re: NSSlider and NSSliderCell
      • From: "I. Savant" <email@hidden>
References: 
 >NSSlider and NSSliderCell (From: Michael Watson <email@hidden>)
 >Re: NSSlider and NSSliderCell (From: "I. Savant" <email@hidden>)

  • Prev by Date: Re: howto draw math forumulas
  • Next by Date: Re: NSString coding errors
  • Previous by thread: Re: NSSlider and NSSliderCell
  • Next by thread: Re: NSSlider and NSSliderCell
  • Index(es):
    • Date
    • Thread