# Bind Chapter
proc BindTrace {} {
    global classes
    set classes {}
    BindTraceInner .
    foreach w $classes {
	BindTraceUpdate $w
    }
}
proc BindTraceInner { parent } {
    global classes
    foreach w [winfo children $parent] {
	set class [winfo class $w]
	if {[lsearch $classes $class] < 0} {
	    lappend classes $class
	}
	BindTraceUpdate $w
	BindTraceInner $w
    }
}
proc BindTraceUpdate { w } {
    foreach sequence [bind $w] {
	bind $w $sequence "[bind $w $sequence]; puts {window %w event %# time %t type %T}"
    }
}
