The following block of code creates a button as a window item on a canvas and then binds button 3 to allow moving the item. Button 3 grabs the item and begins to move it, but the button jumps back and forth with even the tiniest of movement. It's almost as if the mouse is moving backwards as many steps as it goes forwards, but that's not the case. In any case, the button appears to jiggle all around the screen, which is cool if that's what you're going for. It's not in my case.

Can someone tell me what's going on here?

 pack [canvas .c] -expand 1 -fill both
 button .b -text "Test Button"

 set i [.c create window 100 100 -window .b]

 bind .b <3> {set x %x; set y %y}
 bind .b <B3-Motion> "
    set ix \[expr %x - \$x]
    set iy \[expr %y - \$y]
    .c move $i \$ix \$iy
    set x %x
    set y %y
 "