subsubsectionstar3_3_2_3.html
subsection3_3_2.html
subsubsection3_3_2_1.html
tableofcontents3_1.html
Next:
subsubsectionstar3_3_2_3.html
Disabling Callbacks Temporarily
Up:
subsection3_3_2.html
Getting Started: the
Previous:
subsubsection3_3_2_1.html
Creating a TixControl
Accessing The Value of a TixControl Widget
The TixControl widget allows the user to input a value. There are
several ways to read this value in your program. First of all,
TixControl stores the current value in the
-value
option.  You
can use query the
-value
option by calling the command
.c cget -value
this command will return the current value of the tixContro widget
.c
.  The following command sets the value of the widget to a
new number (100):
.c config -value 100
The second way to access the value of TixControl is to use the
-variable
option. This options instructs the TixControl widget to
store the its value into a global variable so that you can read it
at any time. Also, by assigning a new value to this global variable,
you can change the value of the TixControl widget. Here is an
example:
.c config -variable myvar
set myvar 100
In some situations, you may want to be informed immediately when the
value of the TixControl widget changes. To accomplish this, you can use
the
-command
option.  The following line causes the TCL procedure
valueChanged
to be called whenever the value of
.c
changes:
tixControl .c -command valueChanged
http://tix.sourceforge.net
http://tix.sourceforge.net
