[Lablgtk] Update of window through GMain.Timeout and "gdk_window_invalidate_rect"

Jacques Garrigue garrigue at math.nagoya-u.ac.jp
Thu Sep 16 01:34:20 CEST 2010

Dear Johan,

It should be sufficient to call
  w#misc#draw (Some rect)
with w the widget you are drawing on.
gtk_widget_draw calls gdk_window_invalidate_rect internally.


From: Johan Mazel <johan.mazel at gmail.com>

I am currently trying to learn lablgtk through translating this example (http://www.ralph-glass.homepage.t-online.de/clock/readme.html) in Ocaml.
The graphical part is working.
The code in python is using a timer (which can be added in Ocaml by GMain.Timeout.add) in order to launch periodically a function that update the window.
This function is called gtk.gdk.Window.invalidate_rect in PyGTK and gdk_window_invalidate_rect in GTK.
However, I cannot find any function by that name or a name close (eg. invalidate) in lablgtk.

I tried to call the rewriting of the whole window through the timer but it produces an hideous effect close to the vertical refresh on a CRT monitor.

Thanks in advance for your time.

Johan Mazel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ocamlcore.org/pipermail/lablgtk-list/attachments/20100916/bfcf5df8/attachment.htm>
-------------- next part --------------
Lablgtk mailing list
Lablgtk at yquem.inria.fr

More information about the Lablgtk-list mailing list