if 0 {[Richard Suchenwirth] 2005-08-16 - A colleague asked whether the [Tk] [canvas] has balloon help (little yellow windows showing some text) built-in. [http://mini.net/files/cballoon.jpg] I said no, but it'll be easy to make them. It turned out that there's some pitfalls, though: deleting a ''cballoon'' caused an event on the underlying item, if the cursor was on the balloon, leading to a tight make-delete loop which hung the demo app. Delaying the deletion by a millisecond helped. Here is the code: package require Tk proc cballoon {w tag text} { $w bind $tag [list cballoon'make $w $tag $text] $w bind all [list after 1 $w delete cballoon] } proc cballoon'make {w tag text} { foreach {- - x y} [$w bbox current] break if [info exists y] { set id [$w create text $x $y -text $text -tag cballoon] foreach {x0 y0 x1 y1} [$w bbox $id] break $w create rect $x0 $y0 $x1 $y1 -fill lightyellow -tag cballoon $w raise $id } } #---------------------------------------------------- Test pack [canvas .c] set id [.c create oval 10 10 110 110 -fill red] cballoon .c $id "This is a red oval" .c create rect 130 30 190 90 -fill blue -tag rect cballoon .c rect "This is\na blue square" bind . {exec wish $argv0 &; exit} if 0 { ---- [Arts and crafts of Tcl-Tk programming]}