15.04.2018 Views

programming-for-dummies

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

294<br />

Elements of a User Interface<br />

The simplest way to display a command to the user is through a button.<br />

Because buttons can take up so much space on-screen, buttons are most<br />

useful <strong>for</strong> displaying a limited number of commands to the user, such as two<br />

or three possible choices, as shown in Figure 10-4.<br />

Figure 10-4:<br />

Buttons<br />

can display<br />

the entire<br />

command<br />

name .<br />

The problem with buttons is that they take up screen space, so using more<br />

than a handful of buttons can crowd the screen and confuse the user. So<br />

rather than bombard users with screens full of buttons, programs generally<br />

use buttons to offer choices that users need to make immediately.<br />

For example, when quitting a program, the program may ask the user if she<br />

wants to save her file be<strong>for</strong>e quitting. So the limited number of choices are<br />

only: Don’t Save, Save, and Cancel.<br />

Buttons are useful <strong>for</strong> limiting the user’s choices to a handful of options.<br />

However, buttons are impractical <strong>for</strong> displaying a large number of commands.<br />

The most popular way <strong>for</strong> displaying multiple commands to the user is<br />

through pull-down menus. Pull-down menus organize commands into categories,<br />

such as File, Edit, Window, and Help.<br />

Un<strong>for</strong>tunately, pull-down menus aren’t easy to use when a program has hundreds<br />

of possible commands. As a result, commands often get buried within<br />

multiple pull-down menus.<br />

To solve this problem, many programs group related commands within<br />

submenus, but now you have the problem of trying to find a command<br />

buried within a submenu, which is buried in a pull-down menu, as shown<br />

in Figure 10-5.<br />

Because pull-down menus can get overloaded with so many commands, user<br />

interface designers started displaying commands as icons and grouping<br />

icons together in toolbars that usually appear directly underneath pull-down<br />

menus, as shown in Figure 10-6.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!