Submenu for context menu in NSTableViewMBS

If I use the following code in a ConstructContextualMenu of a Xojo listbox:

base.AddMenu new MenuItem("Delete", 1)
base.AddMenu new MenuItem("Upload", 2)

dim subMenu as new MenuItem("test")
subMenu.AddMenu(new MenuItem("bla"))
subMenu.AddMenu(new menuitem("blub"))


I get a submenu:

Using exactly the same code in a NSTableView I don’t get the submenus:

How do I get the submenus?

Xojo 2021.1 on High Sierra, MBS from 14.06.2021.

Does it help to keep references to the menu items?

No. Somehow the NSTableView is eating the submenu. I’ve changed to MouseDown/MouseUp and the submenus are now working fine.

Forum for Xojo Programming Language and IDE. Copyright © 2021 Xojo, Inc.