Mail Archives: djgpp/1997/04/11/19:02:53
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 -