[Gambas-user] Ok, I'm stumped

Benoît Minisini gambas at ...1...
Fri Nov 27 17:55:23 CET 2009


> Gambas3
> 
> I have a GridView named gvOptions, and this code:
> 
> Public Sub gvOptions_Menu()
> 
>   Debug Mouse.X
>   Debug Mouse.Y
> 
> End
> 
> 1) Both Mouse.X and Mouse.Y tell me "no mouse event data"
> 
>     I need to capture the mouse position to pop up a window. How do I do
> that in g3?
> 

There is no mouse information for the Menu event. You can even raise this 
event without using the mouse, you know.

If you really need to know where is the mouse (but why?), you can use the 
Mouse.ScreenX and Mouse.ScreenY properties.

On X11, knowing where the mouse is may be expensive, when there is Internet 
between the mouse and the process receiving the events. So you get them when 
you have real mouse events only. Otherwise you must explicitely ask the X11 
server for them: that is done by the Mouse.ScreenX / Mouse.ScreenY properties.

Regards,

-- 
Benoît Minisini




More information about the User mailing list