comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: dynamic widget
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: dynamic widget [message #56084] Thu, 04 October 2007 10:35
Jean H. is currently offline  Jean H.
Messages: 472
Registered: July 2006
Senior Member
Jeff N. wrote:
> On Oct 3, 3:26 pm, francois <fleduc2...@gmail.com> wrote:
>> Hello,
>>
>> I want to display a window in which a user can enter some values. The
>> number of values to enter is variable.
>> I wrote the following code with the number of values set to 5.
>>
>> nVal =5
>> TLB = widget_auto_base(title='Ente reliability coefficient values')
>> row_base = lonarr(nVal)
>> p = lonarr(nVal)
>>
>> for i=0, nVal-1 do begin
>> row_base[i] = widget_base(TLB, /row)
>> v = 'coeff' + strtrim(string(i+1),2)
>> p = widget_param(row_base[i], /auto_manage, dt=2,
>> prompt='Band'+strtrim(string(i+1),2)+' ', uvalue=v)
>> print, v
>> endfor
>>
>> out = auto_wid_mng(TLB)
>>
>> The problem is that I can not retrieve the five values which are
>> called here out.coeff1 to out.coeff5.
>> How can I have a result such a out.v[0] to out.v[4] ?
>>
>> What am I missing ?
>>
>> Francois.
>
> I'm assuming what you're asking is how to get all the coefficients
> stored in a single array. This is probably not going to happen
> automatically for you using auto-managed ENVI widgets. At least
> that's my guess - I just don't see how you could. I think your
> solutions are going to be a) NOT auto-managing the widgets and writing
> an event handler yourself (note that this is NOT the same as not using
> ENVI widgets..you can still use wiget_param without the /auto_manage
> keyword), or b) writing some code that puts the coefficients
> individually stored in your 'out' structure into an array. Solution a
> is probably more elegant and better in the long run, and solution b
> is probably more of a "quick and dirty" fix.
>
> Hope that helps,
> Jeff
>

Or you can use a table widget... everything is store in one array!
Jean
Re: dynamic widget [message #56085 is a reply to message #56084] Thu, 04 October 2007 10:23 Go to previous message
Jeff N. is currently offline  Jeff N.
Messages: 120
Registered: April 2005
Senior Member
On Oct 3, 3:26 pm, francois <fleduc2...@gmail.com> wrote:
> Hello,
>
> I want to display a window in which a user can enter some values. The
> number of values to enter is variable.
> I wrote the following code with the number of values set to 5.
>
> nVal =5
> TLB = widget_auto_base(title='Ente reliability coefficient values')
> row_base = lonarr(nVal)
> p = lonarr(nVal)
>
> for i=0, nVal-1 do begin
> row_base[i] = widget_base(TLB, /row)
> v = 'coeff' + strtrim(string(i+1),2)
> p = widget_param(row_base[i], /auto_manage, dt=2,
> prompt='Band'+strtrim(string(i+1),2)+' ', uvalue=v)
> print, v
> endfor
>
> out = auto_wid_mng(TLB)
>
> The problem is that I can not retrieve the five values which are
> called here out.coeff1 to out.coeff5.
> How can I have a result such a out.v[0] to out.v[4] ?
>
> What am I missing ?
>
> Francois.

I'm assuming what you're asking is how to get all the coefficients
stored in a single array. This is probably not going to happen
automatically for you using auto-managed ENVI widgets. At least
that's my guess - I just don't see how you could. I think your
solutions are going to be a) NOT auto-managing the widgets and writing
an event handler yourself (note that this is NOT the same as not using
ENVI widgets..you can still use wiget_param without the /auto_manage
keyword), or b) writing some code that puts the coefficients
individually stored in your 'out' structure into an array. Solution a
is probably more elegant and better in the long run, and solution b
is probably more of a "quick and dirty" fix.

Hope that helps,
Jeff
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Rotating axis labels
Next Topic: WINDOWS drag and drop into a draw widget

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:20:24 PDT 2025

Total time taken to generate the page: 0.00656 seconds