Using Tk, you use Tcl scripts just like before, but now you have more fun commands to play with.
Tk uses X to implement a ready-made set of controls with a motif like look and
feel. These are called widgets. Each widget is a member of a class in a
hierarchy of other widgets. Each widget can contain any number of children
widgets. Each widget has a name, which represents the widget, as well
as where it is in the widget tree.
.a.b.cThis name refers to the widget 'c' which is a child of b, which in turn is a child of a, which is a child of the main widget (.).
label .lab -text "Hello World"You will not actually see the widget until you use Tk's geometry manager to place it somewhere. There are a few kinds of geometry management in Tk, but they are too complex to go into great detail here. For now, to make your widget appear on the screen, you must pack it.
pack .lab