[fxruby-users] update question

chen li chen_li3 at yahoo.com
Wed Jan 7 18:48:34 EST 2009


Hi all,

I want to  update the text of a radio button with each element from an array. I try two methods a) and b). Method a) is working but b) isn't. What do I do wrong about method b)?  What is the rubyist way to update the text of a button?

Thanks,

Li

############method a ##########

def press_next
	
	@all=("1".."100").to_a

	@button_next.connect(SEL_COMMAND) do
		@all.each do |e|
                            ###app.addTimeout(1*1000){@radio1.text=e}
			@radio1.text=e
			100.times{app.runOneEvent;sleep 0.01}
		end
	end
end


##########method b##################

def press_next
	
	@all=("1".."100").to_a

	@button_next.connect(SEL_COMMAND) do
		@all.each do |e|
			app.addTimeout(1*1000){@radio1.text=e}
			###@radio1.text=e
			###100.times{app.runOneEvent;sleep 0.01}
		end
	end
end





      


More information about the fxruby-users mailing list