mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	Issue #27611: Fixed support of default root window in the tkinter.tix module.
Added the master parameter in the DisplayStyle constructor.
This commit is contained in:
		
						commit
						1aca3899fb
					
				
					 2 changed files with 14 additions and 5 deletions
				
			
		|  | @ -472,11 +472,17 @@ class DisplayStyle: | ||||||
|     """DisplayStyle - handle configuration options shared by |     """DisplayStyle - handle configuration options shared by | ||||||
|     (multiple) Display Items""" |     (multiple) Display Items""" | ||||||
| 
 | 
 | ||||||
|     def __init__(self, itemtype, cnf={}, **kw): |     def __init__(self, itemtype, cnf={}, *, master=None, **kw): | ||||||
|         master = tkinter._default_root              # global from Tkinter |         if not master: | ||||||
|         if not master and 'refwindow' in cnf: master=cnf['refwindow'] |             if 'refwindow' in kw: | ||||||
|         elif not master and 'refwindow' in kw:  master= kw['refwindow'] |                 master = kw['refwindow'] | ||||||
|         elif not master: raise RuntimeError("Too early to create display style: no root window") |             elif 'refwindow' in cnf: | ||||||
|  |                 master = cnf['refwindow'] | ||||||
|  |             else: | ||||||
|  |                 master = tkinter._default_root | ||||||
|  |                 if not master: | ||||||
|  |                     raise RuntimeError("Too early to create display style: " | ||||||
|  |                                        "no root window") | ||||||
|         self.tk = master.tk |         self.tk = master.tk | ||||||
|         self.stylename = self.tk.call('tixDisplayStyle', itemtype, |         self.stylename = self.tk.call('tixDisplayStyle', itemtype, | ||||||
|                             *self._options(cnf,kw) ) |                             *self._options(cnf,kw) ) | ||||||
|  |  | ||||||
|  | @ -41,6 +41,9 @@ Core and Builtins | ||||||
| Library | Library | ||||||
| ------- | ------- | ||||||
| 
 | 
 | ||||||
|  | - Issue #27611: Fixed support of default root window in the tkinter.tix module. | ||||||
|  |   Added the master parameter in the DisplayStyle constructor. | ||||||
|  | 
 | ||||||
| - Issue #27348: In the traceback module, restore the formatting of exception | - Issue #27348: In the traceback module, restore the formatting of exception | ||||||
|   messages like "Exception: None".  This fixes a regression introduced in |   messages like "Exception: None".  This fixes a regression introduced in | ||||||
|   3.5a2. |   3.5a2. | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Serhiy Storchaka
						Serhiy Storchaka