Lab2 : Assignment

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:

      How to use the microwave:
 
        Click on any one of the four buttons (Frozen Veg, Bake Potato, Quick 30sec, beverages) and click on Cook button.
        As long as microwave operates, the Timer Box will show the count down in seconds till the count reaches 0. This Timer
        Box has to be updated every second. The user can stop the microwave any time by clicking on the Clear button. This
        will stop the microwave and the Timer box will be set back to 0.
 

    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.