Initialization of Public Variables<A NAME=651> </A>

Next: Type Checker Up: Declaring and Using Previous: Declaring and Using

### Initialization of Public Variables

When a widget instance is created, all of its public variables are initialized by the Tix Intrinsics before the `InitWidgetRec` method is called. Therefore, `InitWidgetRec` and any other method of this widgte instance are free to assume that all the public variables have been properly initialized and use them as such.

The public variables are initialized by the following criteria.

> - Step 1: If the value of the variable is specified by the creation command, this value is used. For example, if the application programmer has created an instance in the following way:

>   > `tixArrowButton .arr -direction n`

>   The value `n` will be used for the -direction variable.

> - Step 2: if step 1 fails but the value of the variable is specified in the options database, that value is used. For example, if the user has created an instance in the following way:

>   > `option add *TixArrowButton.direction w
>   > tixArrowButton .arr`

>   The value `w` will be used for the `-direction` variable.

> - Step3: if step 2 also fails, the default value specified in the `-configspec` secton of the class declaration will be used.