When I click on a slot, I change the contents of the slot to provide feedback to the user, and then call the code, which takes a few seconds. However, changes to the slot are not displayed until the "slow" process is completed. Is there a way I can make the rendering happen before the "slow" code is executed.
In the following example, the user never sees "Processing, please wait ..."
class MyTest < Shoes
url '/', :index
url '/result', :result
def index
stack do
my_button=flow do
image './assets/trees.jpg'
para 'Process Image'
end
my_button.click do
my_button.contents[0].hide
my_button.contents[1].text="Processing, please wait ..."
sleep(4)
visit '/result'
end
end
end
def result
stack do
para "Finished processing"
end
end
end
Shoes.app
Looking through the source code for Shoes in ruby.c or canvas.c, there are links to redrawing or paint. Can they be called out of shoes?
Thank you in advance
Tony sutton
source
share