nanogui: (apparently) strange event loop behaviour
Subject:
(apparently) strange event loop behaviour
From:
"Darin J. Nelson" ####@####.####
Date:
5 Dec 2000 20:14:49 -0000
Message-Id: <3A2D4D5A.50001@lizard.nwest.attws.com>
Hi everybody,
I'm writing a little PDA (iPAQ) app using microwindows (nano-x api) and
I have run into a problem I just cannot figure out. What I'm doing is
listening for events from the user as well as trying to update a clock
in the same app. Here's a code frag:
while(1)
{
printf("<EVENT> waiting for event\n");
GrGetNextEventTimeout(&event, 500L);
// GrGetNextEvent(&event);
printf("<EVENT> got event. processing\n");
switch(event.type)
{
case GR_EVENT_TYPE_BUTTON_DOWN:
fireNXWidgetCallback(event.button.wid, &event);
break;
case GR_EVENT_TYPE_BUTTON_UP:
fireNXWidgetCallback(event.button.wid, &event);
break;
case GR_EVENT_TYPE_EXPOSURE:
fireNXWidgetCallback(event.exposure.wid, &event);
break;
case GR_EVENT_TYPE_TIMEOUT:
updateStatus();
break;
case GR_EVENT_TYPE_CLOSE_REQ:
close_program();
}
}
The app is a hack of something called uBill (nanoBill) an xBill clone.
Basically I'm using it as an aide to teach myself microwindows. Anyway,
you'll see that GrGetNextEvent is commented out because I want to get a
timer event as well. Problem is that my screens don't seem to update
when using GrGetNextEventTimeout. Everything else looks right in the
code. I'm basically using a couple of offscreen windows, and when one
taps/clicks on a tab-like-thingy to change the 'mode', I switch the
exposed window with GrCopyArea.
My question is if there is something happening in the client or server
that I need to know about when I ask for an event/timeout? The only
sample code I've seen use the timeout routine is clock.c.
Thanks for any help,
darin