(Canvas.py): Added definition of CanvasItem.cget() as suggested by

Nils Fischbeck.
This commit is contained in:
Fred Drake 1996-09-26 20:21:26 +00:00
parent a1560cfb29
commit e9c515adc7
2 changed files with 2 additions and 0 deletions

View File

@ -22,6 +22,7 @@ class CanvasItem:
self.canvas._w, 'itemconfigure', self.canvas._w, 'itemconfigure',
self.id, '-' + key)) self.id, '-' + key))
return v[4] return v[4]
cget = __getitem__
def __setitem__(self, key, value): def __setitem__(self, key, value):
self.canvas.itemconfig(self.id, {key: value}) self.canvas.itemconfig(self.id, {key: value})
def keys(self): def keys(self):

View File

@ -22,6 +22,7 @@ class CanvasItem:
self.canvas._w, 'itemconfigure', self.canvas._w, 'itemconfigure',
self.id, '-' + key)) self.id, '-' + key))
return v[4] return v[4]
cget = __getitem__
def __setitem__(self, key, value): def __setitem__(self, key, value):
self.canvas.itemconfig(self.id, {key: value}) self.canvas.itemconfig(self.id, {key: value})
def keys(self): def keys(self):