This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
New Guile module: guile-gtkthreads
- To: guile at sourceware dot cygnus dot com
- Subject: New Guile module: guile-gtkthreads
- From: Mikael Djurfeldt <mdj at mdj dot nada dot kth dot se>
- Date: Wed, 29 Mar 2000 17:15:15 +0200
- Reply-to: Mikael Djurfeldt <djurfeldt at nada dot kth dot se>
I've made the frist version of a new Guile module:
http://www.nada.kth.se/~mdj/guile-gtkthreads/guile-gtkthreads-0.1.0.tar.gz
or
cvs -z 9 -d :pserver:anoncvs@anoncvs.cygnus.com:/cvs/guile \
checkout guile/guile-gtkthreads
Here's the README:
This is a library for people who are using guile-gtk but prefer using
threads instead of an event loop.
Dependencies
------------
This library needs to be compiled with:
* libguile >2000-03-29 with thread support (--with-threads)
* guile-gtk
Getting started
---------------
(use-modules (gtk gtk) (gtk threads))
(define w (gtk-window-new 'toplevel))
(gtk-widget-show w)
(begin-thread (gtk-main)) ; this becomes the handler thread
Known problems
--------------
If the gtk commands above are placed after the handler thread is
started, nothing happens. The reason is that the handler thread is
waiting for events inside a `select'. Executing gtk commands won't
kick it out of this select.
guile-gtkthreads will be upgraded to handle such situations better:
The handler thread will be split in two: one event loop and one io
listener. The io listener sits in a select and signals a condition
variable to get the event loop to handle events. Every gtk command
will also signal the event loop.
There will still be the problem that a gtk command can set up new io
sources. The io loop won't know until it has processed next event
among the "old" io sources. If you can think of a solution to this
problem, I'm very interested (mailto:djurfeldt@nada.kth.se).
Until these problems has been fixed, guile-gtkthreads is still useful
if you make sure to start the handler late enough and make sure
yourself to call gtk to process any new events originating in new gtk
command calls.
Bugs reports
------------
Send bug reports to bug-guile@gnu.org.