tuikit/window.py
changeset 41 37b7dfc3eae6
parent 40 5faa38c10b67
child 45 43b2279b06e1
--- a/tuikit/window.py	Wed Dec 26 01:00:31 2012 +0100
+++ b/tuikit/window.py	Sat Dec 29 12:16:06 2012 +0100
@@ -55,24 +55,24 @@
         self.closebtn.hidden = not value
 
 
-    def _handle_draw(self, screen, x, y):
-        super()._handle_draw(screen, x, y)
-        screen.pushcolor('normal')
-        screen.frame(x, y, self.width, self.height)
+    def _handle_draw(self, ev):
+        super()._handle_draw(ev)
+        ev.driver.pushcolor('normal')
+        ev.driver.frame(ev.x, ev.y, self.width, self.height)
 
         if self.resizable:
             if self.resizing:
-                screen.pushcolor('controls-active')
+                ev.driver.pushcolor('controls-active')
             else:
-                screen.pushcolor('controls')
-            screen.puts(x + self.width - 2, y + self.height - 1, '─┘') # '━┛'
-            screen.popcolor()
+                ev.driver.pushcolor('controls')
+            ev.driver.puts(ev.x + self.width - 2, ev.y + self.height - 1, '─┘') # '━┛'
+            ev.driver.popcolor()
 
         if self.title:
-            screen.puts(x + (self.width - len(self.title))//2, y, self.title)
+            ev.driver.puts(ev.x + (self.width - len(self.title))//2, ev.y, self.title)
 
-        screen.fill(x+1, y+1, self.width-2, self.height-2)
-        screen.popcolor()
+        ev.driver.fill(ev.x+1, ev.y+1, self.width-2, self.height-2)
+        ev.driver.popcolor()
 
 
     def _handle_mousedown(self, ev):
@@ -131,12 +131,11 @@
         self.redraw(True)
 
 
-    def _handle_resize(self):
-        super()._handle_resize()
+    def _handle_resize(self, ev):
+        super()._handle_resize(ev)
         self.closebtn.x = self.width - 5
 
 
-    def on_closebtn_click(self):
+    def on_closebtn_click(self, ev):
         self.hide()
 
-