mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 05:31:20 +00:00 
			
		
		
		
	Do nothing when loading the same dict as before.
This commit is contained in:
		
							parent
							
								
									adfe773d2c
								
							
						
					
					
						commit
						179c36e411
					
				
					 1 changed files with 6 additions and 1 deletions
				
			
		|  | @ -199,7 +199,6 @@ def __init__(self, master, title, dict=None): | ||||||
|             height = 20*len(dict) # XXX 20 == observed height of Entry widget |             height = 20*len(dict) # XXX 20 == observed height of Entry widget | ||||||
|         self.master = master |         self.master = master | ||||||
|         self.title = title |         self.title = title | ||||||
|         self.dict = dict |  | ||||||
|         self.repr = Repr() |         self.repr = Repr() | ||||||
|         self.repr.maxstring = 60 |         self.repr.maxstring = 60 | ||||||
|         self.repr.maxother = 60 |         self.repr.maxother = 60 | ||||||
|  | @ -219,11 +218,16 @@ def __init__(self, master, title, dict=None): | ||||||
|         self.sfid = canvas.create_window(0, 0, window=subframe, anchor="nw") |         self.sfid = canvas.create_window(0, 0, window=subframe, anchor="nw") | ||||||
|         self.load_dict(dict) |         self.load_dict(dict) | ||||||
|      |      | ||||||
|  |     dict = -1 | ||||||
|  |      | ||||||
|     def load_dict(self, dict): |     def load_dict(self, dict): | ||||||
|  |         if dict is self.dict: | ||||||
|  |             return | ||||||
|         subframe = self.subframe |         subframe = self.subframe | ||||||
|         frame = self.frame |         frame = self.frame | ||||||
|         for c in subframe.children.values(): |         for c in subframe.children.values(): | ||||||
|             c.destroy() |             c.destroy() | ||||||
|  |         self.dict = None | ||||||
|         if not dict: |         if not dict: | ||||||
|             l = Label(subframe, text="None") |             l = Label(subframe, text="None") | ||||||
|             l.grid(row=0, column=0) |             l.grid(row=0, column=0) | ||||||
|  | @ -242,6 +246,7 @@ def load_dict(self, dict): | ||||||
|     ##            l["state"] = "disabled" |     ##            l["state"] = "disabled" | ||||||
|                 l.grid(row=row, column=1, sticky="nw") |                 l.grid(row=row, column=1, sticky="nw") | ||||||
|                 row = row+1 |                 row = row+1 | ||||||
|  |         self.dict = dict | ||||||
|         # XXX Could we use a <Configure> callback for the following? |         # XXX Could we use a <Configure> callback for the following? | ||||||
|         subframe.update_idletasks() # Alas! |         subframe.update_idletasks() # Alas! | ||||||
|         width = subframe.winfo_reqwidth() |         width = subframe.winfo_reqwidth() | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Guido van Rossum
						Guido van Rossum