From: Michael Wiebusch Date: Thu, 21 Aug 2014 12:36:44 +0000 (+0200) Subject: added cleared image X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=85d15eb030358f99ba547cdb1916f711a71a6509;p=coral.git added cleared image --- diff --git a/user_interface/clear.png b/user_interface/clear.png new file mode 100644 index 0000000..cffb1c1 Binary files /dev/null and b/user_interface/clear.png differ diff --git a/user_interface/gui.pl b/user_interface/gui.pl index 2913639..12436d2 100755 --- a/user_interface/gui.pl +++ b/user_interface/gui.pl @@ -62,7 +62,7 @@ $quit_button->signal_connect( clicked => sub { -my $image = Gtk2::Image->new_from_file ("plot.png"); +my $image = Gtk2::Image->new_from_file ("clear.png"); # $vbox->pack_start($image, TRUE, TRUE, 0); $plot_frame->add($image); @@ -91,18 +91,14 @@ $plot_button->signal_connect( clicked => sub { # $label->set_text(qx%echo blah%); execute("./plot.sh"); - $plot_frame->remove($image); - $image->clear; - $image = Gtk2::Image->new_from_file ("plot.png"); - $plot_frame->add($image); - $window->show_all; + show_image("plot.png"); }); $clear_button->signal_connect( clicked => sub { execute("./analyzer.pl --clear"); - $image->clear; + show_image("clear.png"); }); @@ -111,6 +107,7 @@ $setWindowLength_button->signal_connect( clicked => sub { execute("./analyzer.pl --window $windowLength"); # $label->set_text($windowLength_entry->get_text()); execute("./analyzer.pl --clear"); + show_image("clear.png"); }); @@ -123,6 +120,15 @@ sub execute { } +sub show_image{ + my $filename = shift; + $plot_frame->remove($image); + $image->clear; + $image = Gtk2::Image->new_from_file($filename); + $plot_frame->add($image); + $window->show_all; +} + diff --git a/user_interface/plot2.png b/user_interface/plot2.png deleted file mode 100644 index 3f7b5ee..0000000 Binary files a/user_interface/plot2.png and /dev/null differ