Next: Initialization of Public Up: Tix Object Oriented Previous: The SetBindings Method


Declaring and Using Variables 

The private variables of a widget class do not need to be declared. In fact they can be initialized and used anywhere by any method. Usually, however, general purpose private variables are initialized by the InitWidgetRec method and subwidget variables are initialized in the ConstructWidget method.

We have seen in the tixArrowButton:InitWidgetRec example that the private variable data(count) was initialized there. Also, the private variable data(w:button) was initialized in tixArrowButton:ConstructWidget and subsequently used in tixArrowButton:SetBindings.

In contrast, public variables must be declared inside the class declaration. The following arguments are used to declare the public variables and specify various options for them: