Next: An Extended Tk
Up: Tk: A User
Previous: Widgets and User
#!/software/tk/bin/wish -f
wm title . "hi!"
button .hello -text "Hello, World!" -command exit
pack .hello
This shell script, when run, presents the interface
- The window manager is told that the titlebar should read ``hi!''.
- A button widget, .hello, is created with the label
``Hello, World!''.
- The geometry manager pack is used to place .hello on
the display.
- When all commands have been read, wish enters an
event-processing loop.
- When the .hello button is pressed, the program terminates
(exit is executed).
CS488/688: Introduction to Interactive Computer Graphics
University of Waterloo
Computer Graphics Lab
cs488@cgl.uwaterloo.ca