From: kutch AT moop DOT csse DOT muroran-it DOT ac DOT jp (Patrick G. Kutch) Newsgroups: comp.os.msdos.djgpp Subject: Compiler bug in Allegro? Shawn, DJ? Date: Fri, 11 Apr 1997 00:21:11 GMT Organization: Muroran Institute of Technology Lines: 46 Message-ID: <5ik06u$42q@yayrap.cc.muroran-it.ac.jp> NNTP-Posting-Host: moope.csse.muroran-it.ac.jp To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp I have been 'playing' with Allegro's (2.2) gui system, trying to add bitmap buttons and stuff like that. The first thing I did was to sit down and go through the existing code. 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: for (c=0; d[c].proc; c++) if ((mouse_x >= d[c].x) && (mouse_y >= d[c].y) && (mouse_x < d[c].x + d[c].w) && (mouse_y < d[c].y + d[c].h) && (!(d[c].flags & (D_HIDDEN | D_DISABLED)))) { mouse_object = c; break; } return mouse_object; Nothing too complex there, all i did was add a set of {} and a break. 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. If you make only the changes shown above and then re-compile. Both Ex13 and Ex14 will display odd behaviour. Specifically, for me anyhow, in EX13 the 'Toggle me' button's focus is not consistant when simply passing the mouse over the button. Same thing when the dialog exits, the alert's button focus act's add. In EX14 you can see similar problems. At first, I thought it might be some optimization bug I was unaware of, so I have re-compiled with and without DEBUGMODE set in the Allegro makefile and the results were the same. So, I am at a loss and looking to those much more knowledgeable than I for some assistance. Thanx, - Patrick