www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/04/11/19:02:53

Newsgroups: comp.os.msdos.djgpp
From: tob AT world DOT std DOT com
Subject: Re: Compiler bug in Allegro? Shawn, DJ?
Message-ID: <E8HsvL.CFx@world.std.com>
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?
<URL:http://world.std.com/~tob/presto10.zip>

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019