On clicking a slot , I change the contents of the slot to provide user feed back, then call some code which takes several seconds to run. However the changes to the slot do not render until after the 'slow' process has completed. Is there any way I can force the rendering to happen before the 'slow' code runs.
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) # Simulate slow process
visit '/result'
end
end
end
def result
stack do
para "Finished processing"
end
end
end
Shoes.app
Looking through Shoes source code in ruby.c or canvas.c there are references to a repaint or paint canvas. Are they callable from within shoes?
Thanks in advance