O'Reilly logo

Practical Programming in Tcl & Tk, Third Edition by Brent B. Welch

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The Widget Instance Command

For each instance of a widget, a new command is created that operates on that widget. This is called the widget instance command. Its name is the same as the Tk pathname of the widget. In the clock example, all that is done on instances is to query and change their attributes. Most of the work is done by Tk_ConfigureWidget and ClockConfigure, which are shown in the next section. The ClockInstanceCmd command procedure is shown in the next example:

Example 46-5 The ClockInstanceCmd command procedure.
 static int ClockInstanceCmd(clientData, interp, argc, argv) ClientData clientData;/* A pointer to a Clock struct */ Tcl_Interp *interp; /* The interpreter */ int argc; /* The number of arguments */ char *argv[]; /* The ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required