| 239 | other.setindex(here) |
| 240 | |
| 241 | def setindex(self, index): |
| 242 | nsteps = steps(self.index, index) |
| 243 | if not nsteps: return |
| 244 | if self.array.speed == "fastest": |
| 245 | nsteps = 0 |
| 246 | oldpts = self.position() |
| 247 | self.index = index |
| 248 | newpts = self.position() |
| 249 | trajectory = interpolate(oldpts, newpts, nsteps) |
| 250 | self.canvas.tag_raise(self.item_id) |
| 251 | for pts in trajectory: |
| 252 | self.canvas.coords(self.item_id, pts) |
| 253 | self.array.wait(50) |
| 254 | |
| 255 | def swapwith(self, other): |
| 256 | nsteps = steps(self.index, other.index) |