Windowmenubar and custom context menus

Ah, yes, thank you. I was missing something obvious: variable scope.

On the subject of unfinished business, I arrived at a custom context menu in the data sheet because I need a popup menu with a heirarchy of submenus and, as you predicted would eventually happen, the temporary hack I mentioned in this thread five years ago no longer works:

I briefly thought there might be another solution, because I found the popupdoublefieldchoices command which does exactly what I was looking for — except, predictably, the submenus it generates don’t work.

I found the popupdoublefieldchoices procedure in _FormLib — which is useful anyway, because the code for generating the menus and submenus is much more compact, elegant and probably faster than my own. But essentially it’s doing the same as I was doing in the above thread: generating a series of menus and then using popupbutton to display them, which won’t work until the various popup menu commands can handle submenus.

This problem does come up in the forum from time to time. I know it’s difficult because the Apple code isn’t properly documented, but the OS makes extensive use of heirarchical popup menus, especially in the Finder, so is there any chance that this might be fixed one day?