Scripts and Utilities -- Tck/Tk lab


  • Jim Plank
  • Due: 3:30 PM, Tuesday, August 5.
  • This file: http://www.cs.utk.edu/~plank/plank/classes/cs494/494/labs/tcltk/lab.html
  • tcltk lecture notes
  • Guest TA: Wael Elwasif(elwasif@cs.utk.edu).
    Write the following two programs using Tcl/Tk. You'll have to make use of the lecture notes, the demo programs in /usr/local/X11R6.3/lib/tk4.1/demos (especially the "widgets"), and the man pages at http://www.tcltk.com/TclTkMan/TclTkManPages.html.
    1. Write an application tls that is an interface to ls. It should have two text entry areas, one for a directory name, and one for a grep-style pattern. It should also have two buttons: Quit and List. Finally, it should have a 60x20 text area with scroll bars. Quit obviously exits the program. List lists the specified directory and passes the output to grep which uses the filter as a pattern. The output of these should be put on the text area. Each time List is pressed, the current text in the text field should be replaced by the listing (i.e. the listing should not merely be appended to the text field). If the directory field is empty, it should list the current directory, and if the filter field is empty, then all of the files should be lists.

      See the example program to see how it should work. To help you out with text fields and scroll bars, look at tcat, which is a little interface on top of cat.

    2. Write a game matcher that matches faces to name. Use the files in this directory:

      The best thing I can say is try the example and make your program work like this one. For an example of matching gif files to buttons, and modifying labels, see itsduke. To get the name buttons working, see the "radio buttons" example from the "widgets" program in the demo directory. This one will take a little time, but is well worth the effort!


    Working Examples

    Working examples are in the directory /home/cs494/labs/tcltk/programs. You can run these only on kenner.