1. Showing mouse position in a Widow
How do you get the mouse's x,y position and showit in a window.
Thanks
roachd_76
2. Re: Showing mouse position in a Widow
David R,
You could use the on_mouse event to activate a routine, with a test for
MouseMove in it, and then send the x,y info to a label.
Approx. like this:
--semi-tested code:
-- code generated by Win32Lib IDE v0.8
include Win32Lib.ew
without warning
----------------------------------------------------------------------------
----
-- Window Window1
global constant Window1 = create( Window, "The Window", 0, Default, Default,
784, 460+ 19, 0 )
global constant LText1 = create( LText, "LText1", Window1, 113, 45, 148, 36,
0 )
-------------------------------------------------------
procedure Window1_onMouse ( int event, int x, int y, int shift )
if event = MouseMove then
setText(LText1,sprint(x) & " " & sprint(y))
end if
end procedure
------------------------------
--event:
onMouse[Window1] = routine_id("Window1_onMouse")
------------------------------------------
WinMain( Window1, Normal )
-- code ends
Dan Moyer
David Roach wrote:
>How do you get the mouse's x,y position and showit in a window.
>Thanks
>roachd_76