]> granicus.if.org Git - python/commitdiff
Fixed ttedit to actually work
authorJack Jansen <jack.jansen@cwi.nl>
Thu, 11 Apr 1996 15:40:32 +0000 (15:40 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Thu, 11 Apr 1996 15:40:32 +0000 (15:40 +0000)
Fixed minor update bug in tlist

Mac/Lib/test/tlist.py
Mac/Lib/test/ttedit.py

index be46c267a2c31fc66300ae324d001cb622edd662..4dba121236e9f8831ffef9fb1673b1e3f76006d6 100644 (file)
@@ -19,20 +19,16 @@ class ListWindow(Window):
                r = (40, 40, 400, 300)
                w = Win.NewWindow(r, name, 1, 0, -1, 1, 0x55555555)
                r2 = (0, 0, 345, 245)
+               Qd.SetPort(w)
+               self.wid = w
                self.list = List.LNew(r2, (0, 0, 1, 1), (0,0), 0, w, 0, 1, 1, 1)
                self.filllist()
                w.DrawGrowIcon()
-               self.wid = w
                self.do_postopen()
                
        def do_activate(self, onoff, evt):
                self.list.LActivate(onoff)
 
-       def do_rawupdate(self, window, event):
-               window.BeginUpdate()
-               self.do_update(window, event)
-               window.EndUpdate()
-               
        def do_update(self, *args):
                self.list.LUpdate(self.wid.GetWindowPort().visRgn)
                
index 59e250d7636c0b2f595c16f0ae9ec9d705857ed1..a4cd7746af51216fc02c2c362314c17b242b425e 100644 (file)
@@ -19,6 +19,7 @@ class TEWindow(Window):
                r2 = (0, 0, 345, 245)
                Qd.SetPort(w)
                self.ted = TE.TENew(r2, r2)
+               self.ted.TEAutoView(1)
                w.DrawGrowIcon()
                self.wid = w
                self.do_postopen()
@@ -32,21 +33,16 @@ class TEWindow(Window):
                else:
                        self.ted.TEDeactivate()
 
-       def do_rawupdate(self, window, event):
-               window.BeginUpdate()
-               self.do_update(window, event)
-               window.EndUpdate()
-               
-       def do_update(self, *args):
-               Qd.EraseRect(self.wid.GetWindowPort().portRect)
-               self.ted.TEUpdate(self.wid.GetWindowPort().portRect)
+       def do_update(self, wid, event):
+               Qd.EraseRect(wid.GetWindowPort().portRect)
+               self.ted.TEUpdate(wid.GetWindowPort().portRect)
                
        def do_contentclick(self, local, modifiers, evt):
                shifted = (modifiers & 0x200)
                self.ted.TEClick(local, shifted)
 
        def do_char(self, ch, event):
-               self.ted.TEKey(ch)
+               self.ted.TEKey(ord(ch))
 
 class TestList(Application):
        def __init__(self):