Can multiple windows share the same menu bar? [message #31147] |
Mon, 10 June 2002 06:00 |
jamesriouxctm
Messages: 2 Registered: June 2002
|
Junior Member |
|
|
Hello all,
I'm writing an IDL 5.5 application for the Macintosh platform. The
heart of the application is a base widget that defines a menu bar
(with the APP_MENU keyword, so it appears in place of the Mac system
menu) containing a few dozen options/commands. This TLB opens new
windows to display images, graphs, etc. These new windows are also
widgets, independent of the original TLB.
The problem is that, when one clicks on the newly opened window, my
custom menu bar disappears and is replaced with the IDL menu.
Returning focus to the main window restores the menu, of course, but I
would like it to stay displayed even when focus is set to the newly
opened window.
So what I'm asking is this: Is there a way to tell the newly opened
window that it should use the already-created menu bar and any event
handlers associated with that menu bar? I have tried passing the
original menu bar's widget ID to the new TLB when it is first created,
i.e.
TLB = WIDGET_BASE(APP_MENU=TLB_menu, [...])
...
[ add buttons to TLB_menu ]
...
new_TLB = WIDGET_BASE(GROUP_LEADER=TLB, APP_MENU=TLB_menu, [...])
but that doesn't work - I don't even get the IDL menu, but a nearly
blank one with only the Help option and the Apple menu.
I realize that I can achieve what I want by simply duplicating the
code that creates the menu bar inside my new widget, but that seems a
little heavy-handed (especially when it comes time to change one of
the options in the menu bar, because it will have to be changed in
five or six different places) and I just thought there might be a more
elegant way.
Thanks in advance,
James Rioux, CTM
University of New Brunswick MRI Centre
jamesriouxctm@hotmail.com
|
|
|