A while ago I noticed that the context menu for NSTableViewMBS doesn’t show submenus: Submenu for context menu in NSTableViewMBS . Following that thread I switched to using MouseDown/MouseUp. This, however, has a side effect that the context menu is not shown when using the ctrl key. So I thought I would look at the topic again.
In EnableMenuitems of ListBoxTVContextMenu I found the following code:
dim base as new MenuItem
if owner._constructContextualMenu (base, System.MouseX, System.MouseY, row, col, me) then
for i as Integer = 1 to base.Count
dim item as ListBoxTVContextMenuItem = new ListBoxTVContextMenuItem (me, base.Item(i-1))
mItems.Append item
super.addItem item
next
end if
The items of the context menu (“base”) are added to ListBoxTVContextMenuItem. How do I find out which items are children of other items so that I can do a one-level submenu?