• 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: NSSlider and doube-click event
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSSlider and doube-click event


  • Subject: Re: NSSlider and doube-click event
  • From: Robert Martin <email@hidden>
  • Date: Fri, 13 Jul 2007 04:58:34 -0400

You have to subclass NSSlider and override its mouseDown method - it's all in the Cocoa Event-Handling Guide documentation. Something like:

- (void) mouseDown: (NSEvent *)theEvent
{
	if ([theEvent clickCount] > 1) {
      		// Do your double-click stuff...
	}
	else
	   [super mouseDown:theEvent];
}

Don't forget to change the slider's class to your subclass in the nib file and your controller.


On Jul 12, 2007, at 10:29 PM, Simon Raisin wrote:

<...snip...>

But unfortunately I still don't understand HOW or WHERE to put the code that
would handle the double-click for the NSSlider.


Say I create a new cocoa based xcode project. I open up IB and drop a new
NSSlider onto the window.


Now I create an "AppController" class that has an IBOutlet that refers to
the slider and I hook them up.


I build and run the app then I double-click on the slider. I'm still no
closer to understanding how to handle the mouse click events.
_______________________________________________

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: NSSlider and doube-click event
      • From: "Simon Raisin" <email@hidden>
References: 
 >Re: NSSlider and doube-click event (From: Wagner Truppel <email@hidden>)
 >Re: NSSlider and doube-click event (From: "Simon Raisin" <email@hidden>)

  • Prev by Date: ColorSync Utility
  • Next by Date: Re: Core Data and Document Packages
  • Previous by thread: Re: NSSlider and doube-click event
  • Next by thread: Re: NSSlider and doube-click event
  • Index(es):
    • Date
    • Thread