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

Home » Public Forums » archive » Re: drawing lines interactively
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: drawing lines interactively [message #30538 is a reply to message #30536] Fri, 03 May 2002 09:05 Go to previous messageGo to previous message
James Kuyper is currently offline  James Kuyper
Messages: 425
Registered: March 2000
Senior Member
What you have to do is to capture all mouse movements, not just clicks.
You do this by choosing the "/MOTION_EVENTS" option when creating your
draw widget. Alternatively, you can use the DRAW_MOTION_EVENTS option of
WIDGET_CONTROL to turn the reporting of motion events on and off.
Each time your event handler recieves a new WIDGET_DRAW event with
TYPE=2, it's a report of a new mouse position. You can then draw your line.

The tricky part is making the line temporary. That means you have to
keep track of where you drew it, and then "undraw" it when the next
mouse position event comes in. There's probably other ways to do it, but
I know of only one simple way, that involves putting graphics into XOR mode:

DEVICE, GET_GRAPHICS=oldg, SET_GRAPHICS=6
PLOT,[x0,x1],[y0,y1], /DATA,/NOERASE
DEVICE, SET_GRAPHICS=oldg

If you draw the same line in that mode twice in a row, the second
occurance will un-draw the first.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Findfile finds no files
Next Topic: Re: color bar..

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

Current Time: Fri Oct 10 09:00:42 PDT 2025

Total time taken to generate the page: 0.63985 seconds