Skip to content
Snippets Groups Projects
Commit 0215c970 authored by Derrode Stéphane's avatar Derrode Stéphane :dromedary_camel:
Browse files

BE 15 - ajout methode setState

parent f31fb9d2
Branches
No related tags found
No related merge requests found
......@@ -13,10 +13,13 @@ class Forme:
self.x += dx
self.y += dy
def setState(self, s):
self.__canevas.itemconfig(self._item, state=s)
class Rectangle(Forme):
def __init__(self, canevas, x, y, l, h, couleur):
Forme.__init__(self, canevas, x, y)
self._item = canevas.create_rectangle(x, y, x+l, y+h, fill=couleur)
self._item = canevas.create_rectangle(x, y, x+l, y+h, fill=couleur, state="hidden")
self.__l = l
self.__h = h
......@@ -43,7 +46,7 @@ class Rectangle(Forme):
class Ellipse(Forme):
def __init__(self, canevas, x, y, rx, ry, couleur):
Forme.__init__(self, canevas, x, y)
self._item = canevas.create_oval(x-rx, y-ry, x+rx, y+ry, fill=couleur)
self._item = canevas.create_oval(x-rx, y-ry, x+rx, y+ry, fill=couleur, state="hidden")
self.__rx = rx
self.__ry = ry
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment