From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5cca94cb6ce39572 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-04-30 19:34:35 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed1.cidera.com!Cidera!news.inreach.com!53ab2750!not-for-mail Message-ID: <3EB087CF.8020006@telis.org> From: Rick Stikkers User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: XGrab Pointer does work...why??? References: <6091ca88.0304301711.61d724df@posting.google.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 30 Apr 2003 19:34:55 -0700 NNTP-Posting-Host: 209.209.67.232 X-Trace: news.inreach.com 1051756470 209.209.67.232 (Wed, 30 Apr 2003 19:34:30 PDT) NNTP-Posting-Date: Wed, 30 Apr 2003 19:34:30 PDT Organization: InReach Internet Xref: archiver1.google.com comp.lang.ada:36789 Date: 2003-04-30T19:34:55-07:00 List-Id: VNCoder wrote: >G'day all, > Using the Ada C-binding for Xlib (see below). After create a >window, I tried to grab the pointer immediately but it doesn't seem to >grab at all. > Only if I put a delay (sleep for few seconds) before I grab then it >works. > Anyone know what's happening?? > > > > > > You don't say what GUI builder, compiler, and platform you are using, but I have noticed similar behavior on a Rational VADS Ada 83 compiler under Solaris 2.6 using BXAda as a GUI builder. I'm not too sure if I'm correct, but it almost seems that the combined implementation for XWindows puts some of the X processing into a task. If you don't break out of the main processing, sometimes the additional background processing does not seem to have completed. I have also noticed problems when you attempt to put the X processing routines into a separate task. I've tried to do stuff that does not work when put into a task but the exact same code works in the main body of the program. I pretty much gave up on trying to figure that one out a long time ago. From my experience, you don't need a 5 second delay. As long as you put some kind of delay it will allow the other code to finish processing and it should run. I normally put a 0.01 second delay in and that seems to work fine for my applications. Rick