From: Frank Murphy Date: 2002-05-08T05:45:58+09:00 Subject: Ruby/GTK with no window movement updates I'm just starting to play around with Ruby, especially with it's GTK bindings. But I'm having a problem being able to move a window from within the ruby script. What I want to do is when the "move World" button is pressed, to move the window to 0,0, then sleep for a small while, then move to 1,1 up to 50,50. What happens is that I get the "Moving World" output all at once, but the window doesn't move. Then the app waits (I assume 50 * 0.1 seconds), then I can see the window slide around where it should, too fast. If I comment out the window movement piece, the stdout seems to sleep the right amount. I initially put the sleep stuff into a Thread, but I got this same problem. Any ideas? Frank ---8<--- #!/usr/bin/ruby require 'gtk' window = Gtk::Window.new() button1 = Gtk::Button.new('Move World') button2 = Gtk::Button.new('Quit') vbox = Gtk::VBox.new(false, 0) vbox.pack_start button1, true, true, 0 vbox.pack_start button2, true, true, 0 button1.signal_connect('clicked') { 0.upto(50) do |i| window.set_uposition(i, i) print "Moving World\n" sleep(0.1) end } button2.signal_connect('clicked') { exit } window.set_title 'hello' window.add vbox button1.show button2.show vbox.show window.show Gtk.main