Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!tut.cis.ohio-state.edu!ucbvax!bloom-beacon!eru!kth.se!cyklop.nada.kth.se!news From: d88-jwa@byse.nada.kth.se (Jon W{tte) Newsgroups: comp.sys.mac.programmer Subject: Re: Disabling menus when DA's are closed Message-ID: <1991Mar7.081215.9507@nada.kth.se> Date: 7 Mar 91 08:12:15 GMT References: <1.27D17B52@mmug.edgar.mn.org> <3BRcy1w163w@shark.cs.fau.edu> <1991Mar6.074201.13324@nada.kth.se> <1991Mar6.174029.4706@ni.umd.edu> Organization: Royal Institute of Technology, Stockholm, Sweden Lines: 62 In article <> zben@ni.umd.edu (Ben Cranston) writes: >> Bzzzzt. I'm sorry. You were all very close, but step down behind >> the curtains and we'll have some fabulous consolation prizes for >> you. >Mighty gratuitous, especially since you COMPLETELY misunderstood the >actual subject of this thread... Hmm... yeah... Well, I don't like TV much anyway :-) >thread is making the menu TITLES, which are visible ALL THE TIME, dim >and light. According to user interface rules when all the choices are Ooops. I forgot to say, call it at every (de)activate event... >As I said in private mail to the original poster, I've approached this >problem by writing a "fixmenu" routine that examines FrontWindow and >I call "fixmenu" on every activate and deactivate event. When the front >Sorry, I cannot think of a better solution than trapping a changing >FrontWindow in the main event loop that will handle all cases. If >anybody out there UNDERSTANDS the problem and has a better solution >please post it. Well, now that I _UNDERSTAND_, please let me suggest: On deactivate: set a "clear menu flag" to 3 On activate: Hilight menu titles as appropriate In event loop: Decrease flag one. If _transition to 0_ occurs disable menu. If user clicks in menu _after_ deactivate but _before_ "clear menu flag" goes up, make an explicit check. This way, you usually don't have a menu that flickers on/off at each window change, but still behaves reasonably well. (except for a menu title that goes from black to grey when clicked upon _if_ the user clicks on the item within 1/20th of a second after he closed the last window. Yeah.) Or you could continuously monitor FrontWindow through your event loop, and check the windowKind field when _that_ changes (if you don't trust the mac to bring you activate and deactivate events for DAs...) Gee, or you could use the Think Class Library and forget about all that stuff, as I have :-) h+@nada.kth.se Jon W{tte -- "The IM-IV file manager chapter documents zillions of calls, all of which seem to do almost the same thing and none of which seem to do what I want them to do." -- Juri Munkki in comp.sys.mac.programmer "The IM-IV file manager chapter documents zillions of calls, all of which seem to do almost the same thing and none of which seem to do what I want them to do." -- Juri Munkki in comp.sys.mac.programmer