Gtk::Widget.visible?

hi

in current ruby-gtk2 svn is Gtk::Widget.visible? changed? it gives
ArgumentError

irb
irb(main):001:0> require ‘gtk2’
=> true
irb(main):002:0> @passwd=Gtk::Entry.new
=> #<Gtk::Entry:0x2aaab12aa338 ptr=0xdd7020>
irb(main):003:0> p @passwd.inspect
“#<Gtk::Entry:0x2aaab12aa338 ptr=0xdd7020>”
=> “#<Gtk::Entry:0x2aaab12aa338 ptr=0xdd7020>”
irb(main):005:0> p @passwd.visible?
ArgumentError: wrong number of arguments(1 for 0)
from (eval):5:in initialize' from (eval):5:innew’
from (eval):5:in visible?' from (irb):5 from /usr/lib64/ruby/1.9.0/irb.rb:150:inblock (2 levels) in
eval_input’
from /usr/lib64/ruby/1.9.0/irb.rb:259:in signal_status' from /usr/lib64/ruby/1.9.0/irb.rb:147:inblock in eval_input’
from /usr/lib64/ruby/1.9.0/irb.rb:146:in eval_input' from /usr/lib64/ruby/1.9.0/irb.rb:70:inblock in start’
from /usr/lib64/ruby/1.9.0/irb.rb:69:in catch' from /usr/lib64/ruby/1.9.0/irb.rb:69:instart’
from /usr/bin/irb:13:in `’
irb(main):006:0>

thanks in advice,
balint

Hi,

In [email protected]
“[ruby-gnome2-devel-en] Gtk::Widget.visible?” on Sun, 18 May 2008
10:18:13 +0300,
Dobai-Pataky Bálint [email protected] wrote:

in current ruby-gtk2 svn is Gtk::Widget.visible? changed? it gives
ArgumentError

Ruby 1.9 can’t use module_eval from C. ([ruby-dev:34093])
We need to more works for ruby 1.9 but I think it will be
done in a release after the next release.

Here is a small workaround:
Index: glib/src/rbgobject.c

— glib/src/rbgobject.c (revision 3213)
+++ glib/src/rbgobject.c (working copy)
@@ -331,8 +331,11 @@
g_free(buf);
}

  • if (source->len > 0)
  • if (source->len > 0) {
  •    g_string_prepend(source, "self.module_eval do\n");
    
  •    g_string_append(source, "\nend");
       rb_funcall(klass, id_module_eval, 1, rb_str_new2(source->str));
    
  • }
    g_string_free(source, TRUE);
    }

Thanks,

kou

does that mean i should not try to use ruby1.9 with ruby-gtk2 yet?
i mean, if i work this around i’m gonna hit more like this?

Marc H. wrote:

if i work this around i’m gonna hit more like this?

I am not exactly sure where you are heading, but you are aware that
ruby-1.9 in itself can be considered unstable or experimental right now?

true, i didn’t mean to be offensive. apologies if it looked that way.
i just tried to ask, if the “module_eval from C” issue is affecting
other functionalities, or just the .visible? method.

if i work this around i’m gonna hit more like this?

I am not exactly sure where you are heading, but you are aware that
ruby-1.9 in itself can be considered unstable or experimental right now?

It will take some time for people to bring everything up to shape,
but if you are using unstable versions already then you should
expect things to not work here or there more readily.

I think even Rails does not work with ruby 1.9

Hi,

In [email protected]
“Re: [ruby-gnome2-devel-en] Gtk::Widget.visible?” on Sun, 18 May 2008
22:23:22 +0300,
Dobai-Pataky Bálint [email protected] wrote:

functionalities, or just the .visible? method.

It affects other methods too.
You will find some of them by running ruby1.9 with -w
option.

Thanks,

kou

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs