• 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: Preventing NSSlider bar from drawing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Preventing NSSlider bar from drawing (From: Michael Watson <email@hidden>)
 >Re: Preventing NSSlider bar from drawing (From: Andreas Mayer <email@hidden>)

  • Prev by Date: Re: Mouse location in CG
  • Next by Date: Re: Mouse location in CG
  • Previous by thread: Re: Preventing NSSlider bar from drawing
  • Next by thread: Re: Preventing NSSlider bar from drawing
  • Index(es):
    • Date
    • Thread