Magic MenuItems?

I’m on 2019R1.1 API 1… Monterey 12.6.8
I defined a Menu in the IDE with a View Menu:

But when I debugged the App in the IDE I got:

I Magically got Show and Hide Tab bar menu items…
and at the the end of ten menu I got an “Enter Full Screen” menuItem! (FullScreenButton is set to false on the Window)

Also Why do I have 2 window titles? I assume the smaller one is on a Tab Bar or some such, but I don’t want any of it!

I figured the OS must be doing this, but why and how can I stop it?

Thanks

  • Karen

As soon as i posted that I got an idea…

I changed the caption of the ViewMenu menuitem from, “View” to "View " (space at the end) and the extra menu items went away… but the “tab bar” (I think that is what it is ) is still there…

How do I get rid of it?

Thanks,
-Karen

Apple’s have spent a long time building up their App Kit to handle as many things automatically for you. Some things will be added automagically, some require some extra effort (like adding a Window menu).

In most cases when things are added automagically, you can override them by creating menu items with the same name, however not always.

1 Like

You can opt out of tab bars using this command. I’m not near my computer yet to give you the declares, but if you’re still in need I can do it later:

Hi Greg,
i don’t want to change the teh setting for all Windows, just this one. I would appreciate it.

Thanks,
-Karen

This should do it:

// @property NSWindowTabbingMode tabbingMode;
Declare Function getTabbingMode Lib "Foundation" Selector "tabbingMode" (obj As ptr) As Integer
Declare Sub setTabbingMode Lib "Foundation" Selector "setTabbingMode:" (obj As ptr, value As Integer)

Const automatic = 0
Const preferred = 1
Const disallowed = 2

setTabbingMode(self.Handle, disallowed)
2 Likes

Thank Greg, that solved the problem…

Which on closer inspection was bigger than I initially realized.

I have a container control on that window which is locked to all 4 sides… Inside the container I have controls that are also locked…

When the tab bar is added (so the widow header got taller) the bottom of the container control (so the horizontal scrollbar on the bottom of the container) winds up off the bottom of the window and so inaccessible…

It looks like the Xojo framework is simply not dealing with the smaller window content area caused by the OS auto addition of the Tab bar.

This happens in both 2019R1.1 and 2023R1.1 so it looks like Xojo has not considered the effect of this OS feature for Mac Apps in MacOS 12+.

If I am doing something that triggered the appearance the of tab bar, I have no clue what it is!

  • Karen

It’s true this tab bar doesn’t appear in a default project.