Anonymous avatar Anonymous committed 9dd6f42

Do nothing when loading the same dict as before.

Comments (0)

Files changed (1)

Tools/idle/StackViewer.py

             height = 20*len(dict) # XXX 20 == observed height of Entry widget
         self.master = master
         self.title = title
-        self.dict = dict
         self.repr = Repr()
         self.repr.maxstring = 60
         self.repr.maxother = 60
         self.sfid = canvas.create_window(0, 0, window=subframe, anchor="nw")
         self.load_dict(dict)
     
+    dict = -1
+    
     def load_dict(self, dict):
+        if dict is self.dict:
+            return
         subframe = self.subframe
         frame = self.frame
         for c in subframe.children.values():
             c.destroy()
+        self.dict = None
         if not dict:
             l = Label(subframe, text="None")
             l.grid(row=0, column=0)
     ##            l["state"] = "disabled"
                 l.grid(row=row, column=1, sticky="nw")
                 row = row+1
+        self.dict = dict
         # XXX Could we use a <Configure> callback for the following?
         subframe.update_idletasks() # Alas!
         width = subframe.winfo_reqwidth()
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.