• 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: Custom NSSlider Action Not Firing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >Custom NSSlider Action Not Firing (From: Austin Sarner <email@hidden>)
 >Re: Custom NSSlider Action Not Firing (From: Andreas Mayer <email@hidden>)

  • Prev by Date: Re: Why does this leak memory?
  • Next by Date: iTunes like Source Header
  • Previous by thread: Re: Custom NSSlider Action Not Firing
  • Next by thread: Best method to observe an entity?
  • Index(es):
    • Date
    • Thread