Re: CW_DEFROI (some help for dumb person doing first widget prog...) [message #44748] |
Fri, 15 July 2005 23:30  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Peter Clinch writes:
> Next up, in my event handler for the menu option that will activate the
> ROI selection, I start with
>
> wDraw=widget_info(event.top, find_by_uname="Draw")
>
> CentreROI=CW_DEFROI(wDraw)
>
> that creates the relevant ROI widget, and the cursor position is updated
> when the mouse is over the image, but it doesn't appear to draw anything
> on the image. Can anyone one tell me exactly how I'm being Dumb here?
You passed CW_DEFROI the draw widget identifier. It needs
the graphics window index number, which is the *VALUE*
of the draw widget (after it has been realized).
wDraw=widget_info(event.top, find_by_uname="Draw")
Widget_Control, wDraw, Get_Value=windex
WSet, windex
CentreROI=CW_DEFROI(windex)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
Re: CW_DEFROI (some help for dumb person doing first widget prog...) [message #44842 is a reply to message #44748] |
Mon, 18 July 2005 03:38  |
Peter Clinch
Messages: 98 Registered: April 1996
|
Member |
|
|
David Fanning wrote:
> You passed CW_DEFROI the draw widget identifier. It needs
> the graphics window index number, which is the *VALUE*
> of the draw widget (after it has been realized).
>
> wDraw=widget_info(event.top, find_by_uname="Draw")
> Widget_Control, wDraw, Get_Value=windex
> WSet, windex
> CentreROI=CW_DEFROI(windex)
Oh, hang on... if I do that it crashes on the cw_defroi call
The crashpoint cursor is in the cw_defroi.pro file, at the line
WIDGET_CONTROL, draw, GET_VALUE=win
result is I'm even more confused than I was before... :-(
Pete.
--
Peter Clinch Medical Physics IT Officer
Tel 44 1382 660111 ext. 33637 Univ. of Dundee, Ninewells Hospital
Fax 44 1382 640177 Dundee DD1 9SY Scotland UK
net p.j.clinch@dundee.ac.uk http://www.dundee.ac.uk/~pjclinch/
|
|
|
|