Newsgroups: comp.os.msdos.djgpp From: tob AT world DOT std DOT com Subject: Re: Compiler bug in Allegro? Shawn, DJ? Message-ID: Sender: tob AT world DOT std DOT com (Tom Breton) Reply-To: tob AT world DOT std DOT com Organization: BREnterprises References: <5ik06u$42q AT yayrap DOT cc DOT muroran-it DOT ac DOT jp> Date: Fri, 11 Apr 1997 21:26:08 GMT Lines: 28 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp kutch AT moop DOT csse DOT muroran-it DOT ac DOT jp (Patrick G. Kutch) writes: > I came across the find_mouse_object() and saw that it could be > optimized a little by simply adding a break after the object has been > found. So the routine now looks like this: > However, this causes all kind of problems. After doing this, the > routine doesn't seem to work properly. The focus will be lost while > definitley moving over a button. As others have pointed out, the logic previously was that the last valid object would be grabbed, you changed it to the first. It took me a minute to realize why this blew you up so badly, since the code didn't modify any object: Most dialogs start with d_clear_proc, which generally has a box that covers the entire screen. I'm pretty sure those examples you mentioned do. So *anywhere* on your screen, the mouse will think it has hit the d_clear_proc object. Ergo, your change would almost always finger the first object, which is practically useless. I suggest simply running the loop backwards, as another poster suggested, which will recreate the previous logic. Tom PS: Have you checked out my Presto dialog builder for Allegro?