From 39adac66a8a43655101a51f012f36c8b6395350c Mon Sep 17 00:00:00 2001 From: freesource Date: Thu, 29 Nov 2001 17:59:24 +0000 Subject: [PATCH] This closes the save_as box when Esc is pressed, and associated New Template with 103. --- BootRoot/YardBox.pm | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/BootRoot/YardBox.pm b/BootRoot/YardBox.pm index 18a508e..1dc2c0e 100644 --- a/BootRoot/YardBox.pm +++ b/BootRoot/YardBox.pm @@ -81,7 +81,7 @@ my @menu_items = ( { path => '/File', { path => '/File/_New Template', accelerator => 'N', callback => \&saved, - action => 100 }, + action => 103 }, { path => '/File/file_separator', type => '' }, { path => '/File/_Save', @@ -1183,7 +1183,7 @@ sub saved { return if $error && $error eq "ERROR"; } } - elsif ($whoami == 101) { + elsif ($whoami == 101 || $whoami == 103) { save_as(); } @@ -1581,7 +1581,8 @@ sub yard_menu { } -# This will just be a simple dialog +# This will just be a simple dialog, and doubles as New Template as +# well as Save As my $write_over; sub save_as { @@ -1592,6 +1593,15 @@ sub save_as { $save_as = Gtk::Dialog->new(); $save_as->signal_connect("destroy", \&destroy_window, \$save_as); $save_as->signal_connect("delete_event", \&destroy_window, \$save_as); + $save_as->signal_connect("key_press_event", sub { + my $event = pop @_; + if ($event->{'keyval'}) { + if ($event->{'keyval'} == 65307) { + $save_as->destroy; + } + } + }, + ); $save_as->set_title("Save As"); $save_as->border_width(12); $save_as->set_position('center');