Home  
Login
Username:

Password:

Remember me



Lost Password?

Register now!
Sections
Who's Online
77 user(s) are online (69 user(s) are browsing Forums)

Members: 0
Guests: 77

more...
Support us!
Recent OS4 Files
OS4Depot.net





menu.class: Shared Menus?
Just popping in
Joined:
2007/10/17 15:53
From VA, USA
Posts: 34
What's the situation with sharing menu objects among multiple active window objects?

I've got a program that can keep multiple windows open for various purposes, but I'd like the "program menu" to stay constant for the user no matter which window happens to be selected.

I've been attaching the same NewMenu-generated menu to each window and making sure to check for WMHIMenuPick on every window input.

That seems to work ok, but is this an acceptable way to do it?
The notes in autodoc window_cl.doc under the heading "IDCMP VERIFY EVENTS" are a bit confusing, but maybe indicated this is suspect?

Quote:
If we manage to establish some cooperation between Window Class and Menu Class, ...


This cooperation seems pretty necessary if this type of menu sharing is supported. If the user program is to be relieved of the job of tracking such sharing the menu object may want to be notified when a window is closed or iconified. It will need to track its clients in order to correctly remove the menustrip before window closing and to know when the menu itself can be disposed.

Any thoughts?

Tom

   Report Go to top

Re: menu.class: Shared Menus?
Just popping in
Joined:
2006/12/5 5:55
Posts: 93
You mean like LendMenus()?

   Report Go to top

Re: menu.class: Shared Menus?
Quite a regular
Joined:
2009/5/1 17:57
From Czech Republic
Posts: 937
@tbreeden
To share menus I simply attach the same menustrip to various windows. Always worked, and I've never heard about this being illegal. But the windows sharing the menu must reside on the same screen - LayoutMenus() will tie the menustrip to a particular VisualInfo, which is screen-dependent.

@Minuous
I think LendMenus() tries to do exactly this, i.e. to allow sharing menus (and menu events) between windows on different screens.

_________________
Smoke me a kipper, I'll be back for breakfast!
SAM440ep-flex @ 667MHz / 1GB RAM / Radeon 9250 / AmigaOS 4.1 Final Edition
   Report Go to top

Re: menu.class: Shared Menus?
Just popping in
Joined:
2007/10/17 15:53
From VA, USA
Posts: 34
@trixie
Quote:
To share menus I simply attach the same menustrip to various windows. Always worked, and I've never heard about this being illegal.


Thanks. That's what I thought, but always had the nagging feeling that it might be one of those things that, every 100th time or so, could get into a deadlock with Intuition.

Tom

   Report Go to top

Re: menu.class: Shared Menus?
Quite a regular
Joined:
2009/5/1 17:57
From Czech Republic
Posts: 937
@tbreeden

Quote:

Quote:
If we manage to establish some cooperation between Window Class and Menu Class, ...

This cooperation seems pretty necessary if this type of menu sharing is supported. If the user program is to be relieved of the job of tracking such sharing the menu object may want to be notified when a window is closed or iconified. It will need to track its clients in order to correctly remove the menustrip before window closing and to know when the menu itself can be disposed.

As I plan to confine all menu handling within the Menu Class (instead of overloading the already overloaded Window Class with yet another functionality), it would indeed be dandy if Window Class told the menu object that the window is about to close/iconify/uniconify/change screen. IMO this should be doable without much work on Rigo's part: for example, when the Window Class receives a WM_ICONIFY or WM_CLOSE, it can simply tell the menu object to detach the menu strip, and iconify/close the window physically after the menu class method returns.

_________________
Smoke me a kipper, I'll be back for breakfast!
SAM440ep-flex @ 667MHz / 1GB RAM / Radeon 9250 / AmigaOS 4.1 Final Edition
   Report Go to top





[Advanced Search]


Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project