[fpc-pascal] fpSelect() with very small timeout?

Graeme Geldenhuys graemeg.lists at gmail.com
Mon Oct 20 10:36:48 CEST 2008


On Mon, Oct 20, 2008 at 10:19 AM, Martin Schreiber <fpmse at bluewin.ch> wrote:
> [...]
> You could send a wakeup message to the X event queue if a widget has been
> invalidated instead of polling. See MSEgui lib/common/msegui.pas
> tguiapplication.invalidated and the postevent infrastructure for an example.

Thanks Martin.  I take it, your method would be a bit more efficient
than polling? Or wouldn't it make much difference because the event
loop keeps looping anyway?

For example: Using the wakeup event, it will simply break out of the
message handling a bit quicker. "if XPending(display) > 0" would have
a "else" part where it fires the OnIdle event and then breaks out.
Skipping (or making redundant) the "if needToWait ..." block of code.

Either way, I like your idea.

Regards,
  - Graeme -


_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/



More information about the fpc-pascal mailing list