Example 18-1 illustrates a style of named parameter passing that is prevalent in the Tk commands. Pairs of arguments specify the attributes of a widget. The attribute names begin with -, such as -text, and the next argument is the value of that attribute. Even the simplest Tk widget can have a dozen or more attributes that can be specified this way, and complex widgets can have 20 or more attributes. However, the beauty of Tk is that you only need to specify the attributes for which the default value is not good enough. This is illustrated by the simplicity of the Hello, World example.

The following tables list the Tcl commands added by Tk. Table 18-1 lists commands that create widgets. There are 15 different widgets in Tk, although 4 of them are variations on a button, and 5 are devoted to different flavors of text display. Table 18-2 lists commands that manipulate widgets and provide associated functions like input focus, event binding, and geometry management. Table 18-3 lists several support procedures that implement standard dialogs, option menus, and other facilities. The page number in the table is the primary reference for the command, and there are other references in the index