I did not understand how to change the text on an existing button. I suspect this is not yet supported. You can create a new button and replace the old one. Unfortunately, at least on Windows, deleting a button combines all click events. I have not tried this on another platform, but maybe it will work. Try something like this:
Shoes.app do
para 'This is some text.'
@btn = button 'a' do |btn|
alert 'Hello, World!'
end
para 'Blah blah blah'
button 'Change!' do |btn|
old = @btn
new_style = old.style.dup
txt = new_style[:text].next!
old.parent.before(old) do
@btn = button txt, new_style
end
old.remove
end
end
Pesto source
share