require 'tk' c = TkCanvas.new.pack c.bind( 'B1-Motion', proc{|x, y| elongate_line( c, x, y ) }, "%x %y" ) def elongate_line( c, x, y ) c.coords('line', 30, 30, x, y ) end TkcLine.new(c, 30, 30, 50, 30, 'width'=>2 ).addtag('line') Tk.mainloop