Re: Preventing NSSlider bar from drawing
Re: Preventing NSSlider bar from drawing
- Subject: Re: Preventing NSSlider bar from drawing
- From: Dominik Pich <email@hidden>
- Date: Tue, 16 Jan 2007 21:25:09 +0100
I hacked the apple slider using a category:
- (void) drawWithFrame: (NSRect)cellFrame inView: (NSView*)controlView {
cellFrame = [self drawingRectForBounds: cellFrame];
[super setTrackRect: cellFrame]; //need to access private member
[self drawBarInside: cellFrame flipped: [controlView isFlipped]];
[self drawKnob];
}
---
/*
Hack to set private member via category -> bad but only thing I can
think of from keeping the sliderCell draw a bar behind ours which
then shines through.
*/
@interface NSSliderCell (SetTrackRect)
@end
@implementation NSSliderCell (SetTrackRect)
- (void) setTrackRect: (NSRect)theRect {
_trackRect = theRect;
}
@end
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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