Chapter 9. A tkinter Tour, Part 2
“On Today’s Menu: Spam, Spam, and Spam”
This chapter is the second in a two-part tour of the tkinter library. It picks up where Chapter 8 left off and covers some of the more advanced widgets and tools in the tkinter arsenal. Among the topics presented in this chapter:
Menu,Menubutton, andOptionMenuwidgetsThe
Scrollbarwidget: for scrolling text, lists, and canvasesThe
Listboxwidget: a list of multiple selectionsThe
Textwidget: a general text display and editing toolThe
Canvaswidget: a general graphical drawing toolThe
gridtable-based geometry managerTime-based tools:
after,update,wait, and threadsBasic tkinter animation techniques
Clipboards, erasing widgets and windows, and so on
By the time you’ve finished this chapter, you will have seen the bulk of the tkinter library, and you will have all the information you need to compose larger, portable user interfaces of your own. You’ll also be ready to tackle the larger GUI techniques and more complete examples presented in Chapters 10 and 11. For now, let’s resume the widget show.
Menus
Menus are the pull-down lists you’re accustomed to seeing at the top of a window (or the entire display, if you’re accustomed to seeing them that way on a Macintosh). Move the mouse cursor to the menu bar at the top and click on a name (e.g., File), and a list of selectable options pops up under the name you clicked (e.g., Open, Save). The options within a menu might trigger actions, much like clicking on a button; ...