[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: idl 5.2 -> 5.3 problem: cw_form



Olivier ARCHER wrote:

> so i've find a lot of difference between cw_form.pro in idl 5.2 and 5.3
> i finally change the code in cw_form.pro (5.3):
> line 352: uextra = { VALUE: FIX(value) }
> became uextra = { VALUE: 0L }
> as in cw_form.pro (5.2)
>
> now it seem to works, but i'm not sure of what i've done. Is there
> another workaround ?

Olivier,
The bug you report in 5.3's cw_form may in fact be a bug-fix itself!  Let me explain.

Several years ago I reported to RSI a but in cw_form (I forget exactly what the
symptom was).  Tech support agreed to the bug and sent me a patched version of
cw_form.pro.  At the next IDL release (5.2 I think) the bug remained.  I complained
again (reminding them of the first patch they had given me) and continued to use
the patched cw_form.pro.  I have not upgraded to 5.3 so cannot comment on it's version
of cw_form.

The patch in question occured at line 337 (in my cw_form anyway).  The full context of
the
patch is here:

'DROPLIST': BEGIN
    CW_FORM_LABEL, parent, nparent, e, frame
    new = WIDGET_DROPLIST(nparent, VALUE = str_sep(a[2], '|'), $
                FRAME=frame, UVALUE=ids[n], _EXTRA=extra)
    if CW_FORM_PARSE(e, 'SET_VALUE', value) then $
          WIDGET_CONTROL, new, SET_DROPLIST_SELECT = value
    ;uextra = { VALUE: 0L }
    uextra = { VALUE: LONG(value) }
    type = 1
    ENDCASE

The commented line is RSI's original, and the
   uextra = { VALUE: LONG(value) }
line is their suggested patch, which did indeed fix my problem.  Perhaps you've
discovered a flaw with this patch.

By the way I agree that cw_form has it's problems, but would not agree to
blanket advice to avoid using it altogether.

Regards,
Patrick Broos
====================================================================
Patrick S. Broos, Systems Analyst/Programmer    patb@astro.psu.edu

Department of Astronomy and Astrophysics  My office   814-863-7947
Penn State University
525 Davey Lab                             FAX         814-863-8686
University Park, PA  16802-6305
http://www.astro.psu.edu                  Group office    863-9550
====================================================================