Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!uwm.edu!linac!pacific.mps.ohio-state.edu!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!bin From: bin@primate.wisc.edu (Brain in Neutral) Newsgroups: comp.sys.mac.programmer Subject: Re: Disabling menus when DA's are closed Message-ID: <4017@uakari.primate.wisc.edu> Date: 7 Mar 91 18:45:46 GMT References: <1991Mar6.174029.4706@ni.umd.edu> Sender: bin@primate.wisc.edu Reply-To: bin@primate.wisc.edu Lines: 22 From article <1991Mar6.174029.4706@ni.umd.edu>, by zben@ni.umd.edu (Ben Cranston): > I call "fixmenu" on every activate and deactivate event. When the front > window changes you should get one or the other most of the time. The bad > case is when there are none of your windows at all and a DA comes and > goes. I could not think of a better solution than calling "fixmenu" > after EVERY call to SystemClick. This causes the menu bar to blink with > each DA click though. Do also have the problem that when you have only one window and it goes away, there is no deactivate? When I've tried to solve this problem, I think I ended up having to mess with menus on activates/deactivates and window closes. It's an ugly problem. There's no need to make the menu bar blink unnecessarily, though. Check bit 0 of the menu flags word to see what the state of a menu is, *then* figure out what it *should* be. If they differ, then you need to redraw the menu bar after the menu and its items are set properly, otherwise you don't need to. This way, the menu bar blinks only when a menu state changes. -- Paul DuBois dubois@primate.wisc.edu