Sha256: 6be8f98bea9ce0959a8ea3b64ea88a756c1e2e91b0210e2753332c67cc679b01

Contents?: true

Size: 632 Bytes

Versions: 2

Compression:

Stored size: 632 Bytes

Contents

Shoes.app do
  # Shoes 3 doesn't support button.text
  position_report = lambda { |button, button_text| @position_report.replace "#{button_text}: (#{button.left}, #{button.top})" }
  flow margin: 12 do
    # Set up three buttons
    button "One", :click => proc { |button| position_report.call(button, "One") }
    @two = button "Two", :click => proc { |button| position_report.call(button, "Two") }
    button "Three", :click => proc { |button| position_report.call(button, "Three") }
    @position_report = para ''
    # Bounce the second button
    animate do |i|
      @two.displace(0, (Math.sin(i) * 6).to_i)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
shoes-4.0.0.pre2 samples/simple-displace.rb
shoes-4.0.0.pre1 samples/simple-displace.rb