Sha256: 067526491bcc33e965a8ec37473a7b0548637708db5e1e119b304ea88c9f16ba

Contents?: true

Size: 421 Bytes

Versions: 1

Compression:

Stored size: 421 Bytes

Contents

# frozen_string_literal: true
Shoes.app height: 150, width: 250 do
  background rgb(240, 250, 208)
  stack margin: 10 do
    button "Start" do
      @time = Time.now
      @label.replace "Stop watch started at #{@time}"
    end

    button "Stop" do
      @label.replace "Stopped, ", strong((Time.now - @time).to_s), " seconds elapsed."
    end

    @label = para "Press ", strong("start"), " to begin timing."
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
shoes-4.0.0.pre12 samples/simple_timer.rb