From: Paul Lutus Date: 2006-09-16T08:11:00+09:00 Subject: Re: wxRuby2-preview: strange event of TextCtrl Kuang Dong wrote: / ... > When I select "ello" of "Hello" and press "i",two "text change event" > raised,one is Hello->H and the other is H->Hi.Now I have to ignore the > first event(do nothing),and give suggestion by the last word.I have no > idea. I really do not understand the problem you are having, apart from the fact that you are writing a completion engine. A completion engine is very easy to write, but the user has to enter the first characters correctly. ------------------------------------------ #!/usr/bin/ruby dictionary = File.read("/usr/share/dict/words") test = "zeal" matches = dictionary.scan(/^#{test}.*$/) puts matches ------------------------------------------ (surprisingly long list of words whose first characters match the test string) Maybe you could explain the problem by saying very clearly what you hoped to accomplish, and, equally clearly, what happened instead. -- Paul Lutus http://www.arachnoid.com