binding Escape to Cancel in Tk::Dialog(Box) 
Author Message
 binding Escape to Cancel in Tk::Dialog(Box)

Hi,
I'm asking for any advice on %SUBJ%. I use Dialogs/DialogBoxes a lot
to display small modal windows with OK and Cancel buttons. It would be
cool if users could cancel them with Escape too. Does anybody know how to
implement this?

Thanks for any answer,

  Petr Pajas

--



Mon, 09 Sep 2002 03:00:00 GMT  
 binding Escape to Cancel in Tk::Dialog(Box)
The code below works for me:

use Tk;
use Tk::DialogBox;

my $top = new MainWindow;
my $d = $top->DialogBox(-title => "Title", -buttons => ["OK",
"Cancel"]);
my $button = $d->Subwidget("B_Cancel");
$d->bind('<Escape>' => [ $button, 'Invoke' ]);
$d->Show;

--b

Quote:

> Hi,
> I'm asking for any advice on %SUBJ%. I use Dialogs/DialogBoxes a lot
> to display small modal windows with OK and Cancel buttons. It would be
> cool if users could cancel them with Escape too. Does anybody know how to
> implement this?

> Thanks for any answer,

>   Petr Pajas

> --



Tue, 10 Sep 2002 03:00:00 GMT  
 binding Escape to Cancel in Tk::Dialog(Box)
: Hi,
: I'm asking for any advice on %SUBJ%. I use Dialogs/DialogBoxes a lot
: to display small modal windows with OK and Cancel buttons. It would be
: cool if users could cancel them with Escape too. Does anybody know how to
: implement this?
:
: Thanks for any answer,
:
:   Petr Pajas
:
: --

        Go get "JDialog.pm" at http://turnerville.virtulave.net

Among other things, it supports an "Escape" button, gif-image buttons,
wrap-control, and some bug-fixes.

Enjoy!

Jim Turner



Sat, 14 Sep 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. HELP: Problem w/Tk, Dialog Boxes

2. Dialog without Tk::Dialog

3. Creating dialog boxes with tkperl

4. Dialog box module for Win32?

5. Help: Dialog box in web browser

6. Changing the filename in the download dialog box

7. Win32 & OLE Dialog box in Word

8. CGI saving file dialog box

9. FTP/HTTP -- GUI/Dialog BOX

10. Windows NT Open file dialog boxes - How?

11. Getting around javascript dialog box confirm button

12. question: perl cgi/dbi script with javascript dialog box

 

 
Powered by phpBB® Forum Software