1
2
3
4 """
5 Window provides access to the DOM model's global Window.
6 """
7
8 closingListeners = []
9 resizeListeners = []
10
11 from __pyjamas__ import JS, doc, wnd, get_main_frame
12 from pyjamas import Location
13
16
19
22
25
28
30 get_main_frame()._alert(txt)
31
34
35 -def prompt(msg, defaultReply=""):
36 return wnd().prompt(msg, defaultReply)
37
40
43
46
48 try:
49 return wnd().innerHeight
50 except:
51 return doc().body.clientHeight;
52
54 try:
55 return wnd().innerWidth
56 except:
57 return doc().body.clientWidth;
58
61
64
66 if doc().compatMode == 'CSS1Compat':
67 return doc().documentElement
68 return doc().body
69
73
74 location = None
75
81
84
85 -def open(url, name, features):
86 wnd().open(url, name, features)
87
89 doc().body.style.margin = size;
90
92 d = doc()
93 d.title = title
94
97
100
101
104
105
108
109
112
116
120
124
126 """ changes size to specified width and height
127 """
128 wnd().resizeTo(width, height)
129
131 """ changes size by specified width and height
132 """
133 wnd().resizeBy(width, height)
134
142
146
150
153
154 init()
155