Getting the sender of an event #162
programmingkidx
started this conversation in
General
Replies: 1 comment
-
When you use AddMethod, the first argument of the callback will be the instance of the class you added this method to. The second (I believe) will be the selector. The rest will be the arguments to the method, which I believe is what you're looking for. Try adding two more arguments and using the third. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In Objective-C the action method to a control like a button has a sender argument that lets the method know who sent the event. Is something like this possible in MacDriver? I made a program that display buttons in a grid and I want to print out the name of the button that generated an event. Here is the program:
The window this program displays looks like this:
Can the doButton() function's argument somehow tell who sent the event? Currently the argument is set to a MyClass class instance.
Beta Was this translation helpful? Give feedback.
All reactions