Menu selected

Hi,

In the current documentation for 16R4, I see there is still this tip:

“Tip: Whenever possible, use methods associated with menu commands in an associated menu bar (with a negative menu bar number) instead of using Menu selected. Associated menu bars are easier to manage, since it is not necessary to test for their selection.”

I think the part “(with a negative menu bar number)” is an old way to do that (that’s what I remember). Now, we do that with the check box “active menu bar” which has this goal. The documentation only seems not to have been updated on that point.

But how do you do, when you want the current menu bar to be active when displaying the form, and do not want to add any additional bar?
– create one or several more menu bars (that you will never really use),
– associate the last one to your form,
– keep the “active menu bar” box checked,
– save the form
– remove the menu bar

“active menu bar” will still be checked, but the associated menu bar will be “none”. And it works. OK, we’ve been doing that fore decades, and it works. But I really do not understand why 4D does not make it easier, make it “normal” by simply displaying the “active menu bar” check box by default, without having to link an existing menu bar, and then delete it. Anyway…

Actually, I had to remember this old trick when facing a bug on 4D 16R4, with the Quit menu on macOS. Use a menu line with action “quit”, 4D will move it to the application menu, as expected, but there, it does not work, I don’t now why. Then, with an active form window, you can use “Menu selected” to quit, but without, it won’t quit. Seems strange (with R2, that I used previously, the same line works fine, but with R4, it does not). I think I’ll use the official way to alert on this bug, but I wrote a few lines about it here, to explain why I tried to play with old hacks about menus today…

Bye!