12
Line.new($c, rand(400), rand(200), rand(400), rand(200))
18
Label.new('text'=>'Please press or drag button-1').pack
22
$start_x = start_y = 0
27
$current_line = Line.new($c, x, y, x, y)
32
$current_line.coords $start_x, $start_y, x, y
38
$current_line.coords $start_x, $start_y, x, y
39
$current_line.fill 'black'
44
$c.bind("1", proc{|e| do_press e.x, e.y})
45
$c.bind("B1-Motion", proc{|x, y| do_motion x, y}, "%x %y")
46
$c.bind("ButtonRelease-1", proc{|x, y| do_release x, y}, "%x %y")