From: Masao Mutoh Date: 2005-08-17T00:28:55+09:00 Subject: Re: Asynchronous events in GTK application? Hi, On Tue, 16 Aug 2005 08:26:15 +0900 Clifford Heath wrote: > That's what I did, I just didn't want to confuse the issue with too > much code. A bigger snippet of what I'm doing follows: > > device_change = false > Gtk.timeout_add(500) { > return true if (@busy) > device_change = true if checkDevice > true > } > while true > if device_change > processDeviceChange > device_change = false > end > puts "iteration" > p Gtk.main_iteration > end Usually, we use Gtk.timeout_add with Gtk.main something like as: Gtk.timeout_add(500) { return true if (@busy) if checkDevice processDeviceChange end true } Gtk.main It's not good idea to make mainloop by yourself. If you really need it, you need to learn GLib/GTK mainloops seriously. Though I don't recommand it. -- .:% Masao Mutoh