From: Jos Backus Date: 2002-02-15T05:13:51+09:00 Subject: Re: FXRuby: how to create a static status line? Hello Lyle, On Sat, Feb 09, 2002 at 11:19:29AM +0900, Jos Backus wrote: > @comment.connect(SEL_KEYPRESS) { |sender, sel, event| > if (event.code == KEY_Return) || (event.code == KEY_KP_Enter) > # User clicked the Enter key; save this event message and then > # return 1 from this handler to let FOX know that we've handled > # the event. > unless @comment.text.empty? > addevent > end > return 1 > else > # It wasn't the Enter key, so we return 0 to let FOX know that > # we didn't handle this event and we want the text field to > # it like it usually would... > return 0 > end > } > > gives: > > lizzy:~% ./fxev.rb > /usr/local/lib/ruby/site_ruby/1.6/fox/responder2.rb:29:in `call': return from proc-closure (LocalJumpError) > from /usr/local/lib/ruby/site_ruby/1.6/fox/responder2.rb:29:in `onHandleMsg' > from ./fxev.rb:260:in `run' > from ./fxev.rb:260 http://www.geocrawler.com/lists/3/SourceForge/3371/0/7820666/ gave me the idea to use ``true'' and ``false'' instead of ``return 1|0'', and that seems to work (no crashes so far). Cheers, -- Jos Backus _/ _/_/_/ Santa Clara, CA _/ _/ _/ _/ _/_/_/ _/ _/ _/ _/ josb@cncdsl.com _/_/ _/_/_/ use Std::Disclaimer;