Tix Mega-widget Overview

Tix mega-widgets are created and manipulated in the same manner as standard Tk widgets. Options can be set both at creation or with the widget’s configure method. All mega-widgets let you specify option values using the Tk options database and query option values with the cget method.

The widgets that are used to compose a mega-widget can be standard widgets or other mega-widgets. Each of these subwidgets is identified by a unique name defined in the mega-widget’s API. All mega-widgets support the subwidget method to directly access their subwidgets. This method has the form:

pathName subwidget subwidget [method [args ...] ]

where subwidget is the unique name given to the subwidget by the mega-widget. When the method argument is omitted, the widget pathname of the subwidget is Returned. Otherwise, the method method of the subwidget is called with any optional arguments and the results Returned. For example, to change the background color of the entry widget contained in the tixControl mega-widget .c, one would use this code:

.c subwidget entry configure -bg white

The subwidget root is present in all mega-widgets and is the equivalent to the name of the created mega-widget (i.e., the pathName argument to the mega-widget creation command). It is the base container upon which each mega-widget is built and is almost always either a frame or top-level widget.

The object-oriented framework for defining a mega-widget class supports inheritance from another mega-widget class. The class being inherited from is called the superclass of the class being defined. The mega-widget class tixPrimitive is at the top of the mega-widget class hierarchy for the classes supplied with Tix. All other classes are descendants of tixPrimitive. A mega-widget inherits all the commands, options, and subwidgets of its superclass.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset