Each button is defined as an area. A zone bounded by 4 corners, in terms of X,Y coordinates.
The operating system monitors the activity and when it detects a click somewhere, searches through the list of all the zones defined as valid buttons. When there is a match (the zone touched has its X coordinate bigger than X1, smaller than X2; and the Y is between Y1 and Y2? Then, user touched buttonA) the system creates an event, a signal that the thunkable program receives as “user has clicked buttonA”.
What this means is that there ISN’T an event that says “user has clicked a button, and it happens to be buttonA” where the button value is passed as a parameter.
You can create something that will be a close enough approximation, by having ALL the buttons click events call the same procedure, but with a different argument (i.e. button1 will call “buttonclicked(1)” and button2 will call “buttonclicked(2)”)
You will STILL need to have as many events has you have buttons.
But your “buttonclicked(buttonid)” function would work just like this block that you envision.
One way of having the sort of thing you describe would be to use canvas (it does not exist in X thunkable, but I implement exactly that in one of my thunkable classic app) to cover the WHOLE area, and to use the “touchdown(x,y)” event. Finding out which specific button was drawn at that location is then your responsibility.