Forum: Ruby-Gnome 2 Gtk3 scratch, on Windows

B078cb4f4fb473c7a54d1fc36d10c70e?d=identicon&s=25 Regis d'Aubarede (raubarede)
on 2013-06-21 19:35
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.
Ee6ffca720cc428d70247dcd7377dd48?d=identicon&s=25 Kouhei Sutou (Guest)
on 2013-06-23 07:23
(Received via mailing list)
Hi,

In <c7760600875c4b55d0ef28ac84e3cfc8@ruby-forum.com>
  "[ruby-gnome2-devel-en] Gtk3 scratch, on Windows" on Fri, 21 Jun 2013
19:35:58 +0200,
  Regis d'Aubarede <ruby-forum-incoming@andreas-s.net> 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
B078cb4f4fb473c7a54d1fc36d10c70e?d=identicon&s=25 Regis d'Aubarede (raubarede)
on 2013-06-26 15:33
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
394f372e936f867e4e43bfd1315a0a4e?d=identicon&s=25 Masafumi Yokoyama (Guest)
on 2013-08-15 17:11
(Received via mailing list)
Hi,

2013/6/26 Regis d'Aubarede <ruby-forum-incoming@andreas-s.net>:
> 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/...


Thanks,
--
Masafumi Yokoyama
GitHub: myokoym
B078cb4f4fb473c7a54d1fc36d10c70e?d=identicon&s=25 Regis d'Aubarede (raubarede)
on 2013-08-16 16:10
> However I found a workaround. If you hurry, please try this:
> https://github.com/ruby-gnome2/ruby-gnome2/issues/...

that's work,
thank you,
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.