Re: Can multiple windows share the same menu bar? [message #31117] |
Thu, 13 June 2002 00:21 |
marc schellens[1]
Messages: 183 Registered: January 2000
|
Senior Member |
|
|
> ...
> 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.
Why don't you just put the code for creating the menu bar in
a separate procedure (with tlb_menu as the argument)?
HTH,
marc
|
|
|