]> granicus.if.org Git - python/commitdiff
Vladimir Marangozov's patch:
authorGuido van Rossum <guido@python.org>
Tue, 12 Jan 1999 22:09:18 +0000 (22:09 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 12 Jan 1999 22:09:18 +0000 (22:09 +0000)
The separator dances too much and seems to jump by arbitrary amounts
in arbitrary directions when I try to move it for resizing the frames.
This patch makes it more quiet.

Tools/idle/Separator.py

index 26cdf6c791069ba8ad1ee7099c962e71034d3d7f..2645e57a37e4c5d6e9070f2c9a8ee843fc7006b6 100644 (file)
@@ -45,6 +45,7 @@ class Separator:
                 f[dim] = getattr(f, "winfo_"+dim)()
         self.div.bind("<Motion>", self.div_motion)
         self.div.bind("<ButtonRelease-1>", self.div_release)
+        self.div.grab_set()
 
     def div_motion(self, event):
         delta = getattr(event, self.dir) - getattr(self.press_event, self.dir)
@@ -61,6 +62,7 @@ class Separator:
     def div_release(self, event):
         self.div_motion(event)
         self.div.unbind("<Motion>")
+        self.div.grab_release()
 
 class VSeparator(Separator):
 
@@ -84,6 +86,7 @@ def main():
             tlist.append(t)
     tlist[0].insert("1.0", "Make your own Mondrian!")
     tlist[1].insert("1.0", "Move the colored dividers...")
+    root.mainloop()
 
 if __name__ == '__main__':
     main()