Sha256: 1638b035ce294792f377e212dc05fe185e5a10ea7893795c1e0e2c1dffbb3eed

Contents?: true

Size: 972 Bytes

Versions: 9

Compression:

Stored size: 972 Bytes

Contents

Shoes.app do
  background "#eee"
  @list = stack do
    para "Enter a URL to download:", :margin => [10, 8, 10, 0]
    flow :margin => 10 do
      @url = edit_line :width => -120
      button "Download", :width => 120 do
        @list.append do
          stack do
            background "#eee".."#ccd"
            stack :margin => 10 do
              dl = nil
              para @url.text, " [", link("cancel") { dl.abort }, "]", :margin => 0
              d = inscription "Beginning transfer.", :margin => 0
              p = progress :width => 1.0, :height => 14
              dl = download @url.text, :save => File.basename(@url.text),
                :progress => proc { |dl| 
                  d.text = "Transferred #{dl.transferred} of #{dl.length} bytes (#{dl.percent}%)"
                  p.fraction = dl.percent * 0.01 },
                :finish => proc { |dl| d.text = "Download completed" }
            end
          end
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 4 rubygems

Version Path
scarpe-0.4.0 examples/legacy/not_checked/shoes-contrib/simple/simple-downloader.rb
scarpe-0.3.0 examples/legacy/not_checked/shoes-contrib/simple/simple-downloader.rb
scarpe-0.2.2 examples/legacy/not_checked/shoes-contrib/simple/simple-downloader.rb
lacci-0.2.1 examples/legacy/not_checked/shoes-contrib/simple/simple-downloader.rb
scarpe-0.2.1 examples/legacy/not_checked/shoes-contrib/simple/simple-downloader.rb
scarpe-0.2.0 examples/legacy/not_checked/shoes-contrib/simple/simple-downloader.rb
shoes-3.0.1 samples/simple-downloader.rb
shoesgem-0.1514.0 shoes/samples/simple-downloader.rb
shoesgem-0.1424.0 shoes/samples/simple-downloader.rb