On Tue, Nov 11, 2008 at 1:43 PM, Josh Cronemeyer
<[EMAIL PROTECTED]> wrote:
> My takeaway from this thread is that shoes treats child windows more like
> red headed stepchild windows :)  Url navigation from a child window requires
> some acrobatics.  One thing you can't do it seems is to put a link on a
> child page that goes to a place defined on the parent.  For example in the
> following code getting the child window to go to neverland cant happen,
> right?
>
> #!/usr/bin/env open -a Shoes.app
> class Bummer < Shoes
>   url "/", :index
>   url "/cleveland", :cleveland
>   url "/neverland", :neverland
>
>   def index
>     stack do
>       para link("go to cleveland", :click => "/cleveland")
>     end
>   end
>
>   def cleveland
>     window :title => "cleveland", :width =>200, :height=>200 do
>       stack do
>         para link("go to neverland", :click => "/neverland")
>       end
>     end
>     visit "/"
>   end
>
>   def neverland
>     para "cherries, syrup, puppies"
>   end
> end
>
> Shoes.app :title => "bummer"
>
> I suppose not doing much with multiple windows follows from the decision to
> make shoes 'web-like'.  Anyway, thanks for all the multi window tips and
> tricks.  I'm sure they will come in handy, but in the end I think that
> because of the way url and link work I'm stuck just using one window for url
> style navigation.

class RTFM < Shoes
  url "/", :index
  url "/cleveland", :cleveland
  url "/neverland", :neverland

  def index
    para link("go to cleveland", :click => "/cleveland")
  end

  def cleveland
    window :title => "cleveland" do
      para(link("go to neverland") { owner.visit "/neverland" })
    end
    visit "/"
  end

  def neverland
    para link("http://article.gmane.org/gmane.comp.lib.shoes/2441";,
      :click => "http://article.gmane.org/gmane.comp.lib.shoes/2441";)
  end
end

Shoes.app

-- 
Seth Thomas Rasmussen
http://greatseth.com

Reply via email to