ashbb / green_shoes

Green Shoes is one of the colorful Shoes written in pure Ruby.
Other
204 stars 37 forks source link

Some elements stays in the window when switching url #86

Open duanshiqiang opened 9 years ago

duanshiqiang commented 9 years ago

Elements like progress won't disappear when switching url inside an app. Images with move method called will also stick there.

Currently what I do to circumvent this issue is move these kind of elements to a hidden coordination which is very ugly.

Code:

require "green_shoes"

class Test < Shoes
    url '/',        :home
    url '/page1',   :page1
    def home
        stack :width => 400, :height => 100 do
            progress
        end
        stack :width => 400, :height => 200 do
            button "Next" do
                visit "/page1"
            end
        end
    end
    def page1
        para "This is page1"
    end 
end

Shoes.app :width => 400, :height => 300, :title => "My test App"

My ugly way to remove the element:

require "green_shoes"

class Test < Shoes
    url '/',        :home
    url '/page1',   :page1
    def home
        stack :width => 400, :height => 100 do
            @p = progress
        end
        stack :width => 400, :height => 200 do
            button "Next" do
                @p.move 0, -200
                visit "/page1"
            end
        end
    end
    def page1
        para "This is page1"
    end 
end

Shoes.app :width => 400, :height => 300, :title => "My test App"
duanshiqiang commented 9 years ago

Currently I am investigating Green Shoes to build a install wizard like app which serves like an installer for our product. The app is basically a multi-page app that gathers some input from user and then call an external script to trigger the actual installation process.

So elements like progress that are stick to the window is very annoying...