Re: links in ur windoze

2008-11-14 Thread _why
On Mon, Nov 10, 2008 at 11:14:46PM -0600, Josh Cronemeyer wrote:
 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

Okay, this is great.  I think I've got a way around this that's much
better now.  You can do `window /cleveland` to open the window a
specific url.

So, your new methods will go like this:

  def index
para link(go to cleveland) { window /cleveland }
  end

  def cleveland
para link(go to neverland, :click = /neverland)
  end

  def neverland
para cherries, syrup, puppies
  end

I think I'm also going to start doing:

  Shoes.app Bummer/cleveland, :title = bummer

_why


Re: links in ur windoze

2008-11-12 Thread Josh Cronemeyer
I think you misunderstood  I want the child window to go to neverland.
I want url navigation to work inside the child windows.

-j

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

 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



Re: links in ur windoze

2008-11-12 Thread Seth Thomas Rasmussen
On Wed, Nov 12, 2008 at 2:47 PM, Josh Cronemeyer
[EMAIL PROTECTED] wrote:
 I think you misunderstood  I want the child window to go to neverland.
 I want url navigation to work inside the child windows.

Ah, whoops. I was thinking of your example from this thread using
$main to get the top level window to visit neverland.

So, maybe a patch for window() that resulted in its spawn sharing
actions of the parent would be nice?

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


Re: links in ur windoze

2008-11-12 Thread Josh Cronemeyer
I think that the navigation should work everywhere, so if i am in a window
and i have link(click me, :click = /) My window should go to /.  It
might be nice if you could do owner.link(click me, :click = /) instead
of passing the block with owner.visit... but not a huge deal.

so, uh yea. a patch would be nice :)
On Wed, Nov 12, 2008 at 2:34 PM, Seth Thomas Rasmussen 
[EMAIL PROTECTED] wrote:

 On Wed, Nov 12, 2008 at 2:47 PM, Josh Cronemeyer
 [EMAIL PROTECTED] wrote:
  I think you misunderstood  I want the child window to go to
 neverland.
  I want url navigation to work inside the child windows.

 Ah, whoops. I was thinking of your example from this thread using
 $main to get the top level window to visit neverland.

 So, maybe a patch for window() that resulted in its spawn sharing
 actions of the parent would be nice?

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



Re: links in ur windoze

2008-11-11 Thread Satoshi Asakawa
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



Re: links in ur windoze

2008-11-11 Thread Josh Cronemeyer
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





Re: links in ur windoze

2008-11-11 Thread Seth Thomas Rasmussen
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


links in ur windoze

2008-11-10 Thread Josh Cronemeyer
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


Re: links in ur windoze

2008-11-10 Thread Josh Cronemeyer
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