mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	add keyword args to CanvasItem class __init__
This commit is contained in:
		
							parent
							
								
									15c4fecffc
								
							
						
					
					
						commit
						efa3143abd
					
				
					 2 changed files with 6 additions and 6 deletions
				
			
		|  | @ -1,14 +1,14 @@ | ||||||
| # This module exports classes for the various canvas item types | # This module exports classes for the various canvas item types | ||||||
| 
 | 
 | ||||||
| from Tkinter import Canvas, _isfunctype, _flatten | from Tkinter import Canvas, _flatten | ||||||
| 
 | 
 | ||||||
| StringType = type('') | StringType = type('') | ||||||
| DictionaryType = type({}) | DictionaryType = type({}) | ||||||
| 
 | 
 | ||||||
| class CanvasItem: | class CanvasItem: | ||||||
| 	def __init__(self, canvas, itemType, *args): | 	def __init__(self, canvas, itemType, *args, **kw): | ||||||
| 		self.canvas = canvas | 		self.canvas = canvas | ||||||
| 		self.id = canvas._create(itemType, args) | 		self.id = canvas._create(itemType, args, kw) | ||||||
| 		if not hasattr(canvas, 'items'): | 		if not hasattr(canvas, 'items'): | ||||||
| 			canvas.items = {} | 			canvas.items = {} | ||||||
| 		canvas.items[self.id] = self | 		canvas.items[self.id] = self | ||||||
|  |  | ||||||
|  | @ -1,14 +1,14 @@ | ||||||
| # This module exports classes for the various canvas item types | # This module exports classes for the various canvas item types | ||||||
| 
 | 
 | ||||||
| from Tkinter import Canvas, _isfunctype, _flatten | from Tkinter import Canvas, _flatten | ||||||
| 
 | 
 | ||||||
| StringType = type('') | StringType = type('') | ||||||
| DictionaryType = type({}) | DictionaryType = type({}) | ||||||
| 
 | 
 | ||||||
| class CanvasItem: | class CanvasItem: | ||||||
| 	def __init__(self, canvas, itemType, *args): | 	def __init__(self, canvas, itemType, *args, **kw): | ||||||
| 		self.canvas = canvas | 		self.canvas = canvas | ||||||
| 		self.id = canvas._create(itemType, args) | 		self.id = canvas._create(itemType, args, kw) | ||||||
| 		if not hasattr(canvas, 'items'): | 		if not hasattr(canvas, 'items'): | ||||||
| 			canvas.items = {} | 			canvas.items = {} | ||||||
| 		canvas.items[self.id] = self | 		canvas.items[self.id] = self | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Guido van Rossum
						Guido van Rossum