From: Edward Redman Date: 2008-07-15T10:45:28+09:00 Subject: Re: shoes toolket On Mon, 14 Jul 2008 23:05:18 +0000, Edward Redman wrote: > I have been trying to write a few programs with shoes. I am wondering if > there is a way to change the background from within a button. > > I have tried something like the following but it does not work. > > Shoes.app 'change' do > > button 'quit' do > exit > end > > button 'change' do > background 'rgb(200,0,0)' > end > end > > It should be quite easy I just am not clear on the syntax. > > thanks I have figured it out. it is not that I had it wrong. Just that the background was not refreshed. by adding "self.show ". It now refreshes itself here is the program as it stands. Shoes.app do background 'rgb(0, 0, 220)' line 10,10,300,300 flow do quit = button "quit" do exit end button "change" do color1 = rgb(rand(255),rand(255),rand(255)) background color1 self.show end button "change2" do color2 = ask_color("Give me the Color") puts color2.class background color2 self.show end end end