Elijah has asked for the wisdom of the Perl Monks concerning the following question:
Any ideas?sub close { chomp(my $data = $t->get("1.0", "end")); open (TEMP, ">compare") || $t->insert("end", "Cannot open \"compare +\"\n"); print TEMP $data; close(TEMP); if ($filename ne "") { my $compare = compare($filename, "compare"); if ($compare == 0) { exit; }elsif ($compare == -1) { $status->insert("end", "There was an error while comparing!\n +"); }else{ my $sw = MainWindow->new(-title=>"Content Has Changed"); my $frame = $sw->Frame->pack(-side => 'top', -fill => 'x'); $frame->Label(-text => "Would you like to save before exiting +?")-> pack(-side => 'left', -anchor => 'w'); $frame->Button(-text => "No", -background => 'navy blue', -fo +reground => 'white', -command => sub {exit;})-> pack(-side => 'right'); $frame->Button(-text => "Yes", -background => 'navy blue', -f +oreground => 'white', -command =>\&save_and_exit)-> pack(-side => 'right'); } }else{ my $sw = MainWindow->new(-title=>"Save File?"); my $frame = $sw->Frame->pack(-side => 'top', -fill => 'x'); $frame->Label(-text => "Would you like to save before exiting?") +-> pack(-side => 'left', -anchor => 'w'); $frame->Button(-text => "No", -background => 'navy blue', -foreg +round => 'white', -command => sub {exit;})-> pack(-side => 'right'); $frame->Button(-text => "Yes", -background => 'navy blue', -fore +ground => 'white', -command =>\&save_and_exit)-> pack(-side => 'right'); } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: clsoing sub window upon execution?
by PodMaster (Abbot) on Dec 03, 2003 at 23:23 UTC | |
by Elijah (Hermit) on Dec 04, 2003 at 00:00 UTC | |
by sumanth123 (Initiate) on Mar 19, 2015 at 09:02 UTC | |
|
Re: clsoing sub window upon execution?
by pg (Canon) on Dec 04, 2003 at 02:33 UTC | |
by Elijah (Hermit) on Dec 04, 2003 at 05:13 UTC | |
by pg (Canon) on Dec 04, 2003 at 05:27 UTC | |
by Elijah (Hermit) on Dec 04, 2003 at 15:56 UTC | |
by Grygonos (Chaplain) on Dec 04, 2003 at 17:15 UTC |