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

Home » Public Forums » archive » Re: Free-hand ROIs using DRAW_WIDGET
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Free-hand ROIs using DRAW_WIDGET [message #26642] Thu, 20 September 2001 10:59
Liam E. Gumley is currently offline  Liam E. Gumley
Messages: 378
Registered: January 2000
Senior Member
Andre Kyme wrote:
> Cannot see how to use the event-generating options provided by
> WIDGET_DRAW in order to draw a free hand ROI.
> If I could interrupt motion events I can do it, but I can't stop motion
> events once they are going!

The WPAINT example program from chapter 9 of my book demonstrates how
this may be done. You can download the sample programs from

http://www.gumley.com/PIP/About_Book.html

Cheers,
Liam.
Practical IDL Programming
http://www.gumley.com/
Re: Free-hand ROIs using DRAW_WIDGET [message #26662 is a reply to message #26642] Wed, 19 September 2001 21:39 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Andre Kyme (nak@imag.wsahs.nsw.gov.au) writes:

> Cannot see how to use the event-generating options provided by
> WIDGET_DRAW in order to draw a free hand ROI.
> If I could interrupt motion events I can do it, but I can't stop motion
> events once they are going!

Here is an article on this very subject, with the
event handler for the draw widget heavily documented. :-)

http://www.dfanning.com/tips/line_on_image.html

Cheers,

David

--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: Free-hand ROIs using DRAW_WIDGET [message #26665 is a reply to message #26662] Wed, 19 September 2001 20:08 Go to previous message
Andrew Cool is currently offline  Andrew Cool
Messages: 219
Registered: January 1996
Senior Member
Andre Kyme wrote:
>
> Hi,
>
> Cannot see how to use the event-generating options provided by
> WIDGET_DRAW in order to draw a free hand ROI.
> If I could interrupt motion events I can do it, but I can't stop motion
> events once they are going!
>
> Any help would be appreciated,
>
> Thanks,
> Andre

Andre,

Something like this should do the trick. This uses Mouse Button 3
to toggle the motion events on/off.

Pseudo English:
If a button is pressed DOWN and it's MB 3 Then
Check status of motion events
Toggle motion events to opposite setting
end


IF ev.type EQ 0 AND ev.press EQ 4 THEN BEGIN
IF Widget_Info(ev.id,/DRAW_MOTION_EVENTS) THEN BEGIN
Widget_control, ev.id,Draw_Motion_Events=0
ENDIF ELSE BEGIN
Widget_control, ev.id,Draw_Motion_Events=1
ENDELSE
ENDIF


Andrew

------------------------------------------------------------ ---------
Andrew D. Cool .->-.
Electromagnetics & Propagation Group `-<-'
Surveillance Systems Division Transmitted on
Defence Science & Technology Organisation 100% recycled
PO Box 1500, Salisbury electrons
South Australia 5108

Phone : 061 8 8259 5740 Fax : 061 8 8259 6673
Email : andrew.cool@dsto.defence.gov.au
------------------------------------------------------------ ---------
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: wait loop
Next Topic: Spurious characters appear at (semi-)random intervals

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

Current Time: Wed Oct 08 17:05:05 PDT 2025

Total time taken to generate the page: 0.00512 seconds