Please help with buggy widget code [message #2548] |
Tue, 26 July 1994 12:18 |
rouse
Messages: 17 Registered: July 1994
|
Junior Member |
|
|
Hi All,
This one's really got me baffled. I've already run it by our local expert.
The original program was suppose to allow the user to select from a list the
name of a FITS format file to open, read, and then plot. I've shortened it
into a test version. The problem is this. After the first 1 or 2 reads some
variable becomes undefined causing the FITS reader to crash. Is there
something about event handlers and reading files that I'm missing here? The
FITS reader is READFITS.PRO in astrolib. I'm running version 3.0.0 on a
DECstation 5000 with Ultrix4.2A. I've included the test version below. It's
suppose to read the same file over and over but crashes on the second read.
Any old FITS file should work. If someone would like to try it with same file
please e-mail me. This was really a great and efficient user interface until
it broke. Any hints or suggestions would be appreciated.
Thanks, Roger
PRO test6_event, event
common TEST6_DATA, total_junk
type = tag_names(event, /structure)
CASE type OF
'WIDGET_BUTTON': BEGIN
widget_control, event.id, get_value=value
CASE value OF
'Exit': widget_control, event.top, /destroy
'Next': BEGIN
print,'reading'
data=readfits('tmp.fits')
print,'ok'
print,total_junk
END
ELSE: print, 'Uhhh, what?'
ENDCASE
END
ELSE: print, "I'm not suppose to be here."
ENDCASE
END
FUNCTION test6
common TEST6_DATA, total_junk
total_junk = 0
base=widget_base(title='test6',/row)
xmenu,['Exit','Next'],base,/row
widget_control, base, /realize
xmanager,'test6',base
RETURN, 1
END
|
|
|