[fpc-pascal] Timer in X11

zeljko zeljko at holobit.net
Thu Dec 22 11:04:28 CET 2011


On Thursday 22 of December 2011 09:43:28 Felipe Monteiro de Carvalho wrote:
> On Thu, Dec 22, 2011 at 9:15 AM,  <michael.vancanneyt at wisa.be> wrote:
> > As I understand it, Delphi and Lazarus implement the former, and don't
> > need a timeout for it.
> 
> Ops, you are correct, it is a one shot event:
> 
> http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate
> 2/EN/html/delphivclwin32/Forms_TApplication_OnIdle.html
> 
> I think I implemented it as a repetitive event. ops =D I guess I'll
> need to fix this.
> 
> But you should not try to compare directly the LCL gtk2 or qt4
> widgetsets with fpgui since gtk2 and qt4 do most of the real work.
> Lazarus now has a X11 interface which can be used for direct
> comparisons and it uses the timeout. In general I don't fully trust
> select() to wakeup correctly yet. I guess that more testing would show
> if it does, but I read in the web that X11 could use more then one
> file descriptor for communication, so if I use a infinite select() the
> application could hang in some corner cases.

FYI, qt and gtk2 uses same source for timers and loops - glib2.
http://en.wikipedia.org/wiki/GLib
http://developer.gnome.org/glib/2.26/glib.html
I would try with it before reinventing wheel, because it works on all X11 
platforms (even on OS/2 and BeOS) and I'm pretty sure that it's installed by 
default.

zeljko


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20111222/60edaf14/attachment.html>


More information about the fpc-pascal mailing list