O'Reilly logo

Tcl/Tk in a Nutshell by Paul Raines, Jeff Tranter

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

Name

WidgetClass

tixWidgetClass className {option value ... }

Define a new mega-widget class named className. A Tcl command named className is also defined, which will create new instances of the class. Available options are as follows:

-alias aliasList

Aliases for the options defined by -flag. Each element of aliasList is a two-item list consisting of the alias followed by the full option to which it maps.

-classname classResName

Resource class name for the mega-widget for use by Tk resource database. By convention, classResName is the same as the className argument with the first letter capitalized.

-configspec configList

Configuration of each option that the new mega-widget supports (see-flag). Each element of configList is a four- or five-item list. The required four elements are the option name (including the hyphen), resource name, resource class, and default value. The optional fifth element is a Tcl command used to validate a value for the option. This command is called once the option is initialized at creation and whenever its value is set with the configure method. The candidate value is appended to the call as an argument. The command should return the value to actually be used or generate an error.

-default resList

List of Tk resource specifications to be applied for each instance of the mega-widget. These resources are most often used to set up configuration defaults for subwidgets of the mega-widget. Each element of resList is a two-item list giving the pattern and value, as ...

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