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

Home » Public Forums » archive » Re: Multiple draw widget events
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: Multiple draw widget events [message #60081] Fri, 02 May 2008 08:09 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

> Something really weird is going on here!

OK, here is why I never use CW_DEFROI: it makes assumptions
about my programs that are never true. If it were me, I'd
get rid of the damn thing. :-)

One of the assumptions it makes is that the draw widget
it is interacting with does not have an event handler
assigned to it. (I can't understand how it could make
this assumption, but never mind.)

Anyway, to get your program to work, you could try
something like this in your ROI_EVENT event handler:

;*******************************************
PRO ROI_event, event
widget_control, event.top, get_uvalue=info
Widget_Control, info.draw, Draw_Motion_Events=1, EVENT_PRO=""
xsize=(size(info.image))[1]
ysize=(size(info.image))[2]
Result = CW_DEFROI(info.draw, IMAGE_SIZE=[xsize,ysize])
Widget_Control, info.draw, EVENT_PRO='Window_Event'
END
;*************************************************

Here are a couple of suggestions for you. Assign event handlers
to all of your widgets *except* the top-level base with EVENT_PRO
and EVENT_FUNC keywords, not by using XMANAGER. I'm speaking
about your button event handler, for example.

And, read this article:

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

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: problem with display the data
Next Topic: LINBGC problem

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

Current Time: Fri Oct 10 08:32:46 PDT 2025

Total time taken to generate the page: 0.16097 seconds