Forum: Ruby-Gnome 2 Problems with Ruby 2.1 & Windows 8

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
77d853d2a3cc819ccb2140155b939fbe?d=identicon&s=25 Levi Levinsten (levi2)
on 2015-05-06 19:55
Hi, I've been trying to upgrade my workplaces ruby version from 1.8.6 to
2.1, and one of our most important projects is done in Gtk2.  I finally
have the gtk2 (2.2.5-x86-mingw32) installed properly in windows on ruby
2.1, but the code behavior is all wrong.  I first thought it was
just some small api changes, but I think now its a serious bug.

I've made a small program to demonstrate.

-----
require 'gtk2'

window = Gtk::Window.new()
window.set_default_size(200, 200)

window.signal_connect("destroy") do
  Gtk.main_quit
end

a = Gtk::VBox.new()

a.pack_start(Gtk::TextView.new())
a.pack_start(Gtk::Button.new())
a.pack_start(Gtk::TextView.new())

window.add(a)

window.show_all()
Gtk.main()
-----

If I click on any of the TextViews or the button, the focus gets stuck
on that widget and I can't click on any of the other widgets via mouse.
I have no idea why it would do that.  If anybody happens to have a clue
on how to fix this I would really appreciate it!  Otherwise I'll have to
give up on the upgrade and run everything on ruby 1.8.6 until the end of
time...

Edit:  Forgot to mention, I tried going back to the 2.1.0 gem and had
the same problem.  Any further back and the gem's don't seem compatible
with ruby 2.1.
77d853d2a3cc819ccb2140155b939fbe?d=identicon&s=25 Levi Levinsten (levi2)
on 2015-05-11 20:24
I did a bit more digging, trying different versions of GTK sans ruby
(running gtk-demo.exe) to see if I would have the same problem.  It
works fine until GTK 2.18, where it has the same problem as my ruby
code  (GTK 2.16 works fine).

Hmm, I'll keep thinking about this.
77d853d2a3cc819ccb2140155b939fbe?d=identicon&s=25 Levi Levinsten (levi2)
on 2015-05-11 21:49
In GTK 2.18, setting the environment variable GDK_NATIVE_WINDOWS fixes
it as well, but that doesn't seem to work in later versions or the ruby
gem.
77d853d2a3cc819ccb2140155b939fbe?d=identicon&s=25 Levi Levinsten (levi2)
on 2015-05-12 00:10
Man, I want to pull my hair out.  I can't find anyone else having the
same problems with GTK & Windows 8, so its probably something weird with
my system.  :(

Oh well.
77d853d2a3cc819ccb2140155b939fbe?d=identicon&s=25 Levi Levinsten (levi2)
on 2015-05-12 01:03
Problem solved.  I ran windows update and now everything magically
works.  Guess it was a bug in windows.  :)
This topic is locked and can not be replied to.