Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Generating a GUI Event in Cocoa



Jeffrey Richardson wrote:
|Does anyone have a code snippet that will generate a button click event?

What are you doing that you need a button click event as such? The preferred approach is to just call the same routine that the button would call:

buttonTarget.actionMethodSelector(self);

(or, to be completely general,
NSApplication.sharedApplication()
.sendActionToTargetFromSender(button.action(), button.target(), self);
)

Generally, the only time to fiddle with events is when you're actually controlling the UI itself.

Glen Fisher
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Be sure to read the FAQ http://developer.apple.com/java/faq/ before posting
Do not post admin requests to the list. They will be ignored.

References: 
 >Generating a GUI Event in Cocoa (From: Jeffrey Richardson <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.