RE: Simple ok/cancel routine

[email protected] (Philip Brady) Wed, 15 Jun 2016 10:35:00 +0000
Newsgroups perl.tcltk
Message-ID <[email protected]>
Thanks for the replies -  most helpful.
Phil
 

> From: [email protected]
> Subject: Re: Simple ok/cancel routine
> To: [email protected]
> Date: Tue, 14 Jun 2016 21:42:09 -0700
> 
> On 6/14/2016 10:29, Philip Brady wrote:
> >
> > I'm writing a perl script using Tk and have had some success but I wish to have a very simple subroutine to ask the user a question and get a response 'ok' or 'cancel'.
> >
> > My routine follows but it doesn't quite work as expected.
> > It's fine if I mouse click on 'ok' or simply press the return key - it correctly returns 'ok'.
> > If I clink 'cancel' it correctly returns 'cancel'.
> >
> > Unfortunately, if I tab to 'cancel' then press return it returns 'ok' rather than the desired 'cancel'.
> 
> Try space instead of return.  Notice the dotted frame moves when you tab, but
> the sunken background is only on the OK button.  The default button for enter
> is the first button or the one specified as default.