The Shoebox. A place for lil' apps to live in peace and harmony.

Another timer application. This implements a toggle button for the Pause/Unpause buttons, so only two buttons are really needed. Version 0.1 wasn’t accurate (animate just incremented the number of seconds) and the toggle button was hacked in. Version 0.2 is accurate and extracts the ToggleButton class for you to use (with some minor modifications) in your code.

Versions:
.rb
0.1
.rb
0.2


Speak now or forever hold your peace:

fasdf
November 7, 2008

asdfasdf

farid
November 20, 2008

only reset button shows up, and how do i start the timer?

mikelygee
August 10, 2009

“@test” should be “@reset” in the call to ToggleButton.new() (line 73).

Tough_Nuts
August 14, 2009

When run, if you pick reset it just “pauses”.

Current Code:

@display = stack :margin => 10 reset display_time

My Change:

@display = stack :margin => 10 reset update_time display_time

Works much better. I think it should have a “Start” button as well.

Tough_Nuts
August 14, 2009

My bad.. Please disregard my change. But I figured out a problem.

If you let the timer run, and hit “Reset”, then let it run. It works as expected.

But if you let it run, then hit “Reset”, then let it run and hit “Pause”, and then hit “Reset”. The "Reset button has also become a “Pause” / “Un-Pause” button as well.


How do I use this?