Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
Trouble running IDL3 widget programme on IDL4/IDL5
Dear IDLers, I wrote a widget application that ran finw under IDL3. Under IDL4 and IDL5 it brings up the main form, some of the widgets across the top are active, but the other never appear. If I click my QUIT button, the application closes properly, so I know it registers properly. I wrote to ask IDL and after I was told (after three mails) to read IDL4.01 Help "A note about widget Sizing", which didn't help me. Whether that's because I'm stupid or not doesn't worry too much, I just want the application to run (again). Be very glad for some help. Here's the code for generating the widgets, hope it isn't too much. (Needless to say I think IDL could have done a better job of explaining changes required to make IDL3 applications run under IDL4 and IDL5). BLME = WIDGET_BASE(GROUP_LEADER=Group, $ ROW=1, $ MAP=1, $ TITLE='HERA-e: Beam Loss Monitor Data Analysis', $ UVALUE='BLME') USEROPTIONSBASE = WIDGET_BASE(BLME, $ ROW=1, $ FRAME=1, $ MAP=1, $ TITLE='USER OPTIONS BASE', $ UVALUE='USEROPTIONSBASE', $ XSIZE=400, $ YSIZE=700) HELPBASE = WIDGET_BASE(USEROPTIONSBASE, $ ROW=1, $ MAP=1, $ TITLE='HELP BASE:', $ UVALUE='HELPBASE', $ XSIZE=387) MAINBUTTONSGROUP=CW_BGROUP( HELPBASE, ['QUIT','HELP'], $ ROW=1,$ EXCLUSIVE=0, $ UVALUE='MAINBUTTONSGROUP', $ XSIZE=387) SYMBOLINFOBASE = WIDGET_BASE(USEROPTIONSBASE, $ COLUMN=1, $ FRAME=1, $ MAP=1, $ TITLE='SYMBOL INFO BASE:', $ UVALUE='SYMBOLINFOBASE', $ XSIZE=387) SYMBOLINFOBASELABEL = WIDGET_LABEL( SYMBOLINFOBASE, $ UVALUE='SYMBOLINFOBASELABEL', $ VALUE='SYMBOLS USED:') SYMBOLTXT = WIDGET_TEXT( SYMBOLINFOBASE,VALUE=SymbolText, $ UVALUE='SYMBOLTXT', $ YSIZE=8) PRINTBASE = WIDGET_BASE(USEROPTIONSBASE, $ COLUMN=1, $ FRAME=1, $ MAP=1, $ TITLE='PRINT HANDLING:', $ UVALUE='PRINTBASE') PRINTBASELABEL = WIDGET_LABEL( PRINTBASE, $ UVALUE='PRINTBASELABEL', $ VALUE='PRINTING:') PRINTCOMMANDFIELD = CW_FIELD( PRINTBASE,VALUE=PrintCommand, $ ROW=1, $ STRING=1, $ RETURN_EVENTS=1, $ TITLE='Command:', $ UVALUE='PRINTCOMMANDFIELD', $ XSIZE=27) PRINTFILENAMEFIELD = CW_FIELD( PRINTBASE,VALUE=PrintFileName, $ ROW=1, $ STRING=1, $ RETURN_EVENTS=1, $ TITLE='File: ', $ UVALUE='PRINTFILENAMEFIELD', $ XSIZE=27) POSTSCRIPTOPTIONSBGROUP = CW_BGROUP( PRINTBASE, ['b/w','col'], $ ROW=1, $ EXCLUSIVE=1, $ SET_VALUE=1, $ ; Colour output is default LABEL_TOP='Postscript options:', $ UVALUE='POSTSCRIPTOPTIONSBGROUP') PRINTBGROUP = CW_BGROUP( PRINTBASE,$ ['OUTPUT TO FILE & PRINT', 'TO FILE ONLY' ] , $ ROW=1, $ UVALUE='PRINTBGROUP') ANGLEBASE = WIDGET_BASE(USEROPTIONSBASE, $ ROW=1, $ FRAME=1, $ MAP=1, $ TITLE='ANGLE BASE:', $ UVALUE='ANGLEBASE', $ XSIZE=387) ANGLEBASELABEL = WIDGET_LABEL( ANGLEBASE, $ UVALUE='ANGLEBASELABEL', $ VALUE='VIEWING ANGLE (only for lego plots):') AXXFIELD = CW_FIELD( ANGLEBASE,VALUE=axx, $ ROW=1, $ INTEGER=1, $ RETURN_EVENTS=1, $ TITLE='x-angle:', $ UVALUE='AXXFIELD', $ XSIZE=3) AZZFIELD = CW_FIELD( ANGLEBASE,VALUE=azz, $ ROW=1, $ INTEGER=1, $ RETURN_EVENTS=1, $ TITLE='z-angle:', $ UVALUE='AZZFIELD', $ XSIZE=3) PLOTCONTROLBASE = WIDGET_BASE(USEROPTIONSBASE, $ COLUMN=1, $ FRAME=1, $ MAP=1, $ TITLE='PLOT CONTROL BASE:', $ UVALUE='PLOTCONTROLBASE', $ XSIZE=387) PLOTCONTROLBASELABEL = WIDGET_LABEL( PLOTCONTROLBASE, $ UVALUE='PLOTCONTROLBASELABEL', $ VALUE='PLOT CONTROL:') PLOTTYPEBGROUP = CW_BGROUP( PLOTCONTROLBASE, [ $ 'N[i,j] shaded, I, tau, E (from above)', $ 'N[i,j] shaded, zoomed (from above)', $ 'N[i,j] lego, zoomed (with viewpoint )', $ 'R[*,j] & tau vs. time (set monitor j)', $ 'N[i,*] vs. monitors (set time i)' ],$ COLUMN=1, $ EXCLUSIVE=1, $ ; LABEL_TOP='Select plot type:', $ UVALUE='PLOTTYPEBGROUP',$ SET_VALUE=0 $ ; default is full surface plot ) AUTOREPLOTBGROUP = CW_BGROUP(PLOTCONTROLBASE, $ [ 'Automatic replotting' ], $ ROW=1,$ NONEXCLUSIVE=1,$ UVALUE='AUTOREPLOTBGROUP',$ SET_VALUE=AutoReplot) PLOTBUTTONGROUP = CW_BGROUP( PLOTCONTROLBASE, $ ['(RE)PLOT',$ 'PLOT NEXT TIME SLICE',$ 'PLOT NEXT MONITOR SLICE'],$ COLUMN=1, $ UVALUE='PLOTBUTTONGROUP') PLOTTINGBASE = WIDGET_BASE(BLME, $ ROW=1, $ MAP=1, $ TITLE='PLOTTING BASE:', $ UVALUE='PLOTTINGBASE', $ XSIZE=850, $ YSIZE=920) ; Filename and reader sit above plotting window FILEBASE = WIDGET_BASE(PLOTTINGBASE, $ ROW=1, $ FRAME=1, $ MAP=1, $ TITLE='FILE HANDLING:', $ UVALUE='FILEBASE',$ XSIZE=840) FILENAMEFIELD = CW_FIELD( FILEBASE,VALUE=FileName, $ ROW=1, $ STRING=1, $ RETURN_EVENTS=1,$ TITLE='DATA FILE:', $ UVALUE='FILENAMEFIELD', $ XSIZE=57) PICKFILEBUTTON = WIDGET_BUTTON( FILEBASE, $ UVALUE='PICKFILEBUTTON', $ VALUE='FILE VIEWER') DRAW = WIDGET_DRAW( PLOTTINGBASE, $ RETAIN=2, $ UVALUE='DRAW', $ XSIZE=850, $ YSIZE=680) PLOTRANGEBASE = WIDGET_BASE(PLOTTINGBASE, $ ROW=1, $ FRAME=1, $ MAP=1, $ TITLE='PLOT RANGE BASE:', $ UVALUE='PLOTRANGEBASE') TIMERANGEBASE = WIDGET_BASE(PLOTRANGEBASE, $ COLUMN=1, $ FRAME=1, $ MAP=1, $ TITLE='TIME RANGE BASE:', $ UVALUE='TIMERANGEBASE') TIMERANGEBASELABEL = WIDGET_LABEL( TIMERANGEBASE, $ UVALUE='TIMERANGEBASELABEL', $ VALUE='TIME STEP RANGE:') I1FIELD = CW_FIELD( TIMERANGEBASE,VALUE=i1, $ ROW=1, $ INTEGER=1, $ RETURN_EVENTS=1, $ TITLE='First:', $ UVALUE='I1FIELD', $ XSIZE=5) I2FIELD = CW_FIELD( TIMERANGEBASE,VALUE=i2, $ ROW=1, $ INTEGER=1, $ RETURN_EVENTS=1, $ TITLE='Last: ', $ UVALUE='I2FIELD', $ XSIZE=5) ALLTIMESTEPSBUTTON = WIDGET_BUTTON( TIMERANGEBASE, $ UVALUE='ALLTIMESTEPSBUTTON', $ VALUE='ALL TIME STEPS') MONITORRANGEBASE = WIDGET_BASE(PLOTRANGEBASE, $ COLUMN=1, $ FRAME=1, $ MAP=1, $ TITLE='MONITOR RANGE BASE:', $ UVALUE='MONITORRANGEBASE') MONITORRANGEBASELABEL = WIDGET_LABEL( MONITORRANGEBASE, $ UVALUE='MONITORRANGEBASELABEL', $ VALUE='MONITOR RANGE:') J1FIELD = CW_FIELD( MONITORRANGEBASE,VALUE=j1, $ ROW=1, $ INTEGER=1, $ RETURN_EVENTS=1, $ TITLE='First:', $ UVALUE='J1FIELD', $ XSIZE=4) J2FIELD = CW_FIELD( MONITORRANGEBASE,VALUE=j2, $ ROW=1, $ INTEGER=1, $ RETURN_EVENTS=1, $ TITLE='Last: ', $ UVALUE='J2FIELD', $ XSIZE=4) ALLMONITORSBUTTON = WIDGET_BUTTON( MONITORRANGEBASE, $ UVALUE='ALLMONITORSBUTTON', $ VALUE='ALL (1-214/218)') TIMERANGEBASE = WIDGET_BASE(PLOTRANGEBASE, $ COLUMN=1, $ FRAME=1, $ MAP=1, $ TITLE='N RANGE BASE:', $ UVALUE='TIMERANGEBASE') NRANGELABEL = WIDGET_LABEL( TIMERANGEBASE, $ UVALUE='NRANGELABEL', $ VALUE='N-RANGE:') Z1FIELD = CW_FIELD( TIMERANGEBASE,VALUE=z1, $ ROW=1, $ FLOAT=1, $ RETURN_EVENTS=1, $ TITLE='Lower:', $ UVALUE='Z1FIELD', $ XSIZE=6) Z2FIELD = CW_FIELD( TIMERANGEBASE,VALUE=z2, $ ROW=1, $ FLOAT=1, $ RETURN_EVENTS=1, $ TITLE='Upper:', $ UVALUE='Z2FIELD', $ XSIZE=6) DEFAULTENERGYZRANGEBGROUP = CW_BGROUP( TIMERANGEBASE,['12 GeV','27 GeV' ] , $ ROW=1, $ UVALUE='DEFAULTENERGYZRANGEBGROUP') SLICEBASE = WIDGET_BASE(PLOTRANGEBASE, $ COLUMN=1, $ FRAME=1, $ MAP=1, $ TITLE='SLICE BASE:', $ UVALUE='SLICEBASE') SLICEBASELABEL = WIDGET_LABEL( SLICEBASE, $ UVALUE='SLICEBASELABEL', $ VALUE='SLICES:') IFIELD = CW_FIELD( SLICEBASE,VALUE=islice, $ ROW=1, $ INTEGER=1, $ RETURN_EVENTS=1, $ TITLE='Time i: ', $ UVALUE='IFIELD', $ XSIZE=4,YSIZE=1) JFIELD = CW_FIELD( SLICEBASE,VALUE=jslice, $ ROW=1, $ INTEGER=1, $ RETURN_EVENTS=1, $ TITLE='Monitor j:', $ UVALUE='JFIELD', $ XSIZE=4,YSIZE=1) SCALEFIELD = CW_FIELD( SLICEBASE,VALUE=scale, $ ROW=1, $ FLOAT=1, $ RETURN_EVENTS=1, $ TITLE='Scale:', $ UVALUE='SCALEFIELD', $ XSIZE=8,YSIZE=1) COLOURBASE = WIDGET_BASE(PLOTRANGEBASE, $ COLUMN=1, $ FRAME=1, $ MAP=1, $ TITLE='COLOUR TABLE BASE:', $ UVALUE='COLOURBASE') COLOURBASELABEL = WIDGET_LABEL( COLOURBASE, $ UVALUE='COLOURBASELABEL', $ VALUE='COLOUR TABLE:') COLORTABLESLIDER = WIDGET_SLIDER( COLOURBASE, $ DRAG=1, $ MAXIMUM=39, $ MINIMUM=0, $ TITLE='', $ UVALUE='COLORTABLESLIDER', $ VALUE=ColorTable, $ XSIZE=100) COLOUR0LABEL = WIDGET_LABEL( COLOURBASE, $ UVALUE='COLOUR0LABEL', $ VALUE=' 0 = greyscale') COLOUR29LABEL = WIDGET_LABEL( COLOURBASE, $ UVALUE='COLOUR39LABEL', $ VALUE='39 = rainbow') GAMMAFIELD = CW_FIELD( COLOURBASE,VALUE=gamma, $ ROW=1, $ FLOAT=1, $ RETURN_EVENTS=1, $ TITLE='Gamma:', $ UVALUE='GAMMAFIELD', $ XSIZE=5) ; Store widget IDs in otherwise unused top level base widget. ; The enables updating "related" widgets during event processing. info={ $ BLME:BLME,$ USEROPTIONSBASE:USEROPTIONSBASE,$ HELPBASE:HELPBASE,$ MAINBUTTONSGROUP:MAINBUTTONSGROUP,$ FILEBASE:FILEBASE,$ FILENAMEFIELD:FILENAMEFIELD,$ PICKFILEBUTTON:PICKFILEBUTTON,$ PRINTCOMMANDFIELD:PRINTCOMMANDFIELD,$ PRINTFILENAMEFIELD:PRINTFILENAMEFIELD,$ POSTSCRIPTOPTIONSBGROUP:POSTSCRIPTOPTIONSBGROUP,$ PRINTBGROUP:PRINTBGROUP,$ ANGLEBASE:ANGLEBASE,$ AXXFIELD:AXXFIELD,$ AZZFIELD:AZZFIELD,$ PLOTTYPEBGROUP:PLOTTYPEBGROUP,$ AUTOREPLOTBGROUP:AUTOREPLOTBGROUP,$ PLOTBUTTONGROUP:PLOTBUTTONGROUP,$ DRAW:DRAW,$ I1FIELD:I1FIELD,$ I2FIELD:I2FIELD,$ J1FIELD:J1FIELD,$ J2FIELD:J2FIELD,$ Z1FIELD:Z1FIELD,$ Z2FIELD:Z2FIELD,$ IFIELD:IFIELD,$ JFIELD:JFIELD,$ SCALEFIELD:SCALEFIELD,$ COLORTABLESLIDER:COLORTABLESLIDER,$ GAMMAFIELD:GAMMAFIELD $ } Widget_control, BLME,SET_UVALUE=info WIDGET_CONTROL, BLME, /REALIZE ; Get drawable window index and set current plot window COMMON DRAW_Comm, DRAW_Id WIDGET_CONTROL, DRAW, GET_VALUE=DRAW_Id WSET, DRAW_Id ; Open welcome page Welcome ; Activate event management of widgets. XMANAGER, 'BLME', BLME END Gruesse, Darren ************************************************************ *********** Darren Kelly, DESY -MPY-, Notkestr.85,22603 Hamburg, Germany Work:+49-40-8998-4571 <-!! NEW NUMBER UNTIL 30th Sep 98 AT DESY ! Fax:+49-40-8998-4305 Home: +49(40) 8227 4024 until 28th Sep thereafter +49 (40) 20976409. ************************************************************ ***********