Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!bionet!ames!haven!umd5!zben From: zben@umd5.umd.edu (Ben Cranston) Newsgroups: comp.sys.mac.programmer Subject: Re: Programming menus Summary: As currently implemented program gets control FIRST... Message-ID: <4973@umd5.umd.edu> Date: 6 Jun 89 20:00:43 GMT References: <1378@marvin.Solbourne.COM> <2005@husc6.harvard.edu> <23163@srcsip.UUCP> Reply-To: zben@umd5.umd.edu (Ben Cranston) Organization: University of Maryland, College Park Lines: 19 As currently implemented the program gets the command-keystroke BEFORE it is actually executed. This allows the program to bring lazy data structures up-to-date and make other preparations. For example, some years ago I hacked a Mac version of the Unix TALK stuff, using multi-panel windows a la user interface guidelines. Since whatever was pasted into the outgoing window was also being sent out, I went into great pains to force the selection of that window to the end of the text before allowing a paste into the window. If the command key stuff just did the paste, I would not have gotten control in time to force the selection to the end of text. A lot of the gore in Mac programming is just this way - it allows the program to get control and do what it has to do in various weird cases that, quite unfortunately, make the rest of us either memorize baroque standard handling sequences or go to skeletons like MacAPP... -- Ben Cranston (Kingdom of Merryland UniSys 1100/92) Copyright 1989 (you may redistribute ONLY if your recipients can).