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

MBAR



Hi all,

  I have a question regarding MBAR:
    is it possible to have an entry at the main level of mbar 
    acting as simple button and not as start of a menu?
    or
    How do I make the 'Done'-button bttn1 do what it is supposed to?

Cheers,
       Dominic

P.S. and..., oh yes, /MENU seems to be the default

-------

pro my_menu_event, ev

  widget_control,  ev.id,  get_uvalue=uval

  case uval of
    'OPEN'  : print, uval
    'PRINT' : print, uval
    'DONE'  : widget_control, ev.top, /destroy
    else    :
  endcase

end


pro my_menu

  base       = WIDGET_BASE(TITLE = 'My Menu', MBAR=bar)
  f_menu     = WIDGET_BUTTON(bar, VALUE='File',  /MENU)
  file_open  = WIDGET_BUTTON(f_menu, VALUE='Open',  UVALUE='OPEN')
  file_print = WIDGET_BUTTON(f_menu, VALUE='Print', UVALUE='PRINT')
  file_done  = WIDGET_BUTTON(f_menu, VALUE='Done',  UVALUE='DONE')

  bttn1=WIDGET_BUTTON(bar, VALUE='Done',UVALUE='DONE')

  widget_control, base, /realize
  xmanager,  'my_menu',  base

end

-- 
Dipl. Phys. Dominic R. Scales | Aero-Sensing Radarsysteme GmbH
Tel:  +49 (0)8153-90 88 90    | c/o DLR Oberpfaffenhofen
Fax:  +49 (0)8153-908 700     | 82234 Wessling, Germany
WWW:  aerosensing.de          | email: Dominic.Scales@aerosensing.de