comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: reading mouse coordinates when using widgets
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: reading mouse coordinates when using widgets [message #3315] Thu, 15 December 1994 08:19 Go to previous message
rep2857 is currently offline  rep2857
Messages: 28
Registered: December 1994
Junior Member
In article <D0p781.6uA@sci.kun.nl>, Chris Hendriks <chrish@cs.kun.nl> wrote:
>
> I use a drawing widget (wwdraw) and I want to retieve mouse coordinates in
> this drawing window. The procedure CURSOR does not seem to work for widgets.
> I use version 4.0. Any suggestions?
>
> Please reply to venvd@nlr.nl.
>

CC'd to venvd@nlr.nl

I'm a bit new to this, so any refinements to what I did are appreciated.

After creating the WwDrawing widget, you need to add some mouse
handlers. The WtAddHandler function manages this. The following code
statements ought to perform this for you.

@wtxlib ; this loads all of the button masks. You can also just assign
; the three mask names below to the values found in wtxlib.pro
drawwin = WwDrawing(drawwid, win, "drawinit", wsize, dsize, Area=d_area)
status = WtAddHandler(d_area, ButtonPressMask or ButtonMotionMask or $
ButtonReleaseMask, "draw_buttonevent", 0)

in draw_buttonevent you will need the following lines:
pro draw_buttonevent, wid, id, nparams, mask, event
x = event.x
y = event.y
; and likely several other lines for coordinate transformations
end

Mike Schienle Hughes Santa Barbara Research Center
rep2857@sbsun0010.sbrc.hac.com 75 Coromar Drive, M/S B28/87
Voice: (805)562-7466 Fax: (805)562-7881 Goleta, CA 93117
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Keystroke events to a draw widget?
Next Topic: Need EOF code

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sun Oct 12 05:47:35 PDT 2025

Total time taken to generate the page: 1.12003 seconds