Mercurial > code > home > repos > light9
comparison light8/uihelpers.py @ 67:0bf7e664f913
window pos saving
author | dmcc |
---|---|
date | Tue, 09 Jul 2002 09:27:47 +0000 |
parents | 2508c6b7a4e0 |
children | 57b3c454465a |
comparison
equal
deleted
inserted
replaced
66:8b6befd8b97e | 67:0bf7e664f913 |
---|---|
13 def bindkeys(root,key, func): | 13 def bindkeys(root,key, func): |
14 root.bind(key, func) | 14 root.bind(key, func) |
15 for w in root.winfo_children(): | 15 for w in root.winfo_children(): |
16 w.bind(key, func) | 16 w.bind(key, func) |
17 | 17 |
18 def toplevelat(x,y,w=None,h=None): | 18 # def toplevelat(x,y,w=None,h=None): |
19 def toplevelat(name, windowpos): | |
19 tl = Toplevel() | 20 tl = Toplevel() |
20 if w and h: | 21 |
21 tl.wm_geometry("%dx%d+%d+%d" % (w,h,x,y)) | 22 if name in windowpos: |
23 tkname, geom = windowpos[name] | |
24 tl.wm_geometry(geom) | |
25 windowpos[name] = str(tl), geom | |
22 else: | 26 else: |
23 tl.wm_geometry("+%d+%d" % (x,y)) | 27 windowpos[name] = str(tl), '+0+0' |
28 | |
29 # if w and h: | |
30 # tl.wm_geometry("%dx%d+%d+%d" % (w,h,x,y)) | |
31 # else: | |
32 # tl.wm_geometry("+%d+%d" % (x,y)) | |
24 return tl | 33 return tl |
25 | 34 |
26 def toggle_slider(s): | 35 def toggle_slider(s): |
27 if s.get() == 0: | 36 if s.get() == 0: |
28 s.set(100) | 37 s.set(100) |