Hi all,

The following code crashes Shoes (r929) on OS X :

Shoes.app :width => 900, :height => 800 do
    def stk_for(crd)
        case crd
        when 1..10 : @small_stk
        when 11..20 : @big_stk
        end
    end
    def view_for(crd)
        @views[crd].remove if @views[crd]
        stk_for(crd).append do
            # The first line does not crash.
            # @views[crd] = stack
             @views[crd] = stack :width => 40, :height => 30
        end
        @views[crd]
    end
    def refresh(crd)
        view = view_for(crd)
        view.clear do
            para crd
        end
    end
    def refresh_all
        (1..20).each {|crd| refresh(crd)}
    end

    @cards = (1..20).to_a
    @views = {}

    @small_stk = stack :left => 20 ,:top => 10,:width => 300
    @big_stk =  stack :left => 50 ,:top => 10,:width => 300
    stack  :width => 100 do
        para ""
        button "Crash me !" do
            refresh_all
        end
    end
end

Curiously, if I do not specify the width of the slot in view_for, everything
works well. Any ideas ?

Reply via email to