2 # Draw a window in which the user can type.
4 # This test expects Win, Evt and FrameWork (and anything used by those)
7 # Actually, it is more a test of FrameWork by now....
9 from FrameWork
import *
15 class TEWindow(Window
):
17 r
= (40, 40, 400, 300)
18 w
= Win
.NewWindow(r
, name
, 1, 0, -1, 1, 0x55555555)
21 self
.ted
= TE
.TENew(r2
, r2
)
22 self
.ted
.TEAutoView(1)
30 def do_activate(self
, onoff
, evt
):
34 self
.ted
.TEDeactivate()
36 def do_update(self
, wid
, event
):
37 Qd
.EraseRect(wid
.GetWindowPort().portRect
)
38 self
.ted
.TEUpdate(wid
.GetWindowPort().portRect
)
40 def do_contentclick(self
, local
, modifiers
, evt
):
41 shifted
= (modifiers
& 0x200)
42 self
.ted
.TEClick(local
, shifted
)
44 def do_char(self
, ch
, event
):
45 self
.ted
.TEKey(ord(ch
))
47 class TestList(Application
):
49 Application
.__init
__(self
)
53 def makeusermenus(self
):
54 self
.filemenu
= m
= Menu(self
.menubar
, "File")
55 self
.newitem
= MenuItem(m
, "New window...", "O", self
.open)
56 self
.quititem
= MenuItem(m
, "Quit", "Q", self
.quit
)
58 def open(self
, *args
):
60 w
.open('Window %d'%self
.num
)
61 self
.num
= self
.num
+ 1
62 self
.listoflists
.append(w
)
64 def quit(self
, *args
):
67 def do_about(self
, id, item
, window
, event
):
68 EasyDialogs
.Message("""Test the TextEdit interface.
69 Simple window in which you can type""")
71 def do_idle(self
, *args
):
72 for l
in self
.listoflists
:
79 if __name__
== '__main__':