Search code examples
pythonwxpythonwxwidgets

Get object at point? wxpython


Is it possible to get what object is at point (x,y) with wxpython?

buton=wx.Button(self, id=wx.ID_ANY, label='object',pos=(10,10), size=(175, 28))
print GetObjectAtPoint(10,10)   # this function does not exist

If there is anything similar to the above, that would be nice or if there is suggestions on what I should do. Or even, if there is anything such as GetObjectsInRange(x1,y1,x2,y2)


Solution

  • There is

    wx.FindWindowAtPoint(pt)

    Also

    GenericFindWindowAtPoint(pt)

    and

    FindWindowAtPointer()

    See http://www.wxpython.org/docs/api/