Objective: To practice using GUI widgets from the Tkinter module in Python.

The Assignment Overview

For this lab, you will be modifying the Tkinter examples from lecture 22 and chapter 12. For today's lab you'll need several files, so start the lab by copying the directory P:\Math-CS\810-051-fienup\common\lab12 to your P: space (or desktop or flash drive).

Useful references on the Tkinter module can be found at:

http://docs.python.org/lib/module-Tkinter.html

and

http://infohost.nmt.edu/tcc/help/pubs/tkinter/

Part A: Add a "Done" button to the EntryTest.py program that prints the contents of both Entry widgets to a tkMessageBox using the showinfo(title, message). You'll need to import the tkMessageBox module as done in the textbook examples (see page 430 or code you copied).

After you have implemented AND fully tested your modification, raise your hand and demonstrate the it.

Part B: Add enough new animals to the Listbox in the ListboxTest.py program to force the y-scrollbar to be used. Refactor the Python code so that it populates the Listbox from a list of animals, e.g., ['cat', 'dog', ...].

After you have implemented AND fully tested your modification, raise your hand and demonstrate it.

Part C: Add a line draw option to the "Shape" menu in the CanvasTest.py program. Use the "crosshair" cursor for the line. Details about the canvas line object can be found at:

http://infohost.nmt.edu/tcc/help/pubs/tkinter/create_line.html

After you have implemented AND fully tested your modification, raise your hand and demonstrate it.

NOTE: If you complete all of the activities within the lab period, you do not need to hand anything it. However, if you need to finish activities outside of class , then hand in:

If you don't get all three parts done, don't worry about it. Just try to have the lab completed by next lab.