This is the first time I've used the WINDOW_NewMenu tag to create and display menus. I never use this tag because I find it impractical (de-iconification of the window always resets the menu strip to the original NewMenu structure setting, thus discarding all current-state menu changes like checked or disabled items). But this time I was being too lazy and my menu too simple, so I went ahead and gave it a chance.
Nice: just one line of code instead of the usual gadtools stuff. But the window.class documentation does not mention whether I am responsible for freeing the menu strip, or whether the class handles it automatically (just like it handles the creation).
A word from the gurus (Rigo, Steven) and a note in the autodoc would be greatly appreciated! :-)
Yes, when supplying a NewMenu, window.class will handle the disposal of the menus when the window closes.
You do not need to do anything.
Simon
Ah, good to know! But I guess I should still call ClearMenuStrip() before closing the window and disposing of the object?
AmigaOne X5000-020 / 2GB RAM / Sapphire Pulse Radeon RX 560 / AmigaOS 4.1 Final Edition Update 2
No, if you only supply a NewMenu structure to the window.class, you don't need to do anything, as I said above. It's all handled automatically.
Simon