The purpose of this lab is to introduce
Tcl (Tools Command Language) and Tk (X-win
Tool Kit)
which are very good tools for Rapid
Prototyping. After completing this lab, you should be able to
understand the basic concepts of
each tool, know how to use them at basic level, and know where
to get additional information about
each tool.
Given here is the code for the simple Color-Mixer
example which is written in Tcl/Tk. Save this code
to a file with file name like colormixer.tk.
Open an X-window session and run this program by using the
command wish colormixer.tk. This
opens the program in a new window. Adjust the red, green and blue
scales to get the required color. Type a color value (in range 0 - 255)
in the text boxes for red, green and
blue colors and hit the set button. Go through the code of the program
and make sure you understand what
each statement does.
Lab Assignment to be turned in:
You have to design a working prototype
for the interface of a Microwave using Tcl/Tk.
The Layout of this interface
should be as shown in the following
figure. You are welcome to make any modifications to the layout to make
it look
better.
Behavior of the Interface:
The
interface shown in the above figure has the following widgets:
Hints to write this program:
Use the after command to maintain the
timer in your program. Use the update
command to continuously update the
countdown in the Timer Box every second.