Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c9c0dd3

Browse files
committed
Fixed ttedit to actually work
Fixed minor update bug in tlist
1 parent cef2c59 commit c9c0dd3

2 files changed

Lines changed: 7 additions & 15 deletions

File tree

Mac/Lib/test/tlist.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,16 @@ def open(self, name, where):
1919
r = (40, 40, 400, 300)
2020
w = Win.NewWindow(r, name, 1, 0, -1, 1, 0x55555555)
2121
r2 = (0, 0, 345, 245)
22+
Qd.SetPort(w)
23+
self.wid = w
2224
self.list = List.LNew(r2, (0, 0, 1, 1), (0,0), 0, w, 0, 1, 1, 1)
2325
self.filllist()
2426
w.DrawGrowIcon()
25-
self.wid = w
2627
self.do_postopen()
2728

2829
def do_activate(self, onoff, evt):
2930
self.list.LActivate(onoff)
3031

31-
def do_rawupdate(self, window, event):
32-
window.BeginUpdate()
33-
self.do_update(window, event)
34-
window.EndUpdate()
35-
3632
def do_update(self, *args):
3733
self.list.LUpdate(self.wid.GetWindowPort().visRgn)
3834

Mac/Lib/test/ttedit.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ def open(self, name):
1919
r2 = (0, 0, 345, 245)
2020
Qd.SetPort(w)
2121
self.ted = TE.TENew(r2, r2)
22+
self.ted.TEAutoView(1)
2223
w.DrawGrowIcon()
2324
self.wid = w
2425
self.do_postopen()
@@ -32,21 +33,16 @@ def do_activate(self, onoff, evt):
3233
else:
3334
self.ted.TEDeactivate()
3435

35-
def do_rawupdate(self, window, event):
36-
window.BeginUpdate()
37-
self.do_update(window, event)
38-
window.EndUpdate()
39-
40-
def do_update(self, *args):
41-
Qd.EraseRect(self.wid.GetWindowPort().portRect)
42-
self.ted.TEUpdate(self.wid.GetWindowPort().portRect)
36+
def do_update(self, wid, event):
37+
Qd.EraseRect(wid.GetWindowPort().portRect)
38+
self.ted.TEUpdate(wid.GetWindowPort().portRect)
4339

4440
def do_contentclick(self, local, modifiers, evt):
4541
shifted = (modifiers & 0x200)
4642
self.ted.TEClick(local, shifted)
4743

4844
def do_char(self, ch, event):
49-
self.ted.TEKey(ch)
45+
self.ted.TEKey(ord(ch))
5046

5147
class TestList(Application):
5248
def __init__(self):

0 commit comments

Comments
 (0)