In a group of databases containing structured data, from which it is possible to analyse the tables to present it in a hierarchical manner, I find it useful to present that hierarchy as a menu tree — just as I almost always find a hierarchical menu (such as Classic Menu or Folder Glance) the quickest way to locate a file on my various hard drives. Therefore creating a menu tree for the data set I’m working on was a higher priority for me than a search form. And, thanks to LMSL, it was much easier than I expected: very straightforward to build each submenu as a text array, using the appropriate primary key as the name of each of the many nested submenus. The only temporary stumbling block was realising (which should have been obvious) that not only do all submenus have to be defined before the main menu, but all sub-submenus must be defined before the submenu to which they are attached, and so on up the tree. Therefore it’s important to assemble all submenus in the right order in the variable to be passed to ‘filemenubar’ (or whichever command).
In this particular dataset it’s important to be able to use italics for individual words within each menu item, therefore the ‘<i’ option in the menu item suffix, which renders the whole line in italic, isn’t appropriate. Therefore I decided to use RTML which again worked perfectly (because the relevant fields in the tables were already marked-up with RTML tags anyway) once I realised that I needed ‘@#RichText;’ in the suffix of each submenu title, not just that of the root menu.
However, this reveals a problem with the foreground colour of menu text. A normal Panorama X menu follows the usual MacOS colour-scheme. For MacOS 10.12, that is:
Normal mode: Black text (0x000000) on pale grey background (0xf6f6f6)
Dark mode*: White text (0xffffff) on dark-ish grey background (0x373737)
Highlighted menu item (in both cases): white text on mid-grey background (0x6f6f72)
* (System Preferences > General > Use dark menu bar and Dock)
However, when RTML is enabled using ‘@#RichText;’, the default foreground colour is always black, regardless of whether or not dark mode is selected, or whether the item is highlighted or not — and black text doesn’t show up well against a background colour of 0x373737.
Since I usually use dark mode, one way round this would be to add ‘color:ffffff’ to every item in every menu and submenu. However, that would be cumbersome, would make the menu variable significantly longer and the menu perhaps slower to display, and, most important, it would make the menus completely illegible if dark mode were then disabled (0xffffff on 0xf6f6f6 is not a good look — less than 4% difference between the colours!)
I can see the logic for enforcing a fixed default foreground colour when RTML provides the tag to enable colour to be changed selectively, just as HTML does. However, non-RTML menus also allow the foreground colour to be changed (of the whole menu item) yet observe the OS′s default black or white if it isn’t. Whether enabling RTML in a menu or not, it would be foolish to choose any foreground colour except one that would stand out against any likely background (e.g. bright red, 0xff0000). Speaking for myself, there are several markup options which I might consider applying to menu items apart from italic — bold, justification, etc.— but colour would not be one of them.
How easy would it be to tweak things to use the OS default foreground colour (white for highlighted items and black or white, as appropriate, for the rest) in RTML menus too?