- menu .m$b -tearoff 0
-}
-
-proc pressed {b x y} {
- global posted
- 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
- }