From: Joel VanderWerf Date: 2007-10-12T13:31:32+09:00 Subject: Re: ruby tk drawing a line Ed Redman wrote: > I have a question concerning ruby/tk and drawing lines on a canvas. > I tried to convert from a tcl program. > Everything works fine except that the line when its thickness is large > appears to be a series of short line segments rather than a solid line. > > I have binded the "1" mouse button to start the line with the following > > canvas.bind( '1', proc { |e| > > $startx = e.x > $starty = e.y > > }) > > and the motion of the mouse > > canvas.bind('B1-Motion', proc { |e| > $endx = e.x > $endy = e.y > > $a = TkcLine.new(canvas, $startx, $starty, $endx, $endy) > $a.width option.value > $a.fill "#{color}" > }) > > Can anyone see why this does not give me a solid line Does the same thing happen without the fill param? A TkcLine has a "dash" parameter, and that might be causing this. But it would be surprising if the default is a dashed line. Anyway, you could try $a.dash "" or $a.dash nil See http://www.tcl.tk/man/tcl8.4/TkCmd/canvas.htm#M27 for details. -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407