From: David Tran Date: 2005-08-09T21:51:17+09:00 Subject: Re: Ruby/Tk core library desing question (TkCanvas#create) > No. That is the identifier of the canvas item. > TkCanvas#create method is used when you don't want to create > a ruby object for a canvas item (for example, you worry about > memory costs for many items). > And then, to configure the item, you have to use the identifier > (if you don't give canvas tags to the item). > You shouldn't assume that the return value is a number. > -- > Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp) I missunderstood the return value. require 'tk' c = TkCanvas.new.pack r = c.create(TkcRectangle, 10, 10, 50, 50) puts "r = #{r}; type = #{r.class}" c.itemconfigure(r, :fill=>:red) Tk.mainloop Got it now, even the r is Fixnum class, it is item identifier. So, later we can use it on itemconfigure to modify the item. Thank you.