Re: Simulating a click in NSStepper
Re: Simulating a click in NSStepper
- Subject: Re: Simulating a click in NSStepper
- From: Nick Zitzmann <email@hidden>
- Date: Thu, 16 Apr 2009 18:51:14 -0600
On Apr 16, 2009, at 3:13 PM, David Alter wrote:
I'm using a NSStepper with the little up and down arrows. I want to
simulate
a click where the correct arrow will get highlighted as if someone
clicked
into it. I'm unclear how I should do this. I can do a perform click
but that
does not specify what arrow to click.
Any suggestions?
You can do this by creating "fake" mouse down and mouse up events, and
add them to the application's event queue so that the mouse down event
is handled before the mouse up event. See the NSEvent documentation
for details on how to make your own events.
Nick Zitzmann
<http://www.chronosnet.com/>
_______________________________________________
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