[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

widget-programming



hi there,

i am new in idl-programming and i have the following question/problem:

the widget i try to program has to open a menu so one can choose a file to
work with; this is done with  DIALOG_PICKFILE(/READ)

the source-code is below

however i am receiving this error-message:
> Expression must be a structure in this context: EVENT.
> % Execution halted at:  RMT_WIDGET_EVENT   13 rmt_widget_event.pro
> %                       $MAIN$

and i don't know what is wrong...

any suggestions?
thanx,
ralf
----------------------------------------------------------------------------
---------
source:

PRO rmt_widget_event, event

  WIDGET_CONTROL, GET_UVALUE = rmt_uval, event.id

  CASE rmt_uval OF
     "help" : labeling, 'sorry, not installed'
     "menuebar" : CASE event.value OF
       "File.Path" : path
       "File.Exit" : WIDGET_CONTROL, event.top, /DESTROY
    ENDCASE
  ENDCASE
END
;
;
PRO rmt_widget

  junk = {CW_PDMENU_S, flags:0, name:'' }


  MenuDescRMT = [$
   {CW_PDMENU_S, 1, 'File'},$
   {CW_PDMENU_S, 0, 'Path'},$
   {CW_PDMENU_S, 2, 'Exit'},$
   {CW_PDMENU_S, 3, 'Options'},$
   {CW_PDMENU_S, 0, 'Gittergroesse'},$
   {CW_PDMENU_S, 0, 'Plotparameter'} $
  ]

;
rmt_base = WIDGET_BASE(TITLE='RMT', /COLUMN)
;
  rmt_plot_base = WIDGET_BASE(TITLE='RMT-Plot', EVENT_PRO='rmt_event')
  rmt_plot_draw = WIDGET_DRAW(rmt_plot_base,XSIZE=800,YSIZE=600,RETAIN=2,$
    /MOTION_EVENTS, /BUTTON_EVENTS)
;
  panel1 = WIDGET_BASE(rmt_base, /ROW)
  pdmenu = CW_PDMENU(panel1, MenuDescRMT, /RETURN_FULL_NAME, $
    FONT='9x15bold', UVALUE='menuebar')
;
  WIDGET_CONTROL, rmt_base, /REALIZE
  WIDGET_CONTROL, rmt_plot_base, MAP=0
  WIDGET_CONTROL, rmt_plot_base, /REALIZE
  WIDGET_CONTROL, rmt_plot_draw, SENSITIVE=0
;
     XMANAGER, 'rmt_widget', rmt_base
;
END
;
;

PRO path

  path = DIALOG_PICKFILE(/READ)

END
;
;