dabo Commit
Revision 3893
Date: 2008-01-21 19:15:43 -0800 (Mon, 21 Jan 2008)
Author: Ed
Trac: http://svn.dabodev.com/trac/dabo/changeset/3893
Changed:
U trunk/dabo/ui/uiwx/__init__.py
Log:
Added the 'getObjectAtPosition(x, y)' method. This accepts either x and y
params, or a single (x,y) tuple, and returns the object located under it using
absolute screen coordinates.
Diff:
Modified: trunk/dabo/ui/uiwx/__init__.py
===================================================================
--- trunk/dabo/ui/uiwx/__init__.py 2008-01-18 21:02:01 UTC (rev 3892)
+++ trunk/dabo/ui/uiwx/__init__.py 2008-01-22 03:15:43 UTC (rev 3893)
@@ -556,7 +556,16 @@
return win
+def getObjectAtPosition(x, y=None):
+ """Given a screen position, returns the object immediately under that
+ position, or None if there is no such object. You can pass separate
+ x,y coordinates, or an x,y tuple.
+ """
+ if y is None:
+ x, y = x
+ return wx.FindWindowAtPoint((x,y))
+
def isControlDown():
return wx.GetMouseState().controlDown
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/dabo-dev/[EMAIL PROTECTED]