Sha256: ef53c21b21c41af16b3bcb53a30b1cc573bec78e47d2f4dcc1e674897ed73602

Contents?: true

Size: 725 Bytes

Versions: 25

Compression:

Stored size: 725 Bytes

Contents

# Almost same code as sample22.rb : http://shoes-tutorial-note.heroku.com/html/00508_The_Widget_class.html

require '../lib/green_shoes'

class Answer < Shoes::Widget
  attr_reader :mark
  def initialize word
    flow do
      flow(width: 70){para word}
      @mark = image('./loogink.png', width: 20, height: 20).hide
    end
  end
end

Shoes.app width: 200, height: 100 do
  stack width: 0.5 do
    background palegreen
    para '1. apple'
    ans = answer '2. tomato'
    para '3. orange'
    button('Ans.'){ans.mark.toggle}
  end
  stack width: 0.5 do
    background lightsteelblue
    para '1. cat'
    para '2. dog'
    ans = answer '3. bird'
    button('Ans.'){ans.mark.toggle}
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
green_shoes-1.0.322 samples/sample30.rb
green_shoes-1.0.320 samples/sample30.rb
green_shoes-1.0.309 samples/sample30.rb
green_shoes-1.0.303 samples/sample30.rb
green_shoes-1.0.282 samples/sample30.rb
green_shoes-1.0.273 samples/sample30.rb
green_shoes-0.263.0 samples/sample30.rb
green_shoes-0.255.0 samples/sample30.rb
green_shoes-0.243.0 samples/sample30.rb
green_shoes-0.233.0 samples/sample30.rb
green_shoes-0.227.0 samples/sample30.rb
green_shoes-0.226.0 samples/sample30.rb
green_shoes-0.221.0 samples/sample30.rb
green_shoes-0.214.0 samples/sample30.rb
green_shoes-0.207.0 samples/sample30.rb
green_shoes-0.201.0 samples/sample30.rb
green_shoes-0.198.0 samples/sample30.rb
green_shoes-0.189.0 samples/sample30.rb
green_shoes-0.179.0 samples/sample30.rb
green_shoes-0.176.0 samples/sample30.rb