Window MenuBar keeps resetting to none

On Xojo 2021 r1.1, I have a window in a project I have been working on for years. Suddenly, on Mac, when this window is shown, the mac’s menu bar and dock disappear.

I checked the window’s inspector and MenuBar is set to none. I set it back to the correct menu.

But randomly, the Menu Bar setting in the inspector reverts back to None. I do not change it.

I have no code that changes it. It just does it on its own. It just won’t stick.

Anybody have any experience with this and a possible workaround?

This happens ‘by design’ if the ‘menubar visible’ property of the window is unticked in the IDE.

randomly, the Menu Bar setting in the inspector reverts back to None.

No idea why that.

I haven’t seen this myself, but as a workaround, what if you tried assigning the MenuBar to the Window at runtime, like in the Window Open event. Something like:

Self.MenuBar = MainMenuBar

Hope that helps.

of note, in recent versions, the Menu Bar Visible property is Deprecated and has been moved to the Gear icon, so it’s easy to overlook…

image

Hmmm, You are right, I had not noticed that. And it was switched off. Switched it on, now let’s see if it sticks. Thanks,