Page 17 -
P. 17
table of contents
building a graphical user interface
7 Going all gooey
Your coding skills are great and getting better all the time.
It’s just a shame your programs are not that nice to look at. Displaying prompts
and messages on a text-based console is all well and good, but it’s so 1970s,
isn’t it? Add some green text on a black background and your retro look will be
complete. There has to be a better way to communicate with your users than
the console, and there is: using a graphical user interface or GUI (pronounced
“gooey”). Sounds cool, but complex, and it can be. But, don’t fret; learning a trick or
two will have your code all graphical in no time. Let’s get all gooey (sorry, GUI) in
this chapter.
Head First TVN now produces game shows 216
pygame is cross platform 220
pygame Exposed 229
0... 2... 1... 9... blast off! 230
tkinter gives you the event loop for free 234
tkinter is packed with options 235
The GUI works, but doesn’t do anything 238
Connect code to your button events 239
The GUI program’s now ready for a screentest 244
But TVN is still not happy 246
Label it 249
Your Programming Toolbox 255
xvi