; ;------------------------------------------------------------------ ; pro gotoframe_event,ev @pltdat.h common gotocom, wtxt_goto ; widget_control,ev.id,get_uvalue=uval case uval of "TXT_GOTO": begin widget_control,ev.id,get_value=value iwant = 0 istat = readstr(value(0),iwant,'frame number to go to') if istat lt 0 or iwant le 0 then begin if iwant le 0 then print,'Frame number must be > 0' widget_control,ev.id,set_value=string(format="(f5.1)",ifileframe) return endif print,'Hit OK to search for frame number ',iwant return end "OK": begin widget_control,wtxt_goto,get_value=value iwant = 0 istat = readstr(value(0),iwant,'frame number to go to') if istat lt 0 or iwant le 0 then begin if iwant le 0 then print,'Frame number must be > 0' widget_control,ev.id,set_value=string(format="(f5.1)",ifileframe) return endif istat = gotoframe(ludat,ifileframe,iwant,flnm,frame) resetbases return end "CANCEL": begin widget_control,/destroy,ev.top return end else: print,'gotoframe_event: unknown uval=',uval endcase return end ; ;------------------------------------------------------------------- ; pro popup_gotoframe @pltdat.h common gotocom, wtxt_goto ; gotobase = widget_base(title='GOTO FRAME',/column) base = widget_base(gotobase,/frame,/column) wlab_goto = widget_label(base,value='Enter desired frame number') wtxt_goto = widget_text(base,/editable,value=$ strcompress(string(ifileframe),/remove_all),uvalue='TXT_GOTO') ; base = widget_base(gotobase,/frame,/row) ok = widget_button(base,value="OK",uvalue="OK") cancel = widget_button(base,value="CANCEL",uvalue="CANCEL") ; widget_control,gotobase,/realize offxy = offset(appbase,gotobase) widget_control,gotobase,tlb_set_xoffset=offxy(0),tlb_set_yoffset=offxy(1) xmanager,'gotoframe',gotobase return end