Re: subclass of NSSlider won't call action method
Re: subclass of NSSlider won't call action method
- Subject: Re: subclass of NSSlider won't call action method
- From: Chris Stephens <email@hidden>
- Date: Thu, 30 Jun 2005 12:11:02 +1000
Thanks, Andreas.
Here is the complete EluSliderCell.m code if that helps:
#import "EluSliderCell.h"
static NSImage * _knobOff = nil;
static NSImage * _knobOn = nil;
static NSImage * barImage = nil;
@implementation EluSliderCell
-(id)init {
self = [super init];
_knobOff = [[NSImage imageNamed:@"knob_cold"] retain];
_knobOn = [[NSImage imageNamed:@"knob_hot"] retain];
return self;
}
- (void)drawKnob:(NSRect)knobRect {
NSImage * knob = _knobOn;
[[self controlView] lockFocus];
[knob compositeToPoint:NSMakePoint(knobRect.origin.x +
1,knobRect.origin.y+knobRect.size.height - 2)
operation:NSCompositeSourceOver];
[[self controlView] unlockFocus];
}
- (void)drawBarInside:(NSRect)barRect flipped:(BOOL)flipped
{
[super drawBarInside:barRect flipped:flipped];
NSRect imageRect;
barImage = [[NSImage imageNamed:@"black_bar"] retain];
imageRect.origin = NSZeroPoint;
imageRect.size = [barImage size];
barRect.origin.x = barRect.origin.x - 3;
[barImage setFlipped:YES];
[barImage drawInRect:barRect
fromRect:imageRect
operation:NSCompositeSourceOver
fraction:1.0];
}
- (void)dealloc
{
[super dealloc];
}
@end
_______________________________________________
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