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

Home » Public Forums » archive » Re: vertical line that moves with cursor in draw widget
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: vertical line that moves with cursor in draw widget [message #60723 is a reply to message #60713] Sat, 07 June 2008 00:49 Go to previous messageGo to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
cgoethel@igpp.ucla.edu writes:

> Hello, I have a draw_widget with motion events set up. I draw a
> vertical line (using plots) which follows the cursor as it moves
> through the draw area. I can get the vertical line to follow the
> cursor easily enough - but I can't seem to figure out how to erase the
> previous lines. All the lines remain drawn. Any suggestions?
> Thanks! Cindy

Hello--

My personal favorite would be to use the DEVICE, SET_GRAPHICS_FUNCTION=
function to change to XOR drawing mode. In this mode you should be able
to draw the line once to make it appear and then repeat the operation
to make it disappear.

Something like,

DEVICE, GET_GRAPHICS_FUNCTION=oldg, SET_GRAPHICS_FUNCTION=6
;; Erase previous symbol
if n_elements(old_posx) then plots, old_posx, old_posy
;; Plot new symbol
plots, new_posx, new_posy
DEVICE, SET_GRAPHICS_FUNCTION=oldg

;; Save the new position for the next call
old_posx = new_posx
old_posy = new_posy


Good luck!
Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@REMOVEcow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Labelling the axes on a log plot
Next Topic: Re: widget, draw and file pickup

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

Current Time: Sun Nov 30 09:42:00 PST 2025

Total time taken to generate the page: 0.95863 seconds