- menu .m$b -tearoff 0
-}
-
-proc pressed {b x y} {
- global posted
- tooltip_cancel
- if {$posted == $b} {
- puts "unpost $posted toggle"
- .m$posted unpost
- set posted 0
- } elseif {[winfo exists .m$b]} {
- if {$posted} {
- .m$posted unpost
- puts "unpost $posted other"
- }
- puts "post $b"
- set posted $b
- .m$b post $x $y
- }
-}
-
-proc msel {} {
- global posted
- set posted 0
-}
-
-bind .i <ButtonPress> { pressed %b %X %Y }
-
-proc tooltip_starttimer {state x y} {
- global tooltip_after posted tooltip_inwindow
- if {$state || $posted || !$tooltip_inwindow} { tooltip_cancel; return }
- catch { after cancel $tooltip_after }
- set tooltip_after [after 500 tooltip_show $x $y]
-}
-
-proc tooltip_cancel {} {
- global tooltip_after
- catch { after cancel $tooltip_after }
- catch { unset $tooltip_after }
- wm withdraw .tt