From: sabbyxtabby@... (Sabby and Tabby) Date: 2003-03-28T21:39:00+09:00 Subject: Re: i++ "daniel" wrote: > i=0 > arr_stuff.each { > |a| > $tk_listbox_stuff.insert( i, a.to_s) > i += 1 > } Avoiding the question of i++, a common idiom (if a google search for "ruby tklistbox" is any indication) would be: arr_stuff.each { |a| $tk_listbox_stuff.insert('end', a.to_s) } But even that seems unnecessarily verbose. According to the Perl/Tk documentation (there doesn't seem to be any Ruby/Tk documentation, but Programming Ruby suggests Perl/Tk as an alternative) the #insert method should be able to insert multiple items: $tk_listbox_stuff.insert('end', *arr_stuff) Note that the above is untested (no Tk here) and that it also omits an explicit #to_s on the array elements (a peek at tk.rb shows that Ruby objects are automatically converted to Tcl strings). -- Tabby