Add component to a shape of type compound. Arguments: poly is a polygon, i. e. a tuple of number pairs. fill is the fillcolor of the component, outline is the outline color of the component. call (for a Shapeobject namend s): -- s.addcomponent(((0,0), (10,
(self, poly, fill, outline=None)
| 790 | self._data = data |
| 791 | |
| 792 | def addcomponent(self, poly, fill, outline=None): |
| 793 | """Add component to a shape of type compound. |
| 794 | |
| 795 | Arguments: poly is a polygon, i. e. a tuple of number pairs. |
| 796 | fill is the fillcolor of the component, |
| 797 | outline is the outline color of the component. |
| 798 | |
| 799 | call (for a Shapeobject namend s): |
| 800 | -- s.addcomponent(((0,0), (10,10), (-10,10)), "red", "blue") |
| 801 | |
| 802 | Example: |
| 803 | >>> poly = ((0,0),(10,-5),(0,10),(-10,-5)) |
| 804 | >>> s = Shape("compound") |
| 805 | >>> s.addcomponent(poly, "red", "blue") |
| 806 | >>> # .. add more components and then use register_shape() |
| 807 | """ |
| 808 | if self._type != "compound": |
| 809 | raise TurtleGraphicsError("Cannot add component to %s Shape" |
| 810 | % self._type) |
| 811 | if outline is None: |
| 812 | outline = fill |
| 813 | self._data.append([poly, fill, outline]) |
| 814 | |
| 815 | |
| 816 | class Tbuffer(object): |
nothing calls this directly
no test coverage detected