Re: ? Weird DRAW widget VALUE ? [message #14142 is a reply to message #14141] |
Wed, 27 January 1999 00:00  |
David Foster
Messages: 341 Registered: January 1996
|
Senior Member |
|
|
Peter Cornelius wrote:
>
> Re again...
>
> With IDL 4.0.1 on Windoze95, I am trying to use some code like:
>
> [...]
> PRO PDMENU298_Event, Event
>
> COMMON DRAW_Comm
>
> CASE Event.Value OF
> [...]
> 'DISPLAY.Display Mode.ROI': BEGIN
> MESSAGE, 'Event for DISPLAY.Display Mode.ROI', /INFORMATIONAL
> WSET, DRAW288_Id
> WIDGET_CONTROL, DRAW288_Id, GET_VALUE=win
> HELP, DRAW288_Id
> HELP, win
> ROI=CW_DEFROI(DRAW288_Id)
> HELP, ROI
> END
> [...]
> ENDCASE
> END
> [...]
>
> But what I get is the following:
>
> % PDMENU298_EVENT: Event for DISPLAY.Display Mode.ROI
> DRAW288_ID (DRAW_COMM)
> LONG = 32
> WIN STRING = 'Display Mode'
> % Compiled module: CW_DEFROI.
> % Compiled module: CW_BGROUP.
> % Type conversion error: Unable to convert
> given STRING to Long.
> % Detected at: CW_DEFROI 232
> c:\progra~1\rsi\idl40\lib\cw_defro.pro
> % Type conversion error: Unable to convert
> given STRING to Long.
> % Detected at: CW_DEFROI 242
> c:\progra~1\rsi\idl40\lib\cw_defro.pro
> % Type conversion error: Unable to convert
> given STRING to Long.
> % Detected at: CW_DEFROI 264
> c:\progra~1\rsi\idl40\lib\cw_defro.pro
> ROI LONG = -1
>
> Now, I expect CW_DEFROI to be in order, what puzzles
> me is that I get STRING as return, although the DRAW288_Id
> is ok (it's in the COMMON DRAW_Comm block 8-S). In CW_DEFROI,
> it hangs just at the lines
>
> [...]
> WIDGET_CONTROL, draw, GET_VALUE=win
> WSET, win
> [...]
>
> which obviously doesn't work with a STRING. Is there anyone who
> can give me a hint how this STRING could have gotten into
> win?
First suggestion, get rid of common blocks! Store "state" information
in a structure, create a pointer that points to it, and store this
pointer as the UVALUE of the top-level-base widget.
I would guess that the order of parameters in your common-block
is incorrect, as the string you are getting looks like it's
associated with a button or label widget, and you're passing
this widget to CW_DEFROI().
Dave
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
David S. Foster Univ. of California, San Diego
Programmer/Analyst Brain Image Analysis Laboratory
foster@bial1.ucsd.edu Department of Psychiatry
(619) 622-5892 8950 Via La Jolla Drive, Suite 2240
La Jolla, CA 92037
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
|
|
|