• 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: NSButton Behaviors
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSButton Behaviors


  • Subject: Re: NSButton Behaviors
  • From: Erik Buck <email@hidden>
  • Date: Mon, 1 Oct 2007 20:51:37 -0400

I was about to code up a simple NSButton subclass that sends its action message continuously while held down, but then I checked the documentation:

See NSButton: http://developer.apple.com/documentation/Cocoa/ Reference/ApplicationKit/Classes/NSButton_Class/Reference/Reference.html

"setPeriodicDelay:interval:
Sets the message delay and interval periods for a continuous button.

- (void)setPeriodicDelay:(float)delay interval:(float)interval

Parameters

delay
The amount of time (in seconds) that a continuous button will pause before starting to periodically send action messages to the target object. The maximum allowed value is 60.0 seconds; if a larger value is supplied, it is ignored, and 60.0 seconds is used.


interval
The amount of time (in seconds) between each action message. The maximum value is 60.0 seconds; if a larger value is supplied, it is ignored, and 60.0 seconds is used.


Discussion

The delay and interval values are used if the button is configured (by a setContinuous: message) to continuously send the action message to the target object while tracking the mouse.

Availability

Available in Mac OS X v10.0 and later.
See Also

– setContinuous: (NSControl)"

I just made a button continuous in IB, and indeed it sends its action message continuously as long as it is held down.

_______________________________________________

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: NSButton Behaviors
      • From: "Frank D. Engel, Jr." <email@hidden>
  • Prev by Date: Re: How can we draw a NSWindow in a custom NSView?
  • Next by Date: Re: Where are the boundaries of Cocoa and how are the boundaries perceived ?
  • Previous by thread: Re: NSButton Behaviors
  • Next by thread: Re: NSButton Behaviors
  • Index(es):
    • Date
    • Thread