Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with events

Status
Not open for further replies.

Themuppeteer

Programmer
Apr 4, 2001
449
BE
Hello,
My event loop goes like this

while(1)
{
//....update windows

cout<<&quot;Length=&quot;<<XQLength<<endl;
while(XQLength())
{
//...handle events
}
XFlush(dis);

---------------------------------------

I have a small window bouncing around the screen with
move window,the window generates expose events to the
other windows on the screen that do not move.
The problem is,that the events are heaped up, and then
are all released at once. So my output is:

Length=0
Length=0
Length=0
Length=0
Length=0
Length=0
Length=0
Length=0
Length=0
Length=8045
--> so the box bounces, and deletes his background
until this point the box stops and the event handling
begins. :-(
Why don't I get my event immediately after the expose
should have happened?

Thnx a lot for you help.






The Muppeteer.

themuppeteer@hotmail.com

Don't eat yellow snow...
 
Of course I used XQLength(dis) (my mistake)
And perhaps I should also mention there are some
cout's in the loop and a usleep(20000);
(this to see if my expose function dates up the correct
parts of the screen)
Thnx. The Muppeteer.

themuppeteer@hotmail.com

Don't eat yellow snow...
 
Solved it :)

The cout's killed my system. I did not know they could slow down the program that much...
I removed the sleep to.
It works fine now. The Muppeteer.

themuppeteer@hotmail.com

Don't eat yellow snow...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top