• 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
Rotate a standard Cocoa control?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Rotate a standard Cocoa control?


  • Subject: Rotate a standard Cocoa control?
  • From: Jerry Krinock <email@hidden>
  • Date: Thu, 07 May 2015 13:11:16 -0700

I would like to subclass NSSlider to make it work like the "volume control" on a mid 19th-century radio receiver. That is, I want the minimum value to be at 7 o'clock, and the maximum value to be at 5 o'clock.  There two issues in using the circular version of NSSlider for this:

1.  There is no dead zone between the minimum and maximum settings.  (What were they thinking?)
2.  The min and max settings are at the top, 12 o'clock.

I've solved the first issue by overriding -closestTickMarkValueToValue:.  (Oh, I'm also using "detents", allowsTickMarkValuesOnly = YES).

I think I could solve the second issue with more complicated code in -closestTickMarkValueToValue:, but I'd also need to remap the values somehow and this might be a mess.  So I was wondering if instead there was an easy way to rotate the control on the screen by, say 165 degrees.

Am I correct that the answer is "no"?  Keep in mind that we're not just drawing here; this is a control; we need mouse clicks, etc.

Indeed, I'm not much of a drawing and graphics guy.
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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: Rotate a standard Cocoa control?
      • From: Graham Cox <email@hidden>
    • Re: Rotate a standard Cocoa control?
      • From: Graham Cox <email@hidden>
    • Re: Rotate a standard Cocoa control?
      • From: David Rowland <email@hidden>
  • Prev by Date: Re: Does the NSView Drag Protocol has any issues with non-key windows?
  • Next by Date: Re: Rotate a standard Cocoa control?
  • Previous by thread: RE: Does the NSView Drag Protocol has any issues with non-key windows?
  • Next by thread: Re: Rotate a standard Cocoa control?
  • Index(es):
    • Date
    • Thread