Created
December 17, 2018 15:52
-
-
Save naaando/6261eae4ea1f9966a1b7eac46874a479 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void some_method (Pomodoro.Service ps) { | |
pomodoro_service.start.connect (on_pomodoro_service_started); | |
pomodoro_service.stop.connect ((state) => { | |
cancellable.cancel (); | |
start_n_stop_stack.visible_child_name = "start-button"; | |
}); | |
} | |
void on_pomodoro_service_started (Pomodoro.State state) { | |
state_label.set_pomodoro_state (state); | |
cancellable = new Cancellable (); | |
Timeout.add (500, () => { | |
timer_label.set_time_in_seconds (pomodoro_service.timer.get_remaining_time ()); | |
return !cancellable.is_cancelled (); | |
}); | |
print (@"Pomodoro started\n"); | |
start_n_stop_stack.visible_child_name = "stop-button"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment