Chapter 15. Choosing Commands with Buttons

The user interface lets you communicate with a program. In the old days, you had to type a command to make a program do something. If you didn't know the command to type or if you misspelled it, your command wouldn't work, and the program wouldn't respond to your actions.

Fortunately, today's programs use a graphical user interface (GUI) that displays options on the screen for the user to select using the mouse or keyboard. For most programs, the simplest way to offer options for the user to select involves using buttons.

A button typically appears on the screen as a rectangular object with a descriptive command displayed inside such as the word Print or Cancel. However, buttons can appear in different ...

Get Mac Programming for Absolute Beginners now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.