Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
94 user(s) are online (56 user(s) are browsing Forums)

Members: 1
Guests: 93

sailor, more...

Headlines

 
  Register To Post  

menu.class: Shared Menus?
Just popping in
Just popping in


See User information
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

Go to top
Re: menu.class: Shared Menus?
Just popping in
Just popping in


See User information
You mean like LendMenus()?

Go to top
Re: menu.class: Shared Menus?
Just can't stay away
Just can't stay away


See User information
@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.

The Rear Window blog

AmigaOne X5000 @ 2GHz / 4GB RAM / Radeon RX 560 / ESI Juli@ / AmigaOS 4.1 Final Edition
SAM440ep-flex @ 667MHz / 1GB RAM / Radeon 9250 / AmigaOS 4.1 Final Edition
Go to top
Re: menu.class: Shared Menus?
Just popping in
Just popping in


See User information
@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

Go to top
Re: menu.class: Shared Menus?
Just can't stay away
Just can't stay away


See User information
@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.

The Rear Window blog

AmigaOne X5000 @ 2GHz / 4GB RAM / Radeon RX 560 / ESI Juli@ / AmigaOS 4.1 Final Edition
SAM440ep-flex @ 667MHz / 1GB RAM / Radeon 9250 / AmigaOS 4.1 Final Edition
Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2023 The XOOPS Project