diff options
-rwxr-xr-x | clock.pm | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -20,6 +20,7 @@ my $first=1; my $is24; my $h_old; my ($old_year, $old_month, $old_day); +my $its_reset=0; my $window = $::isEmbedded ? new Gtk::Plug ($::XID) : new Gtk::Window -toplevel; my $vbox = new Gtk::VBox(0,0); $window->add($vbox); @@ -104,11 +105,13 @@ $button_cancel->signal_connect ( clicked => sub { }); $bbox->add($button_cancel ); $button_reset->signal_connect ( clicked => sub { + $its_reset=1; $timer=Gtk->timeout_add(120, sub { time_to_rad(localtime(time)); Repaint($drawing_area) }); time_to_rad(localtime(time)); Repaint($drawing_area); $calendar->select_month($old_month, $old_year); $calendar->select_day($old_day); $button_reset->set_sensitive(0); + $its_reset=0; }); $bbox->add($button_reset); @@ -127,7 +130,7 @@ $timer=Gtk->timeout_add(120, sub { time_to_rad(localtime(time)); Repaint($drawin Gtk->main; sub cal_changed { - $timer and Gtk->timeout_remove($timer); + !$its_reset and $timer and Gtk->timeout_remove($timer); $button_reset->set_sensitive(1); } |