tags:

views:

148

answers:

1

Hi,

I want to use shoes to be able to download the body of a website that a user enters in an edit_line. How can I make this work? Can anyone help explain why the below code does not work? It just pops up a new window, and does not download the site from the text entered....

Here's my code thus far:

Shoes.app do
  stack (:left => 175, :top => 200) do
    para "Enter a url:"
    flow do
      @url = edit_line
      button "OK" do

    window do
        stack do
         title "Searching site", :size => 16
          @status = para "One moment..."
          # Search site for query and print body
            download @url.text do |site|
              @status.text = "Body: " + site.response.body.inspect
            end
         end
       end
     end
   end
 end
 end
+1  A: 

Nevermind - I figured it out. I just didn't pop to a new window and it downloads and prints the body fine. : )

You should accept your answer, then, so that this question gets closed.
Pistos