diff light8/uihelpers.py @ 67:0bf7e664f913

window pos saving
author dmcc
date Tue, 09 Jul 2002 09:27:47 +0000
parents 2508c6b7a4e0
children 57b3c454465a
line wrap: on
line diff
--- a/light8/uihelpers.py	Tue Jul 09 08:53:44 2002 +0000
+++ b/light8/uihelpers.py	Tue Jul 09 09:27:47 2002 +0000
@@ -15,12 +15,21 @@
     for w in root.winfo_children():
         w.bind(key, func)
 
-def toplevelat(x,y,w=None,h=None):
+# def toplevelat(x,y,w=None,h=None):
+def toplevelat(name, windowpos):
     tl = Toplevel()
-    if w and h:
-        tl.wm_geometry("%dx%d+%d+%d" % (w,h,x,y))
+
+    if name in windowpos:
+        tkname, geom = windowpos[name]
+        tl.wm_geometry(geom)
+        windowpos[name] = str(tl), geom
     else:
-        tl.wm_geometry("+%d+%d" % (x,y))
+        windowpos[name] = str(tl), '+0+0'
+
+    # if w and h:
+        # tl.wm_geometry("%dx%d+%d+%d" % (w,h,x,y))
+    # else:
+        # tl.wm_geometry("+%d+%d" % (x,y))
     return tl
 
 def toggle_slider(s):