(self, shapeIndex)
| 2572 | self._setshape(shapeIndex) |
| 2573 | |
| 2574 | def _setshape(self, shapeIndex): |
| 2575 | screen = self.screen |
| 2576 | self.shapeIndex = shapeIndex |
| 2577 | if self._type == "polygon" == screen._shapes[shapeIndex]._type: |
| 2578 | return |
| 2579 | if self._type == "image" == screen._shapes[shapeIndex]._type: |
| 2580 | return |
| 2581 | if self._type in ["image", "polygon"]: |
| 2582 | screen._delete(self._item) |
| 2583 | elif self._type == "compound": |
| 2584 | for item in self._item: |
| 2585 | screen._delete(item) |
| 2586 | self._type = screen._shapes[shapeIndex]._type |
| 2587 | if self._type == "polygon": |
| 2588 | self._item = screen._createpoly() |
| 2589 | elif self._type == "image": |
| 2590 | self._item = screen._createimage(screen._shapes["blank"]._data) |
| 2591 | elif self._type == "compound": |
| 2592 | self._item = [screen._createpoly() for item in |
| 2593 | screen._shapes[shapeIndex]._data] |
| 2594 | |
| 2595 | |
| 2596 | class RawTurtle(TPen, TNavigator): |
no test coverage detected