Mercurial > code > home > repos > light9
comparison light8/uihelpers.py @ 68:57b3c454465a
result of 7.8.2002 run-through
author | dmcc |
---|---|
date | Wed, 10 Jul 2002 00:39:14 +0000 |
parents | 0bf7e664f913 |
children | ab0be21b549b |
comparison
equal
deleted
inserted
replaced
67:0bf7e664f913 | 68:57b3c454465a |
---|---|
2 | 2 |
3 from __future__ import nested_scopes | 3 from __future__ import nested_scopes |
4 from Tkinter import * | 4 from Tkinter import * |
5 from Tix import * | 5 from Tix import * |
6 from types import StringType | 6 from types import StringType |
7 | |
8 windowlocations = { | |
9 'sub' : '425x738+00+00', | |
10 'console' : '168x24+848+000', | |
11 'leveldisplay' : '144x340+870+400', | |
12 'cuefader' : '314x212+546+741', | |
13 'effect' : '24x24+0963+338', | |
14 'stage' : '823x683+117+030', | |
15 } | |
7 | 16 |
8 def make_frame(parent): | 17 def make_frame(parent): |
9 f = Frame(parent, bd=0) | 18 f = Frame(parent, bd=0) |
10 f.pack(side='left') | 19 f.pack(side='left') |
11 return f | 20 return f |
14 root.bind(key, func) | 23 root.bind(key, func) |
15 for w in root.winfo_children(): | 24 for w in root.winfo_children(): |
16 w.bind(key, func) | 25 w.bind(key, func) |
17 | 26 |
18 # def toplevelat(x,y,w=None,h=None): | 27 # def toplevelat(x,y,w=None,h=None): |
19 def toplevelat(name, windowpos): | 28 def toplevelat(name, windowpos=None): |
20 tl = Toplevel() | 29 tl = Toplevel() |
21 | 30 |
22 if name in windowpos: | 31 tl.wm_geometry(windowlocations[name]) |
23 tkname, geom = windowpos[name] | 32 |
24 tl.wm_geometry(geom) | 33 # if name in windowpos: |
25 windowpos[name] = str(tl), geom | 34 # tkname, geom = windowpos[name] |
26 else: | 35 # tl.wm_geometry(geom) |
27 windowpos[name] = str(tl), '+0+0' | 36 # windowpos[name] = str(tl), geom |
28 | 37 |
29 # if w and h: | 38 # if w and h: |
30 # tl.wm_geometry("%dx%d+%d+%d" % (w,h,x,y)) | 39 # tl.wm_geometry("%dx%d+%d+%d" % (w,h,x,y)) |
31 # else: | 40 # else: |
32 # tl.wm_geometry("+%d+%d" % (x,y)) | 41 # tl.wm_geometry("+%d+%d" % (x,y)) |