Three new event handling functions are now available: pgCheckEvent(),
pgDispatchEvent(), and pgEventPoll(). They are documented in the doxygen manual
and should be put on the web site by the cron job tonight.
Here's a quick overview:
- int pgCheckEvent(void)
Returns the number of events waiting in the app's event queue
- void pgDispatchEvent(struct pgEvent *evt)
Dispatches the given event to all applicable app-defined and builtin handlers
- void pgEventPoll(void)
A non-blocking version of pgEventLoop(). In case you were curious, it's
implementation's pretty simple:
------8<------
void pgEventPoll(void) {
/* This is like pgEventLoop, but completely nonblocking */
while (pgCheckEvent()) {
struct pgEvent evt = *pgGetEvent();
pgDispatchEvent(&evt);
}
}
------>8------
These new functions can be used to concentrate on a particular task (instead of
waiting for events) but still poll for PicoGUI events when convenient. The
"animbutton" example has been modified to use pgEventPoll() for much faster
animation.
--
Only you can prevent creeping featurism!
_______________________________________________
Pgui-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/pgui-devel