; pro getatt,file on_ioerror,badfile cdfid = ncdf_open(file) ; tgcmproc_att = ncdf_attinq(cdfid,/global,'tgcmproc') ; if tgcmproc_att.length gt 0 then begin print,'tgcmproc_att.datatype=',tgcmproc_att.datatype print,'tgcmproc_att.length =',tgcmproc_att.length ncdf_attget,cdfid,/global,'tgcmproc',value print,'yesno = ',string(value) endif else begin print,'Could not find tgcmproc attribute on file ',file endelse return badfile: print,'Error opening file ',file end ; ;----------------------------------------------------------------------- pro ncdfatt_event,event widget_control,event.id,get_uvalue=widget case widget of 'OPENFILE': begin openpath = '/e/foster/tgcmproc' file = dialog_pickfile(path=openpath,/must_exist,/read,filter='*.nc') getatt,file end 'DONE': begin widget_control,event.top,/destroy end endcase end ; ;----------------------------------------------------------------------- pro ncdfatt tlb = widget_base(col=1) button = widget_button(tlb,value='Open file',uvalue='OPENFILE') button = widget_button(tlb,value='Done',uvalue='DONE') widget_control,tlb,/realize xmanager,'ncdfatt',tlb,/no_block end