Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Idl-pvware > Re: Multiple dr...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 4 of 5 Topic 5697 of 5734
Post > Topic >>

Re: Multiple draw widget events

by David Fanning <news@[EMAIL PROTECTED] > May 2, 2008 at 09:09 AM

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.")




 5 Posts in Topic:
Multiple draw widget events
Jye <jye.smith@[EMAIL   2008-05-01 22:49:53 
Re: Multiple draw widget events
"ben.bighair" &  2008-05-02 06:54:09 
Re: Multiple draw widget events
David Fanning <news@[E  2008-05-02 08:21:43 
Re: Multiple draw widget events
David Fanning <news@[E  2008-05-02 09:09:33 
Re: Multiple draw widget events
Jye <jye.smith@[EMAIL   2008-05-05 18:07:07 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat May 17 2:37:04 CDT 2008.