Re: Custom NSSlider Action Not Firing
Re: Custom NSSlider Action Not Firing
- Subject: Re: Custom NSSlider Action Not Firing
- From: Andreas Mayer <email@hidden>
- Date: Mon, 11 Jul 2005 13:02:12 +0200
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:
This email sent to email@hidden