15.04.2018 Views

programming-for-dummies

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

38<br />

Making User Interfaces with Event-Driven Programming<br />

Making User Interfaces with<br />

Event-Driven Programming<br />

In the early days, using a program was fairly simple. After typing the command<br />

to run a particular program, that program might ask a question such as<br />

What is your name?<br />

At this point, you had no choice but to type a name, such as Joe Smith. After<br />

you typed in your name, the program might respond with<br />

Hello, Joe Smith. What month were you born?<br />

The moment you typed in a month, such as April, the program might<br />

respond:<br />

What day were you born?<br />

And so on. If you wanted to type your day of birth be<strong>for</strong>e your month of<br />

birth, you couldn’t because the program controlled your options.<br />

Not surprisingly, using a computer like this was frustrating to most people,<br />

so computer scientists soon invented something called a graphical user interface<br />

(abbreviated as GUI).<br />

A GUI displays multiple options to the user in the <strong>for</strong>m of pull-down menus,<br />

windows, buttons, and check boxes. Suddenly, instead of the computer dictating<br />

what the user could do at any given time, the user could tell the computer<br />

what to do at any given time, just by choosing one of many available<br />

commands.<br />

Forcing each program to display menus and windows had two advantages<br />

<strong>for</strong> users:<br />

✦ It made using a computer much easier. Instead of having to type in<br />

commands, users could just click the command they wanted to use.<br />

✦ It’s fairly easy to figure out how to use different types of programs.<br />

After you understand that you can choose the Print command in the File<br />

menu, you know how to print in any program whether it’s a word processor,<br />

a database, or an image editing program.

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

Saved successfully!

Ooh no, something went wrong!