Re: Custom NSSlider Action Not Firing
Re: Custom NSSlider Action Not Firing
- Subject: Re: Custom NSSlider Action Not Firing
- From: Austin Sarner <email@hidden>
- Date: Mon, 11 Jul 2005 21:38:15 -0400
Works like a charm, thanks!
--------------------
Austin Sarner
Neometric Software (http://neometricsw.com)
On Jul 11, 2005, at 7:02 AM, Andreas Mayer wrote:
Am 11.07.2005 um 03:49 Uhr schrieb Austin Sarner:
My problem is that the slider's action is not firing
We've had the exact same problem a few days before in this list.
You need to copy the values of at least the target and action
instance variables of the slider's cell, when replacing it with
your own creation:
- (void)awakeFromNib
{
if ([[self cell] class] != [MyOwnSliderCell class]) {
// replace cell
NSSliderCell *oldCell = [self cell];
NSSliderCell *newCell = [[[MyOwnSliderCell alloc] init]
autorelease];
[newCell setTag:[oldCell tag]];
[newCell setTarget:[oldCell target]];
[newCell setAction:[oldCell action]];
[newCell setControlSize:[oldCell controlSize]];
[newCell setType:[oldCell type]];
[newCell setState:[oldCell state]];
[newCell setAllowsTickMarkValuesOnly:[oldCell
allowsTickMarkValuesOnly]];
[newCell setAltIncrementValue:[oldCell altIncrementValue]];
[newCell setControlTint:[oldCell controlTint]];
[newCell setKnobThickness:[oldCell knobThickness]];
[newCell setMaxValue:[oldCell maxValue]];
[newCell setMinValue:[oldCell minValue]];
[newCell setDoubleValue:[oldCell doubleValue]];
[newCell setNumberOfTickMarks:[oldCell numberOfTickMarks]];
[newCell setSliderType:[oldCell sliderType]];
[newCell setEditable:[oldCell isEditable]];
[newCell setEnabled:[oldCell isEnabled]];
[newCell setEntryType:[oldCell entryType]];
[newCell setFocusRingType:[oldCell focusRingType]];
[newCell setHighlighted:[oldCell isHighlighted]];
[newCell setTickMarkPosition:[oldCell tickMarkPosition]];
[self setCell:newCell];
}
}
Andreas
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40mac.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden