From: Albert Wagner Date: 2001-08-07T10:00:21+09:00 Subject: [ruby-talk:19265] Re: Ruby/Tk: how to discard excess messages You're right, Kero. I tried that: it doesn't work. On Monday 06 August 2001 16:27, you wrote: > > An auto-repeat key is sending additional messages while method is > > still processing first message. How can I discard the excess > > messages? > > This does not work: > > def do_it(widget) > widget.bind("Any-Key") {} > really_do_it() > widget.bind("Any-Key") { do_it(widget) } > end > widget.bind("Any-Key") { do_it(widget) } > > Because of the single thread queueing the events > until after do_it() returns :( > > Perhaps you could look at the event timestamp? > > +--- Kero ------------------------------ kero@chello.nl ---+ > > | Don't split your mentality without thinking twice | > | Proud like a God -- Guano Apes | > > +--- M38c ------- http://members.chello.nl/~k.vangelder ---+