Re: fsc_field double [message #64926 is a reply to message #64925] |
Thu, 05 February 2009 04:33  |
Spon
Messages: 178 Registered: September 2007
|
Senior Member |
|
|
On Feb 5, 8:51 am, "AndiBif...@googlemail.com"
<AndiBif...@googlemail.com> wrote:
> Hi everybody,
>
> i am using david fannings fsc_field. I initialize the field in the
> following way
>
> param_text = fsc_field(textbase,title=param_labels(i), value = double
> (0.0),Decimal=2,LabelSize= 55,/noedit,xsize=9,$
> uname = param_labels(i), /highlight,/frame,/
> cr_only,uvalue=i,event_pro='setparam')
>
> if a user selects a certain option in my gui the fields should become
> editable and set to default values defined as double default = double
> (1000) e.g.
>
> textID = widget_info(event.top,find_by_uname=param_labels(i))
> widget_control, textID, set_value=default, editable=editable
>
> However even though i initialized the field with a double idl
> complains that it is unable to convert double to string.
>
> WIDGET_CONTROL: String expression required in this context: DEFAULT
>
> Since the field is not set to a different value before i don't
> understand what is going wrong here
>
> Thx
> Andi
Hi Andi,
is there anything stopping you from converting to string yourself?
widget_control, textID, set_value=string(default), editable=editable
I also notice that fsc_field() compiles a file called dbltostr.pro,
make sure you have this in your !Path.
You may be expecting too much of IDL if you're asking it to know what
values it can and can't convert to strings without being told
specifically! :-)
Regards,
Chris
|
|
|