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.
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. But Hey! This
seems like a pretty unplesant way of doing this. When self gets replaced
inside the window block, why can't the navigation stuff get put on that
object so i can simply link to a url like a normal guy? Or if I want to
change the location of the parent window via a link on the child, it makes
sense to me that something like parent.visit("/neverland") would be the way
to go. lambda!? $main!? I feel like I need a shoes secret decoder ring in
order to use multiple windows. Plus, what if I want to do something non
trivial when the link is clicked? Now I am going to have a huge honkin
lambda block. Forget about code re-use too because everything has to be
right there in your lambda. I dunno, it makes me feel so inhibited.
Once again, maybe I'm missing something though, so please feel free to
enlightnen me or lower my expectations or something.
On Mon, Nov 10, 2008 at 11:47 PM, Josh Cronemeyer <
[EMAIL PROTECTED]> wrote:
> drat! The subject of my email should have been "never neverland"
>
>
> On Mon, Nov 10, 2008 at 11:14 PM, Josh Cronemeyer <
> [EMAIL PROTECTED]> wrote:
>
>> Perhaps I am doing something wrong. My app spawns a window with a link in
>> it, but I can't get the link to work. Here is some code that demonstrates
>> my problem. Essentially you can never get to neverland in this application.
>>
>> #!/usr/bin/env open -a Shoes.app
>>
>> 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"
>>
>>
>