Skip to content
This repository
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 46 lines (34 sloc) 1.12 kb

No. 9: Shoes.url

A Shoes "app" object is a single window running code from a Shoes URL. When you switch Shoes URLs, a new "app" object is created. From the user viewpoint, it behaves just like a web page.

# sample11.rb
class PhotoFrame < Shoes
  url '/', :index
  url '/loogink', :loogink
  url '/cy', :cy

  def index
    eval(['loogink', 'cy'][rand 2])
  end

  def loogink
    background tomato
    image '../images/loogink.png', :left => 70, :top => 10
    para "\n" * 3
    para strong 'She is Loogink. :)', :stroke => white
    para '->', link(strong('Cy'), :click => '/cy')
  end

  def cy
    background paleturquoise
    image '../images/cy.png', :left => 70, :top => 10
    para "\n" * 3
    para strong 'He is Cy. :)', :stroke => white
    para '  ->', link(strong('loogink'), :click => '/loogink')
  end
end

Shoes.app :width => 200, :height => 120, :title => 'Photo Frame'

sample11.png

sample11.png

Policeman

The sample11.rb worked well with Shoes-0.r1263

Something went wrong with that request. Please try again.