Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
68 lines (51 sloc) 1.49 KB

Nos. 2 & 3: stack and flow

At first, please read the following web page: http://github.com/shoes/shoes/wikis/stacksandflows

Note Instead of using the code from the above document which uses the deprecated Shoes#text method, please run the following sample code (and keep in mind to change the path to the image file):

# sample3.rb
Shoes.app do
  stack do
    image "http://www.rin-shun.com/shoes/hackety-org-header.png"
  end
  stack :width => 200 do
    para "column 1"
  end
  stack :width => -200 do
    para "column 2"
  end
end

sample3.png

sample3.png

A more complex example:

# sample4.rb
Shoes.app :width => 250, :height => 150 do
  background gray
  flow :width => "90%" do
    background brown
    
    flow :width => "70%" do
      background purple
      stack do
        background green
        para "stack 0"
      end
      stack :width => "30%" do
        background red
        para "stack 1"
      end
      stack :width => "-30%" do
        background blue
        para "stack 2"
      end
    end
    
    stack :width => "20%" do
      background yellow
      para "stack 3"
    end
  end
end

sample4.png

sample4.png

Policeman

The sample3.rb and sample4.rb worked well with Shoes-0.r1263