Menu

#2816 "event delete" doesn't seem to work.

obsolete: 8.4.6
closed-invalid
5
2004-07-26
2004-07-24
Anonymous
No

Tcl/Tk was compiled last year from unmodified source on
a Fedora Core 1 Pentium MMX system and installed in
/usr/local/bin by the default make method.

"event delete <<easterEgg>>" simply does not work as
described in
"Tcl/Tk Programmer's Reference" by Christopher Nelson;
the event output continues to be triggered by the key
strokes defined in the example script until the GUI is
closed. I could not find this in the Bug Tracker.

#! /usr/local/bin/wish
proc virtualBinding {virtualEvent} {
# upvar $virtualEvent <<VE>>
# print a message
puts "Spring is here!"
# Get rid of all associations for the virtual
# event.
# event delete <<VE>>
<Control-Shift-Alt-Triple-ButtonPress-3>
uplevel "event delete $virtualEvent
<Control-Shift-Alt-Triple-ButtonPress-3>"
puts "event delete $virtualEvent";#
<Control-Shift-Alt-Triple-ButtonPress-3>
}
# an obscure mouse event
event add <<easterEgg>> \
<Control-Shift-Alt-Triple-ButtonPress-3>
# A keyboard alternative
event add <<easterEgg>> <Alt-Triple-KeyPress-F1>
# What to do when either sequence occurs
bind . <<easterEgg>> \
[list virtualBinding <<EasterEgg>>]

--
Michael J. Burns mburns9@mindspring.com

Discussion

  • Joe English

    Joe English - 2004-07-26
    • assigned_to: nijtmans --> jenglish
    • status: open --> closed-invalid
     
  • Joe English

    Joe English - 2004-07-26

    Logged In: YES
    user_id=68433

    Virtual event names are case-sensitive: if you change the
    last line to:

    bind . <<easterEgg>> [list virtualBinding <<easterEgg>>]

    it works as expected (note "easterEgg" vs. "EasterEgg").

     
MongoDB Logo MongoDB