Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SliderText = NSSlider + NSTextField




On 31.01.2008, at 00:47, John Richetta wrote:

If I could create a proper control, that supported all the usual control behavior, I'd much prefer that, but I'm not keen on implementing any significant control or cell subclass, unless it can be done quite cleanly (without messing up control/cell interaction, and preferably without a lot of code). I don't see an easy way to subclass NSControl, given the need to support a "cell" for the paired controls.

I'm in a similar position. I need sliders with labels for the min / max value, and quite some of them. Amazing, a modern DSLR camera has 60..100 custom settings. Later I probably also need an optional textual readout. Looking at the documentation it seems a custom NSSliderCell is the way to go. Unfortunately, it seems that the methods to set a custom cell are deprecated in Leopard, but I didn't find out WHY it is deprecated and what should be used instead..


For your task, the two control values are not really synced.. They are separate and get synced at defined points:

- as soon as the associated text field looses focus, retrieve and validate the value.
- if the value is out of bounds, either clip the it or reset to the slider value


- if the slider gets moved, update the text value.

Regards,
	Tom_E
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >SliderText = NSSlider + NSTextField (From: John Richetta <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.