Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!husc6!ut-sally!brian From: brian@ut-sally.UUCP Newsgroups: comp.sys.mac Subject: Finding out if there are no windows on the screen Message-ID: <8259@ut-sally.UUCP> Date: Sun, 14-Jun-87 19:24:28 EDT Article-I.D.: ut-sally.8259 Posted: Sun Jun 14 19:24:28 1987 Date-Received: Mon, 15-Jun-87 05:38:32 EDT Organization: U. Texas CS Dept., Austin, Texas Lines: 28 Keywords: Mac Programming Question Motivation: I'm writing a program that can have several windows and desk accessories on the screen. When there are no windows or DAs on the screen, I want the Close item in the File menu to be dimmed. The first thought is that it's easy. As you process the Close menu item, you just check to see if there are any windows left and if not, dim the menu item. But suppose the only window on the screen is a DA. If the user clicks the close box, the DA goes away, but the application is not informed. So here you are, left with an empty screen and an enabled Close item. The brute force method is to build the menu each time the user clicks in the menu bar. Is there a more elegant solution? Edit wimps out and never lets you choose "Close" when a DA is in front. MacWrite, however, handles it the way I want to. Thanks in advance for any help. Brian H. Powell UUCP: {ihnp4,seismo,ctvax}!ut-sally!brian ARPA: brian@sally.UTEXAS.EDU _Work_ _Not Work_ Department of Computer Sciences P.O. Box 5899 Taylor Hall 2.124 Austin, TX 78763-5899 The University of Texas at Austin (512) 346-0835 Austin, TX 78712-1188 (512) 471-9536