ThinkC Presenting TidyMenus

Relating to ThinkC Development

Crutch

Tinkerer
Jul 10, 2022
292
226
43
Chicago
I’m happy to share here TidyMenus (a.k.a. NoLabel 2.0) https://macintoshgarden.org/apps/tidymenus , a simple little Control Panel for System 7 and 8 that can:
  • Hide/Show the Help menu in all applications
  • Re-show the Help menu across all applications at any time, just by opening the Control Panel and unchecking the box, without restarting (this was the hard part — to my knowledge no other INIT/cdev offers this feature)
  • Hide/show the Label menu in the finder under System 7. The hidden Label menu appears and operates as a hierarchical submenu under the ‘File’ menu — as in System 8. You can pop it back to the menubar or return it to a submenu with no restart required.
  • Works correctly for non-English systems, unlike the original NoLabel
  • You can hide the Label menu “out of the box” just by opening the cdev and checking the box without installing anything or restarting (though of course you’ll want to install this if you want to keep the Label menu hidden permanently)
  • Pro tip: the ‘L’ or ‘H’/‘?’ keys in the control panel are shortcuts for the “Hide Label menu” and “Hide Help menu” checkboxes, respectively.
This is an update to the original NoLabel https://macintoshgarden.org/apps/nolabel , which I wrote in 2020. NoLabel simply allowed hiding the Label menu in the Finder under System 7 — something I always found pretty useless, especially on black-and-white compact Macs. I also like that without the Label menu, the menu bar just reads “File Edit View Special”, as it was meant to do dating back to 1984. 😊

Dev background for Toolbox nerds like me — reposted here from 68kmla for anyone interested:

The original NoLabel did something pretty (simple but) dumb — it patched _InsertMenu and checked the name of the menu being inserted vs. the word “Label” in English. As @8bitbubsy over at 68kmla pointed out this summer, of course that doesn’t work for non-English installs. Oops. This was easy enough to fix by just figuring out the Label menu’s ID (the Finder doesn’t use normal menu resources so this took a minute). @8bitbubsy also requested the ability to hide the Help menu — the quite nice vintage Helium extension could do this (by the way, I patched it in 2020 to remove the nagware screen, see https://macintoshgarden.org/apps/helium-211), but it felt silly to have to install a whole separate (bulky) cdev just for this purpose. Adding the ability to hide the Help menu after a restart was easy enough and I did it in about an hour.

Then I started wondering — could I make it possible to show the Help menu again, across all applications, including those already running, without a restart? The answer is yes, though it required about 100x more work and some deep sleuthing inside the Menu Manager to work out how to stash and replace each application’s (possibly-unique … since apps can add their own items to the standard Help menu, as the Finder does) Help menu, regarding which see my partial notes posted here https://68kmla.org/bb/index.php?threads/weird-facts-about-the-menu-manager.45167/. The approach I took is to:
  • Prevent the System’s Help menu from being added to any newly-launched applications by removing it from the undocumented SystemMenuList (and saving a handle to it)
  • Hide the front application’s Help menu by hiding it in the “hierarchical” portion of the MenuList
  • Patch _HMGetHelpMenuHandle (i.e. really patch _Pack14 and check a selector) to return the appropriate handle (to the system’s, or possibly overridden app-specific, version of the Help menu) when an app asks for it, even if it’s hidden
  • Patch _SetMenuBar, _GetMHandle, and _InsertMenu to ensure the Help menu ends up in the right place (hidden or shown) when someone tries to get or add it, and do some other needed housekeeping
  • Patch _DrawMenuBar so apply the above to any already-running applications the user switches to after making a change
TidyMenus should work under any flavor of System 7 or 8. (Of course, System 6 doesn’t have a Help menu [and the ‘Color’ menu only appears on color monitors anyway]). I haven’t/won’t tried MacOS 9 but am curious if it would work.

Commented source code will be released in the fullness of time, whenever I figure out GitHub and a nice way to tie vintage 68k THINK C projects to it.
 

Attachments

  • IMG_0162.jpeg
    IMG_0162.jpeg
    347.8 KB · Views: 46