I am trying to create a calculator in Cocoa. So far, I have the parser ready (made in C++) but my problem lies into building the interface. This is a screenshot of my interface so far (very primitive). All I want to do is to press a button and have its name appeared into the NSTextField. I could do that by making 10 different functions for each button, but I thought that an NSMatrix would help, so these 10 buttons you see are all NSMatrix. My question is: How do I take the value of each button pressed in the NSMatrix so that I can display it into the textfield? (of course there are many ways to do it... but I want to know the way which is more flexible).