Path: utzoo!utgpu!water!watmath!clyde!bellcore!rutgers!mailrus!husc6!linus!dartvax!eleazar.dartmouth.edu!earleh From: earleh@eleazar.dartmouth.edu (Earle R. Horton) Newsgroups: comp.sys.mac.programmer Subject: Re: Menu Manager Bug...? Summary: '-' is different. Keywords: "feature" Message-ID: <9482@dartvax.Dartmouth.EDU> Date: 24 Jul 88 05:54:03 GMT References: <5005@husc6.harvard.edu> Sender: news@dartvax.Dartmouth.EDU Reply-To: earleh@eleazar.dartmouth.edu (Earle R. Horton) Organization: Dartmouth College, Hanover, NH Lines: 40 In article <5005@husc6.harvard.edu> singer@endor.UUCP (Rich Siegel) writes: >Consider the following code: > > AppendMenu(SpecialMenu, ' '); {create a dummy menu item} > SetItem(SpecialMenu, windowCount + 6, wPeek^.TitleHandle^^); > >If the window's name begins with a dash (-), the entire menu item is >a gray line. This would be correct behavior if the string was passed >to AppendMenu, but NOT for sSetItem. Inside Macintosh (Volume 1, page 357) >says: ... The described behavior occurs with System 2.0 running on a Mac Plus, and with all the 4.x systems, so it is nothing new. I think that the behavior is "correct" according to the documentation, but that the documentation is vague. Actually, the documentation is terrible (ptui!). Anybody at Apple reading this? My interpretation is that the minus sign as the start of a menu item's text means "Draw the gray line, just draw it." and that the effect of the "meta-characters" is in some sense different from the effect of the minus sign. Looking at it another way, meta-characters change some attribute of the menu item's text, while the minus sign specifies that the desired menu item is the gray line. I suggest quoting the text, making the menu item something like " '-file1' " or perhaps putting a space in front of it. This is actually a fairly common situation, as in the case of any program which uses a menu to switch between named document windows. It happens in MicroSoft Word 3.02, and probably in all Macintosh applications which have a menu consisting of window or file names which could start with '-'. It happens in MultiFinder's menu for open applications if you rename an application to start with '-' and then launch it under MultiFinder. I suggest that this is a "feature" of the present Menu Manager, and that you will have to code for it or you will get a "bug" in your program. Earle R. Horton. H.B. 8000, Dartmouth College, Hanover, NH 03755