Window.class and WINDOW_NewMenu

4 posts / 0 new
Last post
trixie
trixie's picture
Offline
Last seen: 7 months 1 week ago
Joined: 2011-02-03 13:58
Window.class and WINDOW_NewMenu

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! :-)

Rigo
Rigo's picture
Offline
Last seen: 2 years 6 months ago
Joined: 2011-01-24 21:55
Yes, when supplying a

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

trixie
trixie's picture
Offline
Last seen: 7 months 1 week ago
Joined: 2011-02-03 13:58
Re: Window.class and WINDOW_NewMenu

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

Rigo
Rigo's picture
Offline
Last seen: 2 years 6 months ago
Joined: 2011-01-24 21:55
No, if you only supply a

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

Log in or register to post comments