Re: updating a value in a window [message #42076] |
Thu, 16 December 2004 15:21  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Francois L. writes:
> I have a loop in which computation is performed. I want to display the
> progress.
> ------------------------------------------------------------ ---------------------
> tlb = Widget_Base(Column=1, TLB_Frame_Attr=1,title='Work in progress...')
> text1 = widget_text(tlb, value='...... Percent completed ......',xsize=40)
> x = 25
> x = string(x) +' %'
> text2 = widget_text(tlb, value=x)
> CenterTLB, tlb
> Widget_Control, tlb, /Realize
> ------------------------------------------------------------ ---------------------
>
> How can I update the x value in the text2 widget while keeping the same top
> level base ?
> I know I should not call widget_control all over the loop but...
You could have a look at my ProgressBar code and see
how it is done there:
http://www.dfanning.com/programs/progressbar__define.pro
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
Re: updating a value in a window [message #42144 is a reply to message #42076] |
Tue, 21 December 2004 12:01  |
Francois L.
Messages: 19 Registered: December 2004
|
Junior Member |
|
|
In your, code (http://www.dfanning.com/programs/progressbar__define.pro),
I obtain compilation errord at lines 575 and 634.
Both errors concern:
IF self.fast THEN TVLCT, FSC_Color(self.color, /Triple), self.colorindex
^
TVLCT, FSC_Color(self.color, /Triple), self.colorindex
^
What can it be ?
Thank you,
Francois.
"David Fanning" <davidf@dfanning.com> wrote in message
news:MPG.1c2bc6614c2e691d9898bf@news.frii.com...
> Francois L. writes:
>
>> I have a loop in which computation is performed. I want to display the
>> progress.
>> ------------------------------------------------------------ ---------------------
>> tlb = Widget_Base(Column=1, TLB_Frame_Attr=1,title='Work in progress...')
>> text1 = widget_text(tlb, value='...... Percent completed
>> ......',xsize=40)
>> x = 25
>> x = string(x) +' %'
>> text2 = widget_text(tlb, value=x)
>> CenterTLB, tlb
>> Widget_Control, tlb, /Realize
>> ------------------------------------------------------------ ---------------------
>>
>> How can I update the x value in the text2 widget while keeping the same
>> top
>> level base ?
>> I know I should not call widget_control all over the loop but...
>
> You could have a look at my ProgressBar code and see
> how it is done there:
>
> http://www.dfanning.com/programs/progressbar__define.pro
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|