A Tour Of Tk

A Tour Of Tk

From here, I will take you on a tour of the facilities provided by Tk, so that you'll see what each feature actually does. I believe the best way to learn is by doing, so, after examining the many Tclets I provide here, I hope you'll go out and write your very own ones. Once you've created that Tclet, send us some email about it, and we'll include it in the Tclet Register.

To facilitate learning about each widget provided with Tk, I've included sections that demonstrate each of them. These sections each concentrate on the abilities of a specific widget, but they may cross-reference to sections for other widgets. So just dive right in, and then come back here when you're ready to explore a different topic:

Labels are used to explain things and convey meaning.
The message widget is demonstrated in these pages.
Buttons let you click on them to tell the program to do things.
The entry widget lets you type in text.
The frame widget is useful for containing other widgets.
Here are various things you can do with the scale widget.
Scrollbars let you scroll through large sets of data.
You can do cool stuff with the listbox widget.
Text widgets are very rich and complicated, but also very rewarding.
Use canvas widgets for interactive, structured graphics. Very cool and powerful.

Tk comes with three geometry manager commands for managing the layout of widgets:

The place command simply drops widgets on the display where you tell it to.
The pack command lays out widgets according to a user supplied specification.
The grid command lays widgets onto a virtual grid.

There are also several other topics that you will learn about:

Common options for all Tk widgets.
How to cause widgets on the display to call into your Tclet; bindings.
How to use the after command to create delayed and special effects.
How to manipulate bitmaps and images.
How to manage colors, fonts and cursors in your Tclet.
How to get input from the user through the keyboard; focus management.

What! You're still here? You've been here now for seconds! Time to select one of the above topics!



comments?