 
 subsection3_4_6.html  subsectionstar3_4_5.html  subsubsection3_4_5_1.html  tableofcontents3_1.html   Next: subsection3_4_6.html Declaring and Using Up: subsectionstar3_4_5.html Chaining Methods  Previous: subsubsection3_4_5_1.html The ConstructWidget Method    The SetBindings Method 
In your interface, you want to handle a lot of events in the
subwidgets that make up your mega-widget. For instance, when somebody
presses the button in a 
TixArrowButton widget, you want the button to
handle the event. The 
SetBindings method is used to creates event
bindings for the components inside the mega-widget. In our
TixArrowButton example, we use the bind command to specify that the
method 
tixArrowButton:IncrCount should be called each time when the
user presses the first mouse button. As a result, we can count the
number of times the user has pressed on the button.
proc tixArrowButton:SetBindings {w} {
    upvar #0 $w data
    tixChainMethod $w SetBindings
    bind $data(w:button) <1> \
        "tixArrowButton:IncrCount $w"
}
proc tixArrowButton:IncrCount {w} {
    upvar #0 $w data
    incr data(count)
}
http://tix.sourceforge.nethttp://tix.sourceforge.net 