From: Michael B. <be...@ju...> - 2014-08-20 06:46:17
|
Hi, many thanks for your example. If I move the "th.join" into the last line, after Gtk.main, it works as expected: Prints a zero, displays the window, displays the next numbers. I will look into this. Cheers Michael Am Dienstag, den 19.08.2014, 16:26 +0200 schrieb Detlef Reichl: > #!/usr/bin/env ruby > > require 'gtk3' > > class Win < Gtk::Window > def initialize > super > button = Gtk::Button.new :label => 'click' > add button > button.signal_connect(:clicked) {p 'clicked'} > end > end > > th = Thread.new do > 0.upto(5) do |i| > p i > sleep 0.5 > end > end > th.join > > win = Win.new > win.show_all > Gtk.main |