Gtk3 scratch, on Windows

Hello,

Using gtk3 on window, i get a bug (program scratch)
when resizing window (specially on resizing dialog window), with almost
all my Ruiby applications.

Here a scratch with an old gtk demo :

…\gtk3-2.0.2-x86-mingw32\sample\misc>ruby dialog.rb

dialog.rb:14:in `new’: ‘Gtk::Button#initialize(label_or_stock_id,
use_underline = nil)’ style has been deprecated. Use

…many deprecated…

**
GLib:ERROR:gmain.c:3057:g_main_dispatch: assertion failed:
(current->dispatching_sources == &current_source_link)

This application has requested the Runtime
to terminate it in an unusual way.
Please contact the application’s
support team for more information.

Hi,

In [email protected]
“[ruby-gnome2-devel-en] Gtk3 scratch, on Windows” on Fri, 21 Jun 2013
19:35:58 +0200,
Regis d’Aubarede [email protected] wrote:

…many deprecated…

**
GLib:ERROR:gmain.c:3057:g_main_dispatch: assertion failed:
(current->dispatching_sources == &current_source_link)

This application has requested the Runtime
to terminate it in an unusual way.
Please contact the application’s
support team for more information.

I got a related report. It seems that GTK+ 3 that is bundled
in gtk3 gem may be broken. (It is built by me on my Debian
GNU/Linux.)

The problem may be solved in the next release if I can build
GTK+ 3 Windows binary on my Debian GNU/Linux. Could you try
old gtk3 gems to find which version works well or doesn’t
work well? I know all gtk3 gems are broken or gtk3 2.0.2 gem
is only broken.

You can install and use old gtk3 gem by the following:

gem install gtk3 --version 2.0.1
type test.rb
gem “gtk3”, “= 2.0.1”
require “gtk3”

ruby test.rb

You can find all available gems at
https://rubygems.org/gems/gtk3/versions

“x86-mingw32” platform gems are for Windows.

Thanks,

kou

Hi,

2013/6/26 Regis d’Aubarede [email protected]:

i try your manipulation,
i have resize failure at 2.0.0.

I confirmed it, too.

for older version, i get this error a loading gtk3 :

gtk3-1.2.6-x86-mingw32/lib/gtk3/base.rb:13:in <top (required)>': undefined method prepend_environment_path’ for
GLib:Module (NoMethodError)

“GLib.prepend_environment_path” was changed to “GLib.prepend_dll_path”
since glib2-2.0.0.
It works if using the same version gems.

e.g.)
gem “glib2”, “= #{ARGV[0]}”
gem “atk”, “= #{ARGV[0]}”
gem “gdk_pixbuf2”, “= #{ARGV[0]}”
gem “pango”, “= #{ARGV[0]}”
gem “gio2”, “= #{ARGV[0]}”
gem “gdk3”, “= #{ARGV[0]}”
gem “gtk3”, “= #{ARGV[0]}”

However I found a workaround. If you hurry, please try this:

Thanks,

Masafumi Y.
GitHub: myokoym

hello kou,

i try your manipulation,
i have resize failure at 2.0.0.

for older version, i get this error a loading gtk3 :

gtk3-1.2.6-x86-mingw32/lib/gtk3/base.rb:13:in <top (required)>': undefined methodprepend_environment_path’ for
GLib:Module (NoMethodError)

==========================================================
if ARGV.size==0
$lversions=%w{2.0.2 2.0.2 2.0.1 2.0.1 2.0.0 2.0.0 1.2.6 1.2.6 1.2.5
1.2.5 1.2.4 1.2.3 1.2.2 1.2.1 1.2.0 0.0.1}

def check(version)
system(“gem”,“install”,“gtk3”,"–version",version)
5.times { puts }
r=system(“ruby”,“chkgtk.rb”,version)
5.times { puts }
print "seem to be #{r} : real return : " ; ret= STDIN.gets
ret && ret=~/[oyd]/i
end

def test(p0,dim)
iv=(p0+dim)/2
p [p0,iv,dim,$lversions[iv]]
version=$lversions[iv]
ok=check(version)
if p0>=dim
puts “pivot is version #{version} : #{ok}”
exit!(0)
end
ok ? test(p0,iv-1) : test(iv+1,dim)
end

test(0,$lversions.size-1)
else
gem “gtk3”, “= #{ARGV[0]}”
require ‘gtk3’
require ‘Ruiby’
Ruiby.app(title: ARGV[0]) do
stack {
buttoni(‘exit ok’,:height=>100) { exit!(0) }
label(ARGV[0],font: “Arial 25”)
label("Please resize me ",height: 200,width: 200)
after(1) { dialog { label(“Resize me too !”,height: 200,width:
200) ;} }
}
end
end

However I found a workaround. If you hurry, please try this:
scratch on windows when resize a dialog window · Issue #173 · ruby-gnome/ruby-gnome · GitHub

that’s work,
thank you,