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

Preventing NSSlider bar from drawing


  • Subject: Preventing NSSlider bar from drawing
  • From: Michael Watson <email@hidden>
  • Date: Tue, 16 Jan 2007 11:24:42 -0500

Thanks to all who helped me solve my IB/-initWithCoder: problem solved previously.

So my custom NSSlider/NSSliderCell is drawing as I expect, except for one small quirk: I can't seem to prevent the original Aqua bar from drawing. Currently, I'm overriding -[NSSliderCell drawKnob:] and - [NSSliderCell drawBarInside:flipped:], and those correctly invoke my drawing commands. I'm still left with the original Aqua bar benath what I've drawn, however.

If I override -[NSCell -drawWithFrame:inView:], I can prevent the bar from drawing, but the position at which the knob draws doesn't reflect the current doubleValue until I click the slider and begin using it. (It draws at 0,0 initially and doesn't get erased until I drag the knob over it.)

My current thinking is that I need to override the - drawWithFrame:inView: method, lock focus on the control view, call - drawBarInside:flipped:, call -drawKnob: (not -drawKnob), and then unlock focus. If this is the case, is there a good way to determine what rect to pass into -drawKnob:?


-- mikey _______________________________________________

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


  • Follow-Ups:
    • Re: Preventing NSSlider bar from drawing
      • From: Andreas Mayer <email@hidden>
  • Prev by Date: Re: Cocoa and iPhone
  • Next by Date: Syntax of int Array in Message (OT: Objective-C Forum)
  • Previous by thread: Re: Cocoa and iPhone
  • Next by thread: Re: Preventing NSSlider bar from drawing
  • Index(es):
    • Date
    • Thread