----- Original Message ----- 
From: "neil" <neil / quill.rubbishplus.net.web-hosting.com>
Newsgroups: comp.lang.ruby
To: "ruby-talk ML" <ruby-talk / ruby-lang.org>
Sent: Wednesday, April 24, 2002 8:16 AM
Subject: Re: Minor Tk bug on Windows?


>  A bind something like this should work,
>   
>  TkButton.new(root){
>     text  'Close'
>     bind "Return", proc{ root.destroy}
>     command proc{ root.destroy }
>     pack
>  }

Thanks, Neil... that works very nicely.

Two other questions while we're on the subject:

1. How can I fix radio buttons so that when I move
the focus to one (by tabbing), it is selected without
my having to hit the space bar?

I tried 
    bind "FocusIn", myproc
but it crashed and burned the app (irrespective of
what the proc contained).

2. Suppose I have a frame with three entry fields.
The first two make up (essentially) a database key
which determines the default value for the third. 
I want to set the value for the third field when the
focus leaves the second one. And if the user 
presses Enter on the second field, I want it to 
populate the field and then sleep briefly so that
the field is visible before the window vanishes.

Any help appreciated...

Hal Fulton