Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!uunet!cbmvax!cbmehq!cbmger!kbsaar!fjrei From: fjrei@kbsaar.UUCP (Franz-Josef Reichert) Newsgroups: comp.sys.amiga.programmer Subject: Re: Gadget "BUG" Message-ID: Date: 5 Jun 91 23:24:18 GMT References: <1991Jun05.081036.20165@disk.uucp> Organization: Private Amiga Site Lines: 39 In article <1991Jun05.081036.20165@disk.uucp> specter@disk.uucp (Byron Max Guernsey) writes: >I'm having a small problem with the gadget interface in a program I have >written. At times the gadgets seem to get offset:: when I click on one >gadget another gadget's operation is performed. I think it happens after >quickly clicking twice on one gadget. It extends to the system gadgets in >my window as well...the close gadget gets offset to where I click on it and >nothing happens, then I go down and click on a gadget in my window and it >closes the window. :) Obviously, you are not handling intuition messages properly. Make sure that your task has processed _all_ messages before going to sleep: while(1) { Wait(1L << mp->mp_SigBit); /* note this loop! */ while(msg = GetMsg(mp)) { /* copy relevant fields, e.g. */ class = msg->Class; code = msg->Code; /* ... */ /* here and now! */ ReplyMsg(msg); switch(class) { case GADGETUP: /* etc. */ } } } Otherwise, remaining messages may not be processed until a new one arrives. This will cause the "offset" you encountered. >Byron -- Best regards, Franz-Josef Reichert VOICE: +49 6805 7417 Kuchlingerstrasse 13 UUCP: ...uunet!cbmvax!cbmehq!cbmger!kbsaar!fjrei D-6601 Kleinblittersdorf GERMANY