[SciPy-user] active window - scipy.xplt

Arnd Baecker arnd.baecker at web.de
Tue Jun 8 05:59:08 EDT 2004


On Fri, 4 Jun 2004, Horst Horstsen wrote:

> Hello,
>
> I've got a question concerning the scipy.xlpt - package:
>
> If I have two plot-windows how to find out which one is selected by the
> user? The user can click one or the other window with the mouse.
> I already know about the command window() but this only gives back the
> window I lastly selected in my programm (maybe a feature for oblivious
> programmers...).
>
> Thank you for help!
>
> Greetings by PHIL

As far as I know (please correct me!) this is not possible.
This is actually something which annoys me for
quite a while as well, so here is a simple example:

####################
from scipy.xplt import *

x=arange(0.0,1.0,0.1)
window(0)
plg(x,x)
window(1)
plg(x*x,x)
while 1:
    m=mouse(1,1,"Click with the mouse, finish with right-click")
    if m[9]==3: break
########################

Clicking in window 1 (the "active" one) the output of mouse
is as expected.
However, clicking in window 0 one gets the last coordinates
clicked in window 1, but no meaningful answer.

Dear scipy.xplt gurus:
Would it be possible to
 - return the right click-coordinates regardless of the
   "active" window
 - add mouse[11] as return parameter
   which contains the window number in which the user clicked
?
I think that this would be a very usefull feature!

Best,

Arnd




More information about the SciPy-User mailing list