[fxruby-users] how to change a button's text one by one

Lyle Johnson lyle at lylejohnson.name
Sat Nov 1 19:29:55 EDT 2008

On Nov 1, 2008, at 5:12 PM, chen li wrote:

> I create 3 buttons.  If I click @button_start , at button_word will  
> change its text one by one based on an array. If I click @button_end  
> the program will end. My problem here is that  the word on  
> @button_word doesn't change one by one, instead they all show up at  
> the same time.

Your definition of "slice" is an array containing one element:

	slice = %w{A,B,C,D,E}

This evaluates to an array with one element, whose value is the string  
"A,B,C,D,E". I think what you're going for is:

	slice = %w{A B C D E}

or just:

	slice = ["A", "B", "C", "D", "E"]

Hope this helps,


More information about the fxruby-users mailing list