# Gtk3 scratch, on Windows

**URL:** <https://www.ruby-forum.com/t/gtk3-scratch-on-windows/235444>\
**Category:** Ruby-Gnome 2\
**Created:** [June 21, 2013, 7:35pm UTC](https://www.ruby-forum.com/t/gtk3-scratch-on-windows/235444 "2013-06-21T19:35:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![alcina](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a587f6/32.png) [@alcina](https://www.ruby-forum.com/u/alcina)\
**Post date:** [June 21, 2013, 7:35pm UTC](https://www.ruby-forum.com/t/gtk3-scratch-on-windows/235444/1 "2013-06-21T19:35:58Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![raubarede](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/d07c76/32.png) [@raubarede](https://www.ruby-forum.com/u/raubarede)\
**Post date:** [June 23, 2013, 7:23am UTC](https://www.ruby-forum.com/t/gtk3-scratch-on-windows/235444/2 "2013-06-23T07:23:29Z")

</div>

Hi,

In [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
“[ruby-gnome2-devel-en] Gtk3 scratch, on Windows” on Fri, 21 Jun 2013  
19:35:58 +0200,  
Regis d’Aubarede [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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

> **[All versions of gtk3 | RubyGems.org | your community gem host](https://rubygems.org/gems/gtk3/versions)**

“x86-mingw32” platform gems are for Windows.

## Thanks,

kou

---

<div class="post-metadata">

**Author:** ![raubarede](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/d07c76/32.png) [@raubarede](https://www.ruby-forum.com/u/raubarede)\
**Post date:** [August 15, 2013, 5:11pm UTC](https://www.ruby-forum.com/t/gtk3-scratch-on-windows/235444/3 "2013-08-15T17:11:21Z")

</div>

Hi,

2013/6/26 Regis d’Aubarede [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> 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:  
[https://github.com/ruby-gnome2/ruby-gnome2/issues/173#issuecomment-22698571](https://github.com/ruby-gnome2/ruby-gnome2/issues/173#issuecomment-22698571)

## Thanks,

Masafumi Y.  
GitHub: myokoym

---

<div class="post-metadata">

**Author:** ![raubarede](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/d07c76/32.png) [@raubarede](https://www.ruby-forum.com/u/raubarede)\
**Post date:** [June 26, 2013, 3:33pm UTC](https://www.ruby-forum.com/t/gtk3-scratch-on-windows/235444/4 "2013-06-26T15:33:37Z")

</div>

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 method`prepend\_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

---

<div class="post-metadata">

**Author:** ![raubarede](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/d07c76/32.png) [@raubarede](https://www.ruby-forum.com/u/raubarede)\
**Post date:** [August 16, 2013, 4:10pm UTC](https://www.ruby-forum.com/t/gtk3-scratch-on-windows/235444/5 "2013-08-16T16:10:27Z")

</div>

> 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](https://github.com/ruby-gnome2/ruby-gnome2/issues/173#issuecomment-22698571)

that’s work,  
thank you,
