diff pyntnclick/widgets/base.py @ 652:b8cc0be3a819 pyntnclick

Items!
author Jeremy Thurgood <firxen@gmail.com>
date Sun, 12 Feb 2012 12:55:03 +0200
parents fdc63049b08c
children fe7023750b20
line wrap: on
line diff
--- a/pyntnclick/widgets/base.py	Sun Feb 12 12:47:30 2012 +0200
+++ b/pyntnclick/widgets/base.py	Sun Feb 12 12:55:03 2012 +0200
@@ -57,6 +57,10 @@
             if hasattr(self, 'prepare'):
                 self.prepare()
 
+    def global_to_local(self, pos):
+        x, y = pos
+        return (x - self.rect.left, y - self.rect.top)
+
 
 class Button(Widget):