I’m developing a program that has many buttons that should do a similar action when clicked, but with a small difference based on which button was clicked.
The problem is that the only straightforward path is to code this for each button, which would be a very repetitive task. Is there a way to program simply one block that would get the click on any button and which button was clicked?
I’m developing a program that has many buttons that should do a similar action
Share
Assign the same event handler to all buttons.
Or you can select the same event handler in the properties window switched to events (flash icon).
You can also add some useful information to the
Tagproperty for the disambiguation. And last but not least, you can derive your own button fromButtonand add appropriate properties. They will even appear in the properties window.