Hi Folks,
Here is one for all you theoretical programmers out there.
I have a simple test program. Call it TEST1. Here it is.
PRO Test1_Event, event
Widget_Control, event.top, Get_UValue=label
FOR j=0,49 DO BEGIN
Widget_Control, label, Set_Value=String(j,format='(I3.3)')
Wait, 0.1
ENDFOR
Widget_Control, event.top, /Destroy
END
PRO Test1
tlb = Widget_Base(Column=1, XOffset=200, YOffset=100)
label = Widget_Label(tlb, Value='000', XSize=100, /Align_Center)
button = Widget_Button(tlb, Value='Start Program')
Widget_Control, tlb, /Realize, Set_UValue=label
XManager, 'test1', tlb, /No_Block
END
When you run it, a graphical user interface appears, you click
the "Start Program" button and the label counts up to 49. Perfect!
Now you make a save file out of it:
IDL> .compile test1
IDL> Resolve_All
IDL> Save, File='test1.sav', /Routines
Quit IDL and double click the save file. Still runs like a champ!
Now, here is another file, very similar to the first.
PRO Test2
tlb = Widget_Base(Column=1, XOffset=200, YOffset=100)
label = Widget_Label(tlb, Value='000', XSize=100, /Align_Center)
Widget_Control, tlb, /Realize, Set_UValue=label
XManager, 'test2', tlb, /No_Block
FOR j=0,49 DO BEGIN
Widget_Control, label, Set_Value=String(j,format='(I3.3)')
Wait, 0.1
ENDFOR
Widget_Control, tlb, /Destroy
END
When you run it, a graphical user interface appears and the
label counts up to 49. Perfect! But now you make a save file
out of this:
IDL> .compile test2
IDL> Resolve_All
IDL> Save, File='test2.sav', /Routines
When you quit IDL and double click the save file, you get
the label appearing in the top-level base, but no count up
on the label. It stays stuck at 000. :-(
Here's my theoretical question: Why?
Cheers,
David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|