add keyword args to CanvasItem class __init__

This commit is contained in:
Guido van Rossum 1996-01-26 17:45:07 +00:00
parent 15c4fecffc
commit efa3143abd
2 changed files with 6 additions and 6 deletions

View File

@ -1,14 +1,14 @@
# This module exports classes for the various canvas item types
from Tkinter import Canvas, _isfunctype, _flatten
from Tkinter import Canvas, _flatten
StringType = type('')
DictionaryType = type({})
class CanvasItem:
def __init__(self, canvas, itemType, *args):
def __init__(self, canvas, itemType, *args, **kw):
self.canvas = canvas
self.id = canvas._create(itemType, args)
self.id = canvas._create(itemType, args, kw)
if not hasattr(canvas, 'items'):
canvas.items = {}
canvas.items[self.id] = self

View File

@ -1,14 +1,14 @@
# This module exports classes for the various canvas item types
from Tkinter import Canvas, _isfunctype, _flatten
from Tkinter import Canvas, _flatten
StringType = type('')
DictionaryType = type({})
class CanvasItem:
def __init__(self, canvas, itemType, *args):
def __init__(self, canvas, itemType, *args, **kw):
self.canvas = canvas
self.id = canvas._create(itemType, args)
self.id = canvas._create(itemType, args, kw)
if not hasattr(canvas, 'items'):
canvas.items = {}
canvas.items[self.id] = self