I am aware that there are many people who have asked questions relating
to multi-threaded Gtk applications. However, after much trawling through
the Internet I still can’t work out why the following simple code will
not produce any output:
sleep 1 # Look busy
exit # Finished, exit
Process all currently pending events
Gtk.main_iteration while Gtk.events_pending?
It seems as if the sleeping thread is causing events to be fired,
because Gtk.events_pending? remains true the whole time. This doesn’t
sound right, but I can’t think of a better explanation for the code’s
behaviour. The problem is that the UI will freeze while the other thread
is running (I found this out whilst using Gtk.main, but a custom loop
displays the issue more clearly).
My Gtk wizardry is quite limited, so I would appreciate any help