Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I don't think you can do this in wxPython alone. <a href="http://wxpython.org/docs/api/wx.Window-class.html#WarpPointer" rel="nofollow">wx.Window.WarpPointer()</a> can only move the mouse to an area controlled by that window, as you've discovered. Similarly, you're <code>wx.EVT_LEFT_DOWN</code> call won't work because you're setting the ID to the window, meaning it's the window that was clicked, not a click at (x,y).</p> <p>After some light Googling and I found <a href="http://wiki.wxpython.org/Unit%20Testing%20with%20wxPython" rel="nofollow">this article on Unit Testing in wxPython</a> that breifly talks about testing at the GUI level. This isn't exactly what you're trying to do, but it is conceptually similiar. They suggest using an external library to manipulate the interface. The main problem they note about this approach is that most of the tools for simulation GUI interaction are under corporate licenses and/or platform dependent.</p> <p>That article suggests using <a href="http://code.google.com/p/pywinauto/" rel="nofollow">pywinauto</a> for Windows systems. For your purposes, <a href="http://pywinauto.googlecode.com/hg/pywinauto/docs/code/pywinauto.controls.HwndWrapper.html" rel="nofollow">pywinauto.controls.HwndWrapper</a> seems to have the methods you require; <code>MoveMouse()</code> and <code>Click()</code>. If you aren't using Windows or if you need cross-platform support you will need to research different libraries.</p> <p>Basically, you will need to install and import pywinauto into your wxPython application and call its methods instead of wxPython's. As long as cross-platform compatibility is not an issue I think this is your simplest, best solution.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload