;+--------------------------------------------------------------------------- ; NAME: ; GA_PlotW ; ; PURPOSE: ; Plot widget for "table" of data, or input X & Y arrays. ; ; CATEGORY: ; Plotting, GA Plot Objects ; ; KEYWORDS: ; indicesPlot - indices to plot (plot if =1). ; Same 1st dimension as Y (if Y is 2-D) ; if just 1 dimension, and Y is two, use same mask for ; all y's. ; ; EXAMPLE: ; ; objRef = GA_PlotW( xdata=indgen(5), ydata=[1,3,5,4,2] ) ; ; or ; table=strarr(3,8) ; table[0,*]= ['time','0.01','0.02','0.03','0.04','0.05','0.06','0.07'] ; table[1,*]= ['Ip', '1.0', '1.1', '1.3', '1.6', '1.6', '1.5', '1.3' ] ; table[2,*]= ['Bt', '.7', '.71', '.73', '.76', '.75', '.65', '.59' ] ; objRef = GA_PlotW( table=table ) ; ; or ; objRef = GA_PlotW(table=['Bt', '.7', '.71', '.73', '.76'] ) ; ; or to make a scatter plot with a y=y line through it: ; ; x=findgen(100) ; noise = randomn(seed,100)*(x+20)/10 ; y=(x+noise ) > 0 ; objRef = GA_PlotW( xdata=x, ydata=transpose([[y],[x]]),plotnum=[0,0], $ ; psymbol=[10,7], linestyle=[6,0] ) ; ; LIMITATIONS: ; "Marking" points on a plot will select correspongind row in table, ; if called "properly," as from plotdef__define.pro, but this only works ; for the last table created. ; ; MODIFICATION HISTORY ; 21-Mar-2003 Allow for indices array to plot different xranges. ; (Can then have different ranges have different colors, etc.) ; 10-Dec-2002 Written by Bill Davis. Based on various object-oriented ; plotting codes from General Atomics. ; ;------------------------------------------------------------------------ pro ga_plotw_editcallback, index, oData ,oPlot, type if NWORDS( getenv('DEBUG_IDL') ) eq 0 then ON_ERROR, 2 COMMON GA_PlotW_local, tableID, pAxisData if n_elements( tableID ) eq 0 then return if not widget_info( tableID,/valid_id) then return for j=0,n_elements(oData)-1 do begin markedIndices = oData[j]->getMarkIndecies() if markedIndices[0] ne -1 then goto, foundIt endfor foundIt: if markedindices[0] eq -1 then begin if NWORDS( getenv('DEBUG_IDL') ) eq 0 then print, 'markedindices eq -1!' return endif ;;; print, 'editcallback routine called' if ptr_valid( pAxisData ) then begin pAll = *pAxisData tableX=*pAll[0] xPlotted=oData[j]->getXdata() if n_elements(xPlotted) eq n_elements(tableX) then begin ; data plotted has same number as table (no selections) iRow = markedIndices[ n_elements(markedIndices)-1 ] endif else begin lastMarked = markedIndices[ n_elements(markedIndices)-1 ] indsXmatch = WHERE( tableX eq xPlotted(lastMarked), nfound ) if nFound eq 0 then return irow = indsXmatch[0] if nFound gt 1 then begin ; duplicate x's, so find unique Y ; (this could be very slow!) yPlotted=oData[j]->getYdata() for j=1,n_elements(pAll)-1 do begin if ptr_valid(pAll[j]) then begin yCol = *pall[j] diffs = ycol[indsXmatch] - yPlotted(lastMarked) inds=WHERE( ABS(diffs) lt ABS(yPlotted(lastMarked)/1.0e6), nfound) if nfound gt 0 then goto, yMatched endif endfor print, 'no match found in editcallback!' return ; no match found yMatched: if nfound eq 1 then begin irow = indsXmatch[inds[0]] endif else begin dum = min( ABS(diffs), iLoc ) irow = indsXmatch[inds[iLoc]] endelse endif endelse ;;;oPlot[j]->Get_Data_Property, xData=xSel, yData=ySel ; nothing returned! endif else begin ; table data not passed in, so assume all rows in table were plotted iRow = markedIndices[ n_elements(markedIndices)-1 ] endelse geom = widget_info( tableID, /geom ) if irow ge geom.ysize then return ; wrong table, or something widget_control, tableID, SET_TABLE_SELECT=[0,iRow,geom.xsize-1,iRow] end ;------------------------------------------------------------------------ pro menu_print_event,event Widget_Control, event.top, Get_UValue=info,/hourglass widget_control,event.id,get_value=button info.oWindow->Print,nodialog = (button eq 'Print') end ;------------------------------------------------------------------------ FUNCTION GA_Plotw_MenuHelp_Event,ev ; Catch possible errors. IF getenv_('DEBUG') EQ '' THEN Catch,error_status ELSE error_status=0 IF error_status NE 0 THEN BEGIN ok = Dialog_Message(!Err_String,Dialog_Parent=ev.id) Return, 0 ENDIF font='-adobe-courier-medium-r-normal--14-100-100-100-m-90-iso8859-1' Widget_Control,ev.id,Get_Value=value CASE value OF ;;; 'Plot Object':BEGIN 'Customizing Plot Appearance (ReviewPlus)':BEGIN webdisplay, $ "http://web.gat.com/comp/analysis/uwpc/reviewplus/manual/customizingtheappearanceofplots.htm" END 'Using GA Plot Objects':BEGIN viewText, $ file=GA_FileSpec('$IDLSOURCE/ga_plot_new/ga_plot.help'), $ Title='Help on Plot Window',Group=ev.id, height=30, $ wid=wid ;windowObj->Help END 'Print':BEGIN Widget_Control,ev.id,Get_UValue=printObj printObj->Help END ELSE:print,'Help on ', value,' - not implemented yet.' ENDCASE Return, 0 END ;---------------------------------------------------------------------------- pro ReDraw, obj obj->Draw end ;---------------------------------------------------------------------------- PRO GA_PlotW_Event,event ;;;print, 'GA_PlotW_Event called with event=', event WIDGET_CONTROL, event.id, Get_UValue=thisevent WIDGET_CONTROL, event.top, Get_UValue=info ; process event from resizing window tag = tag_names(event,/str) if (tag eq 'WIDGET_BASE') then begin info.oWindow->Resize, event.x, event.y info.oWindow->Draw info.oWindow->Copy_To_Pixmap ; cross hairs work with pixmap return endif CASE thisevent OF 'Change Plot Grid': BEGIN info.oWindow->GridDialog ;;; info.oWindow->Draw ; redraw the window ;;; info.oWindow->Copy_To_Pixmap END 'Delete Plot': BEGIN info.oWindow->Delete_Plot END 'Delete Marked Points': BEGIN COMMON GA_PlotW_local, tableID, pAxisData ;;;if not widget_info( tableID,/valid_id) then return oPlot=*info.oplots[0] oData=oPlot[0]->getDataObjects() markedIndices = oData[0]->getMarkIndecies() iRow = markedIndices[ n_elements(markedIndices)-1 ] ;;; widget_control, tableID, delete_rows print, '*** Delete Marked Points not working yet ***' ; gives subscipt error, with any value ;;; for i=0,n_elements(markedIndices)-1 do $ ;;; oData[0]->Delete_Point, markedIndices[i] END 'Print': BEGIN ;;; info.oWindow->PSFile ;;; info.oPrint->DialogPrint,handler=info.oWindow->Draw info.oPrint->DialogPrint, 'ReDraw', UVALUE=info.oWindow END 'Quit': BEGIN if ptr_valid( info.oPlots ) then begin FOR i = 0, N_Elements(*info.oPlots)-1 DO BEGIN if size( (*info.oPlots)[i], /type) eq 11 then $ Obj_Destroy, (*info.oPlots)[i] ENDFOR endif if ptr_valid( pAxisData ) then ptr_free, pAxisData if ptr_valid( info.pxData ) then ptr_free, info.pxData if ptr_valid( info.pyData ) then ptr_free, info.pyData obj_destroy, info.oprint obj_destroy, info.oWindow WIDGET_CONTROL, event.top, /Destroy END 'Set Plot Appearance': BEGIN ; default to x's and no lines info.oWindow->PropertiesDialog ;;; info.oWindow->Draw ; redraw the window ;;; info.oWindow->Copy_To_Pixmap END 'Preferences': BEGIN info.oWindow->PreferencesDialog ;;; info.oWindow->Draw ; redraw the window ;;; info.oWindow->Copy_To_Pixmap END ENDCASE END ;------------------------------------------------------------------------ FUNCTION GA_PlotW_ToolSelect_Event, event ; called when tool selected ;;;print,'GA_PlotW_ToolSelect_Event=', event Widget_Control, event.top, Get_UValue=state, /No_Copy Widget_Control, event.id, Get_UValue=uvalue IF uvalue[0] EQ 'CROSSHAIR' $ THEN state.oWindow->Set_Crosshairs, event.select $ ; CROSSHAIR ELSE state.oWindow->SetCurrentTool, uvalue[0] ; SELECT|EDIT|ZOOM|MARK Widget_Control, event.top, Set_UValue=state, /No_Copy END ;------------------------------------------------------------------------ PRO GA_PlotW::Cleanup print, ' ******** GA_PlotW::Cleanup should do something!!!!!!!!!!!!' END ;------------------------------------------------------------------------ FUNCTION GA_PlotW, xdata=xdata, ydata=ydata_in, table=table, $ debug=debug, Labels=labels, $ xTitle=xTitle, yTitles=yTitles, Title=Title,$ PlotNum=PlotNum, $ psymbol=psymbol, linestyle=linestyle, $ WindowTitle=WindowTitle, region=region, $ CallOnMark=CallOnMark, indicesPlot=indicesPlot, $ wIDtable=wIDtable, nulls=nulls, $ CharSize=CharSize, LCharSize=LCharSize, $ group_leader=group_leader, $ _EXTRA=_extra if NWORDS( getenv('DEBUG_IDL') ) eq 0 then ON_ERROR, 2 ;color_setup,/reverse dummy = mk_color( TABLE=5, /quiet, /GAcolors ) ;;; color_setup, /NoTrueCheck ; needed to resolve some routine references color_setup ; needed to resolve some routine references dummy = mk_color( TABLE=5, /quiet, /GAcolors ) !p.color = mk_color('black', /GAcolors ) !p.background = mk_color('white', /GAcolors ) if n_elements(debug) eq 0 then debug= GETENV('DEBUG_IDL') if n_elements(CallOnMark) eq 0 then CallOnMark= 'ga_plotw_editcallback' ; see LIMITATION in header COMMON GA_PlotW_local, tableID, pAxisData if n_elements(wIDtable) gt 0 then begin if wIDtable gt -1 then tableID=wIDtable ;;; $ ;;; else if n_elements(tableID) gt 0 then dum = TEMPORARY(tableID) endif else begin ; so ga_plotw_editcallback not fooled ;;; if n_elements(tableID) gt 0 then dum = TEMPORARY(tableID) endelse ; so ga_plotw_editcallback not fooled ;;; if n_elements(pAxisData) gt 0 then dum = TEMPORARY(pAxisData) if n_elements(table) gt 0 then begin if size(table,/type) eq 10 then begin ; dbaccess sends pointers ptrs= *table nCols = FIX(TOTAL(ptr_valid(ptrs))) nRows = n_elements(*ptrs[0]) if nCols gt 1 then begin xData = *ptrs[0] yData = fltarr( nCols-1, nRows ) for iCol=1, nCols-1 do ydata[iCol-1,*] = *ptrs[icol] endif else begin ydata = *ptrs[0] xTitle = "Index" endelse if nwords(xTitle) eq 0 then xTitle = labels[0] ;;;yTitles = labels[ 1:* ] nplots = (nCols-1) > 1 ; if no X, still want a plot PlotLabels = labels[ 1:* ] pAxisData = table ; through COMMON for ga_plotw_editcallback endif else begin ; assumes column titles in first row ArrayInfo = SIZE( table ) nplots = ArrayInfo[1]-1 if ArrayInfo[0] EQ 1 then begin ; just a single vector yTitles = strarr( 1, 1 ) yTitles[0,0] = table[0] ydata = table[1:*] xdata = indgen( ArrayInfo[1]-1 ) xTitle = "Index" nplots = 1 endif else begin xTitle = table[0,0] yTitles = strarr( 1, 1 ) yTitles = table[1:*,0] xdata = table[0,1:*] ydata = table[1:*,1:*] endelse if n_elements(yTitles) eq 0 then begin yTitles=STRARR(nplots) yTitles(*)='Data' endif endelse endif if n_elements(ydata) eq 0 then begin if n_elements(ydata_in) ne 0 then ydata=ydata_in $ else ydata = SIN((FindGen(100)-50)*2*!PI/100.) endif if n_elements(xdata) eq 0 then xdata = FindGen(n_elements(ydata)) if n_elements( nplots ) eq 0 then begin dims = size( reform(ydata), /dim ) if n_elements( dims ) eq 1 then nplots =1 $ else nplots = dims[0] endif if n_elements( xTitle ) eq 0 then xTitle='' if n_elements( yTitles ) eq 0 then yTitles=STRARR(nplots) if n_elements( Title ) eq 0 then Title=STRARR(nplots) if n_elements( PlotLabels ) eq 0 then PlotLabels=STRARR(nplots+1) if n_elements( plotnum ) eq 0 then plotnum = indgen(nplots+1) if n_elements( psymbol ) eq 0 then psymbol = 0 if n_elements( psymbol ) ne nplots then psymbol=replicate(psymbol[0],nplots) if n_elements( linestyle ) eq 0 then linestyle=0 if n_elements( linestyle ) ne nplots then linestyle=replicate(linestyle[0],nplots) if size(ydata,/n_dim) eq 1 then ydata=reform(ydata, 1, n_elements(ydata)) ; fix if 2-d y array if transposed dimsY = size( ydata,/dim) if n_elements( dimsY ) gt 1 then begin dimX = size( xdata, /dim) if dimsY[1] ne dimX[0] and dimsY[0] eq dimX[0] $ then ydata = transpose(ydata) endif if n_elements( indicesPlot ) gt 0 then begin ; fix if 2-d indices array if transposed dimsI = size( indicesPlot,/dim) if n_elements( dimsI ) gt 1 then begin dimX = size( xdata, /dim) if dimsI[1] ne dimX[0] and dimsI[0] eq dimX[0] $ then indicesPlot = transpose(indicesPlot) endif endif if n_elements( windowTitle ) eq 0 then windowTitle = "GA_Plot Widget" wBase = Widget_Base( Title=windowTitle, MBar=menuBase, $ /Tlb_Size_Events, /Column, resource_name='colorbuttons') fileMenuID = WIDGET_BUTTON( menuBase, Value='File', frame=2) junk = WIDGET_BUTTON( fileMenuID, Value='Print...', UValue='Print') junk = WIDGET_BUTTON( fileMenuID, Value='Dismiss', UValue='Quit', /separator) editID = WIDGET_BUTTON( menuBase, Value='Edit', frame=2) junk = WIDGET_BUTTON( editID, Value='Set Plot Appearance', $ UValue='Set Plot Appearance') junk = WIDGET_BUTTON( editID, Value='Change Plot Grid', $ UValue='Change Plot Grid') junk = WIDGET_BUTTON( editID, Value='Preferences', $ UValue='Preferences') junk = WIDGET_BUTTON( editID, Value='Delete Marked Points', $ UValue='Delete Marked Points') ; delete plot not working ;;; junk = WIDGET_BUTTON( editID, Value='Delete Plot', $ ;;; UValue='Delete Plot', /separator) mHelp = widget_button(menubase, value='Help', /help, frame=2, $ event_pro='GA_Plotw_MenuHelp_Event') junk = widget_button(mHelp, value='Using GA Plot Objects', $ Event_Func='GA_Plotw_MenuHelp_Event',UValue=wBase) junk = widget_button(mHelp, value='Customizing Plot Appearance (ReviewPlus)', $ Event_Func='GA_Plotw_MenuHelp_Event',UValue=wBase) ; Create the Select/Edit/Zoom/Crosshair/Mark buttons and the Status text wToolBase = Widget_Base(wBase,/Row,$ Event_Func='GA_PlotW_ToolSelect_Event') wRadioBase = Widget_Base(wToolBase,/Row,/Exclusive) butID = Widget_Button(wRadioBase,Value='Select',UValue='SELECT') Widget_Control,butID,Set_Button=0 butID = Widget_Button(wRadioBase,Value='Edit',UValue='EDIT') Widget_Control,butID,Set_Button=0 butID = Widget_Button(wRadioBase,Value='Zoom',UValue='ZOOM') Widget_Control,butID,Set_Button=1 butID = Widget_Button(wRadioBase,Value='Mark',UValue='MARK') Widget_Control,butID,Set_Button=0 ID = Widget_Base(wToolBase,/NonExclusive) butID = Widget_Button(ID,Value='CrossHair', UValue='CROSSHAIR') Widget_Control,butID,Set_Button=1 wStatusText = Widget_Text(wToolBase,Value='',YSize=1,XSize=20, $ resource_name='white') ; Create the Ga_Plots ; plotnum seems to want something for x, as well as all y's if n_elements( plotnum ) le nplots+1 then plotnum = [0,plotnum] PlotNumJustY = PlotNum[1:nPlots] SortPlotNumJustY = PlotNumJustY[sort(PlotNumJustY) ] indsTargets = Uniq( SortPlotNumJustY) plotNumTargets = SortPlotNumJustY( indsTargets ) nAxes = n_elements( plotNumTargets ) SelectionMade = 0 ; assume all values wanted if n_elements( region ) gt 0 then begin if (total( region ) gt 0) and (region[1] ne region[3]) then $ SelectionMade = 1 endif if SelectionMade eq 0 then begin xAll = FLOAT(reform(xdata)) endif else begin if ((region[1] eq -1) OR (region[1] EQ region[3]) ) $ then xAll = FLOAT(reform(xdata)) $ else xAll = FLOAT(reform(xdata[region[1]:region[3]])) endelse if n_elements( charsize ) eq 0 then charsize = 1.5 if n_elements( Lcharsize ) eq 0 then Lcharsize = charsize ;;;/ 1.5 ;;; for ia = 0, n_elements(xTitle)-1 do begin ;;; if strpos( STRUPCASE(xTitle[ia]), 'SHOT') gt -1 $ ;;; then charsize=charsize<1.5 ;;; endfor if nAxes gt 1 then charsize=charsize*2.0 ;;;/1.5 ;;; print, nAxes, Lcharsize, charsize machParms = MACHAR() oPlots = ObjArr(nAxes) iAxis = 0 axesPlotted = [0] plotsDone = [0] for iPlot=0,nPlots-1 do begin ;;; axisTarget = (PlotNum[ iPlot+1 ] - 1)>0 axisTarget = where( plotNumtargets eq PlotNum[ iPlot+1 ] ) axisTarget = axisTarget[0] dum = WHERE( axesPlotted eq axisTarget, nfound ) ;;;print, 'iPlot, nfound= ', iPlot, nfound ;;;print, ' axesPlotted=',axesPlotted ;;;print, ' plotsDone= ',plotsDone if (iPlot eq 0) OR (nfound eq 0) then begin if iPlot gt 0 then axesPlotted = [ axesPlotted, axisTarget ] if iPlot gt 0 then plotsDone = [ plotsDone, iPlot ] if iPlot eq 0 then TitleToUse=Title[0] else TitleToUse='' if axisTarget eq nAxes-1 then begin xtickformat='betterticklabels' xTitleToUse=xTitle[0] endif else begin xtickformat='' xTitleToUse='' endelse if SelectionMade eq 0 then begin yToPlot = FLOAT(reform(ydata[iPlot,*])) endif else begin ; don't plot just one point if ((region[1] eq -1) OR (region[1] EQ region[3]) ) $ then yToPlot = FLOAT(reform(ydata[iPlot,*])) $ else yToPlot = FLOAT(reform(ydata[iPlot,region[1]:region[3]])) endelse if MIN( yToPlot ) gt machParms.xmax/3 then begin result=DIALOG_MESSAGE( [' All nulls for '+PlotLabels[iPlot] , $ ' ', ' -- Will not plot' ], /info, /CANCEL, $ dialog_parent=ev.id ) IF result NE 'OK' THEN return, -1 endif if n_elements( indicesPlot ) gt 0 then begin if n_elements( dimsI ) eq 1 then begin inds = where( indicesPlot eq 1 ) endif else begin inds = where( indicesPlot[iPlot,*] eq 1 ) endelse yToPlot = yToPlot[ inds ] xToPlot = xAll[ inds ] endif else xToPlot = xAll ; do not plot null values if n_elements( nulls ) gt 0 then begin type = size( yToPlot, /type ) if type eq 5 then null=double(nulls.Float) if type eq 4 then null=nulls.Float if type eq 3 then null=nulls.int inds = where( yToPlot ne null, nfound ) if nfound ne n_elements(yToPlot) then begin yToPlot = yToPlot[ inds ] xToPlot = xAll[ inds ] endif endif if n_elements( xminAll ) eq 0 then begin ;(just do once) ; find xrange for all lines on this plot chkRange=0 if nAxes NE nPlots AND n_elements( indicesPlot ) GT 0 $ then chkRange=1 if n_elements( indicesPlot ) GT 0 then begin ; there was some limiting of points plotted, so need to check IF LONG(TOTAL(indicesPlot)) NE N_ELEMENTS(indicesPlot) $ then chkRange=1 endif if chkRange then begin xminAll = machParms.xmax xmaxAll = machParms.xmin for ip=0,nPlots-1 do begin if n_elements( dimsI ) eq 1 then begin inds = where( indicesPlot eq 1 ) endif else begin inds = where( indicesPlot[ip,*] eq 1 ) endelse thisX = xAll( inds ) xmin = MIN( thisX, max=xmax ) xminAll = xminAll < xmin xmaxAll = xmaxAll > xmax endfor xRange=[xminAll, xmaxAll] endif endif ;;;print, ' axisTarget=',axisTarget ;;;print, PlotLabels[iPlot] ;;;help,xtoplot, ytoplot ;;; stop ; 6-digit shots need more room, so shrink size oPlots[axisTarget] = Obj_New("GA_PLOT", xToPlot, yToPlot, $ yTitle=yTitles[iPlot], Title=TitleToUse, $ xTitle=xTitleToUse, $ grid=gridlayout( nAxes ), $ number=axisTarget+1, $ ytickformat='betterticklabels', /marker, $ xtickformat=xtickformat, $ xrange=xrange, $ color= mk_color('black', /GAcolors ), $ datacolor= mk_color('black', /GAcolors ), $ xmargin=[10,4], $ psym=psymbol[iPlot], linestyle=linestyle[iPlot], $ DEP_DATA_NAME=PlotLabels[iPlot], $ LcharSize=LcharSize, CHARSIZE=charsize ) ;;;print, 'iPlot,axisTarget,PlotLabels[iPlot]=',iPlot,' ',axisTarget,PlotLabels[iPlot] endif endfor ;;;stop ; add any overlays if nAxes NE nPlots then begin for iPlot=0,nPlots-1 do begin ; see if data put on axis already ind=where( plotsDone eq iPlot, nFound ) if nFound eq 0 then begin ; needs to be added to an axis iTarget = where( plotNumTargets eq plotNum[ iPlot+1 ] ) iTarget = iTarget[0] axesPlotted = [ axesPlotted, iTarget ] dum = where( axesPlotted eq iTarget, iOverlay ) if SelectionMade eq 0 then begin yToPlot = FLOAT(reform(ydata[iPlot,*])) endif else begin if region[1] eq -1 OR region[1] eq region[3] $ then yToPlot = FLOAT(reform(ydata[iPlot,*])) $ else yToPlot = FLOAT(reform(ydata[iPlot,region[1]:region[3]])) endelse if n_elements( indicesPlot ) gt 0 then begin if n_elements( dimsI ) eq 1 then begin inds = where( indicesPlot eq 1 ) endif else begin inds = where( indicesPlot[iPlot,*] eq 1 ) endelse yToPlot = yToPlot[ inds ] xToPlot = xAll[ inds ] endif else xToPlot = xAll ;;;print, 'adding overlay iPlot=', iPlot ;;;print, ' iTarget=',iTarget ;;;print, PlotLabels[iPlot] ;;;help, xtoplot, ytoplot Result = oPlots[iTarget]->Add_Data( xToPlot, yToPlot, $ symbol=psymbol[iPlot], linestyle=linestyle[iPlot], $ Yname=PlotLabels[iPlot], color=iOverlay ) endif endfor endif ; Create the GA_Plot_Window wGAWindow = CW_GAWindow( wBase, Plots=oPlots, grid=gridlayout( nAxes), $ color= mk_color('black', /GAcolors ), $ datacolor= mk_color('black', /GAcolors ), $ DEBUG=debug, /tracking, $ editcallback=callOnMark, $ _EXTRA=_extra ) Widget_Control, wGAWindow, Get_Value=oWindow buttonbase=widget_base(wBase,/row) junk = WIDGET_BUTTON( buttonbase, Value='Dismiss', UValue='Quit', $ resource_name='yellow' ) ; Set up some properties of the GA_Plot_Window oWindow->SetCurrentTool,'ZOOM' oWindow->Set_Crosshairs,1 oWindow->Set_Status_Window, wStatusText oPrint = obj_new('GA_PRINTER', wGAWindow, title=WindowTitle+' Printing', $ debug=keyword_set(debug)) if n_elements( psymbol ) eq 0 then begin symbolSelect = 0 endif else begin symbolSelect = psymbol endelse if n_elements( lineStyle ) eq 0 then lineStyle=0 info = { oPlots : oPlots, $ oPrint : oPrint, $ oWindow : oWindow, $ lineSelect : lineStyle, $ symbolSelect : symbolSelect, $ callOnMark : callOnMark, $ pXdata : ptr_new(xData), $ pYdata : ptr_new(yData), $ debug : keyword_set(debug) } ; Realize the widgets. Store structur in the uvalue of wBase, so ; graphics window object reforence can be retrieved. Widget_Control, wBase, /Realize, Set_UValue=info ;;; oWindow->UnZoomPlot ; makes background right on Macs using Exodus IF keyword_set(debug) THEN BEGIN XMANAGER, CATCH=0 ; want to stop if error detected ENDIF XManager, 'GA_PlotW', wBase, /No_Block Return, oWindow END