Re: SliderText = NSSlider + NSTextField
Re: SliderText = NSSlider + NSTextField
- Subject: Re: SliderText = NSSlider + NSTextField
- From: Thomas Engelmeier <email@hidden>
- Date: Thu, 31 Jan 2008 09:49:05 +0100
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:
This email sent to email@hidden