How does one create custom threads to run in a Gtk application?
Given this simplistic example:
@w = Gtk::Window.new "testtest"
@l = Gtk::Label.new "test"
@w.add @l
@w.show_all
Gtk.main
How could I run a thread like this?
Thread.start { loop { puts 'thread running'; @l.text = Time.now.to_s; sleep 1 }}
I got that timeout-based approach working with #timeout_add, but that isn't very nice and doesn't work for what I'm really trying to achieve: waiting for a dbus signal.
I've tried many things, each of which either hang the gtk thread or my own thread. I also tried using http://ruby-gnome2.sourceforge.jp/hiki.cgi?tips%5Fthreads but I'm not sure if it's actually the same problem)