Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!cbmvax!ken From: ken@cbmvax.commodore.com (Ken Farinsky - CATS) Newsgroups: comp.sys.amiga.programmer Subject: Re: Boolean Gadget Mutual Exclusion? Message-ID: <18447@cbmvax.commodore.com> Date: 1 Feb 91 20:31:58 GMT References: <659@esosun.UUCP> <18431@cbmvax.commodore.com> Reply-To: ken@cbmvax.commodore.com (Ken Farinsky - CATS) Organization: Commodore, West Chester, PA Lines: 52 In article <18431@cbmvax.commodore.com> ken@cbmvax.commodore.com (Ken Farinsky - CATS) writes: >>The RKM says that you must use >>hit-select rather than toggle-select, and GADGIMMEDIATE >>rather than RELVERIFY when doing mutual exclusion with >>boolean gadgets. > >Mutual exclude gadgets are not supported through Intuition, you have to >use Gadtools or roll your own. If you create your own, then you can >make up the rules as you go along. The RKM shows one way to implement >this function. If you want a different functionality to your gadgets, >feel free to do so. > >The wording in the RKMs is a bit strong, clearly (as long as you follow >the rules) you can use any technique you want to get the desired result. >The "code police" will not come to get you if you use another technique. Ok, I have now talked to the new "Intuition Guru" (Peter Cherna), who informs me that my answer was not quite correct. Peter, jump right in if I miss anything here. GADGIMMEDIATE is specified as "required" due to problems with removing gadgets. When you create mutual exclude gadgets, your code has to spend a lot of time removing the gadgets, updating the state and refreshing the display. The problem is, under 1.3 at least, removing an active gadget can cause problems with intuition. If you use RELVERIFY, then the user can "hold down" the gadget, leaving it active for an extended period of time. This might be a problem if the user clicks on the gadget twice quickly, holding it down the second time. In this case, the code might try to remove the gadget (acting on the first message) while the gadget is active (the user is still holding it down.) Using GADGIMMEDIATE solves this problem, as the gadget does not have the extended active period. We could not come up with a definitive answer as to why hit-select gadgets were important, and it may be possible to create the behavior you want using toggle-select gadgets. Hit-select gadgets turn out to be simpler to use, as you know their state after they have been selected. You can probably create the desired actions by slightly modifying the recommended model, rather than trying to re-invent the wheel. If you follow the information in the RKMs, you will minimize the time you spend solving problems that have been encountered in the past. A lot of expertise has gone into the RKMs. We'll try to do a better job of documenting the reasoning behind the information in the next set. No, I do not have any information on the timing or the price of the next set of RKMs, but we are always working to improve the support we provide to developers. -- -- Ken Farinsky - CATS - (215) 431-9421 - Commodore Business Machines uucp: ken@cbmvax.commodore.com or ...{uunet,rutgers}!cbmvax!ken bix: kfarinsky