From: D T Date: 2003-06-18T23:36:47+09:00 Subject: Re: Tk canvas widget Id's --0-462203786-1055947005=:68364 Content-Type: text/plain; charset=us-ascii Hi John, q = w.find_withtag 'current' q will hold an array object, because it can be many objects associate to the same 'tag', even there is only one like 'current'. The find_withtag always return an array object. q.id # you are calling array's id method, not Tk's method. q[0].id # this should work in your case. Dave John Fletcher wrote: q = w.find_withtag 'current' puts q # Gives the same object address as for the item previously puts q.id # This gives garbage which changes. Is there something else wrong? John --------------------------------- Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! --0-462203786-1055947005=:68364 Content-Type: text/html; charset=us-ascii
Hi John,
 
q = w.find_withtag 'current'
q will hold an array object, because it can be many objects associate
to the same 'tag', even there is only one like 'current'.
The find_withtag always return an array object.
q.id # you are calling array's id method, not Tk's method.
q[0].id # this should work in your case.
 
Dave

John Fletcher <J.P.Fletcher@aston.ac.uk> wrote:



q = w.find_withtag 'current'
puts q # Gives the same object address as for the item previously
puts q.id # This gives garbage which changes.

Is there something else wrong?

John


Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month! --0-462203786-1055947005=:68364--