Chapter 6. GUIs—Graphical User Interfaces

 

Up until now, all our input and output has been simple text in the IDLE window. But modern computers and programs use lots of graphics. It would be nice if we could have some graphics in our programs. In this chapter, we’ll start making some simple GUIs. That means our programs will start to look more like the ones you’re used to—with windows, buttons, and so on.

What’s a GUI?

GUI is an abbreviation for graphical user interface. In a GUI, instead of just typing text and getting text back, the user sees graphical things like windows, buttons, text boxes, etc., and she can use the mouse to click things as well as type on the keyboard. The types of programs we have done so far are command-line or text-mode programs. A GUI is just a different way of interacting with a program. Programs that have a GUI still have the three basic elements: input, processing, and output. It’s just that their input and output are a bit fancier.

Tip

By the way, the acronym GUI is usually pronounced “gooey,” instead of saying the letters, like “Gee You Eye.” It’s okay to have a GUI on your computer, but you should avoid getting anything gooey on your computer. It gets stuck in the keys and makes it hard to type!

Our first GUI

We have already been using a GUI—in fact, several of them. A web browser is a GUI. IDLE is a GUI. Now we’re going to make our own GUI. To do this, we’re going to get some help from something called EasyGui.

GUI input

 
 
 
 

Pick your flavor

 

The number-guessing game... again

 
 
 
 

Other GUI pieces

 
 
 

What did you learn?

 
 
 

Test your knowledge

 
 
 

Try it out

 
 
 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest