October 12th, 2004, 02:23 PM
Simple wxPython Question
I've looked at a part of the wxPython demo which shows the position of the mouse when it is clicked, "Process and Events -> PythonEvents", and I'm confused about why it can't be simpler.
So I was wondering if anybody could show me the simplest code to show the position of the mouse when it is clicked somewhere.
October 12th, 2004, 04:39 PM
You can get the position of the mouse pointer at any time using wxGetMousePosition(). If you want to continuously display the coords then call this function at regular intervals.
You say you want to get the position of the mouse when it is clicked. If you mean when it is clicked on a control or window that you are handling yourself then it is easy - just call wxGetMousePosition() in the event handler.
If you want to catch click anywhere on the screen then I don't know if it is possible in wxPython.
Dave - The Developers' Coach