1 # vim: foldmarker=<<<,>>> foldmethod=marker ft=tcl ts=4 shiftwidth=4
8 variable tooltipdelay 1000
9 variable tooltiptimeout 5500
11 method set_tips {args}
26 configbody tlc::Tooltips::tooltipdelay { #<<<1
27 $hoverbox configure -delay $tooltipdelay
31 configbody tlc::Tooltips::tooltiptimeout { #<<<1
32 $hoverbox configure -showtime $tooltiptimeout
36 body tlc::Tooltips::constructor {args} { #<<<1
37 array set tiptargets {}
39 set hoverbox [tlc::Hoverbox .tooltips#auto]
43 body tlc::Tooltips::destructor {} { #<<<1
44 if {[info exists hoverbox] && [winfo exists $hoverbox]} {
51 body tlc::Tooltips::set_tips {args} { #<<<1
52 if {[llength $args] == 1} {
53 # Support the variant syntax of one item packed with all the tips
55 set args [lindex $args 0]
57 foreach {label tip} $args {
58 set widget [path $label]
60 $hoverbox attach $widget $tip
62 $hoverbox detach $widget
68 body tlc::Tooltips::path {key} { #<<<1
69 if {![info exists tiptargets($key)]} {
70 error "Invalid key: ($key)"
73 return $tiptargets($key)