Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!hoptoad!tim From: tim@hoptoad.uucp (Tim Maroney) Newsgroups: comp.sys.mac.programmer Subject: Re: What's wrong with this ModalDialog filterproc? Message-ID: <9420@hoptoad.uucp> Date: 28 Dec 89 20:34:16 GMT References: <10125@saturn.ucsc.edu> <9418@hoptoad.uucp> <10135@saturn.ucsc.edu> Reply-To: tim@hoptoad.UUCP (Tim Maroney) Organization: Eclectic Software, San Francisco Lines: 63 In article <10135@saturn.ucsc.edu> sirkm@ssyx.ucsc.edu (Greg Anderson) writes: >In article <9418@hoptoad.uucp> tim@hoptoad.UUCP (Tim Maroney) writes: >>And so on. You have an internationalization problem here. These codes >>are surely not the same under all langauges. > >IM I-53 and I-343 (and other places) state that Z, X, C and V _must_ >be used for undo, cut, copy and paste. However, I suppose that this >isn't possible to use these keys in non-roman systems, so you do have >a point. I've never seen it addressed before, though. Inside Mac volume 1 was written long before the Mac OS was ported to any non-Roman systems.... >>(If you didn't have an edit menu handy in the menu bar -- for instance, >>in a DA running under an application with an unknown edit menu id -- > >Unfortunately, this program is a DA. However, isn't the Edit menu always >the third menu on the menu bar, and the order of the items always Undo, >blank line, cut, copy, paste, clear by convention? Yes, but just go through any public software repositories (say a BBS or the BMUG archives) and you'll see these rules violated again and again. They shouldn't be violated, but you can't be sure that they won't be; you are a desk accessory that might be running under any harebrained program that the user acres to run. >You can get a copy >of the menu list with GetMenuBar, but paging through IM, I am at a loss >as to how one might use this information to step through the menu list >and examine what is there. All I need to know is the ID of the third menu! >(Frustration.) No, sorry, maybe in a better world than this one. If you do need to know this sometime, the information is on IM I-346. The MenuList is a variable sized relocatable array. >!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! >And if I cannot obtain this information, then how, praytell, can my DA >flash the EDIT menu when the user selects undo, cut, copy or paste? >!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! MenuKey does that for you. >>then you would have to keep a STR# resource to keep track of the >>appropriate shortcuts for editing.) > >This seems like a poor solution to a problem that should have a simple >answer--namely, finding the ID of any arbitrary menu. Programming is full of poor solutions that are also the only solutions. >Arg. Indeed. >So, has anyone else out there done anything like this with a DA? DA windows should be modeless in almost all cases, so I haven't. -- Tim Maroney, Mac Software Consultant, sun!hoptoad!tim, tim@toad.com If you vote for clowns, you have no right to complain that only clowns make it to the ballot.