Hi Josh,

Do you really need to open multiple windows?
If not, the following code works well.

class Bummer < 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", :click => "/neverland")
    #end
    #visit "/"
  end

  def neverland
    para "cherries, syrup, puppies"
  end
end

Shoes.app :title => "bummer"


But if you need to open multiple windows and send some messages between
them, the following sample might be of help.

http://github.com/ashbb/shoes_tutorial_html/tree/master/mdowns/00530_Open_a_new_app_window.mdown

Regards,
ashbb


On Wed, Nov 12, 2008 at 12:23 AM, Seth Thomas Rasmussen <
[EMAIL PROTECTED]> wrote:

> On Tue, Nov 11, 2008 at 8:14 AM, Josh Cronemeyer
> <[EMAIL PROTECTED]> wrote:
> > So i got this response from brian off-list
> >
> > <quoth brian>
> > While trying this, I found that I had to kill and re-open shoes to get it
> t
> > reload the changed .rb file,  don't know what's up with that.
>
> I dunno either, but I just do it now as a sort of rule. It's easy
> enough to do that I don't really care that it seems like a bug.
>
> > class Bummer < Shoes
> >   url "/", :index
> >   url "/cleveland", :cleveland
> >   url "/neverland", :neverland
> >
> >   def index
> >       stack do
> >         para link("rather, go to neverland", :click =>"/neverland")
> >         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 => lambda
> > {$main.visit("/neverland")})
> >         para link("go to crocodile", :click => lambda {clear ; para "tick
> > tock"})
> >       end
> >     end
> >     visit "/"
> >   end
> >
> >   def neverland
> >     para "cherries, syrup, puppies"
> >   end
> > end
> >
> > $main=Shoes.app :title => "bummer"
> > </quoth brian>
> >
> > and hey.  that works. woo. I had tried a proc, but not a lambda...  I
> guess
> > that makes some sense because of the app object weirdness.
>
> I don't think the difference between proc and lambda is significant
> here. It's the fact that your actions are only defined for the main
> app instance. window() creates a context that is basically a new
> instance of an app. I think you could achieve what you did with your
> dreaded global variable with Shoes owner() method.
>
> --
> Seth Thomas Rasmussen
> http://greatseth.com
>

Reply via email to