[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- Subject: Re: MBAR
- From: Ben Tupper <btupper(at)bigelow.org>
- Date: Tue, 24 Apr 2001 08:24:44 -0400
- Newsgroups: comp.lang.idl-pvwave
- Organization: Bigelow Laboratory for Ocean Sciences
- References: <3AE5617E.FF385D5D@aerosensing.de>
- Xref: news.doit.wisc.edu comp.lang.idl-pvwave:24664
I'm not sure that it is possible to have the Menu Bar have non-menu buttons.
The online help states that, 'This widget ID can then be used to fill
the menubar with pulldown menus.'
You can modify the code slightly (shown below) to make a mock menu bar.
I just tried the following on a MAC; it looks slightly different than
the typical menu bar (created by the top level widget base) but it
performs as you wish.
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
;create the base widget without retrieving a menu bar widget.
base = WIDGET_BASE(TITLE = 'My Menu')
;create your own base widget to serves as the menu bar
bar = WIDGET_BASE(base, ROW = 1)
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')
widget_control, base, /realize
xmanager, 'my_menu', base
"Dominic R. Scales" wrote:
> 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?
> How do I make the 'Done'-button bttn1 do what it is supposed to?
> P.S. and..., oh yes, /MENU seems to be the default
Bigelow Laboratory for Ocean Sciences
180 McKown Point Rd.
W. Boothbay Harbor, ME 04575