# Gtk::Widget.visible?

**URL:** <https://www.ruby-forum.com/t/gtk-widget-visible/137919>\
**Category:** Ruby-Gnome 2\
**Created:** [May 18, 2008, 9:18am UTC](https://www.ruby-forum.com/t/gtk-widget-visible/137919 "2008-05-18T09:18:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/77aa72/32.png) [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Post date:** [May 18, 2008, 9:18am UTC](https://www.ruby-forum.com/t/gtk-widget-visible/137919/1 "2008-05-18T09:18:33Z")

</div>

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:in`new’  
from (eval):5:in `visible?' from (irb):5 from /usr/lib64/ruby/1.9.0/irb.rb:150:in`block (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:in`block 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:in`block in start’  
from /usr/lib64/ruby/1.9.0/irb.rb:69:in `catch' from /usr/lib64/ruby/1.9.0/irb.rb:69:in`start’  
from /usr/bin/irb:13:in `’  
irb(main):006:0\>

thanks in advice,  
balint

---

<div class="post-metadata">

**Author:** ![Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/77aa72/32.png) [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Post date:** [May 18, 2008, 10:13am UTC](https://www.ruby-forum.com/t/gtk-widget-visible/137919/2 "2008-05-18T10:13:04Z")

</div>

Hi,

In [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
“[ruby-gnome2-devel-en] Gtk::Widget.visible?” on Sun, 18 May 2008  
10:18:13 +0300,  
Dobai-Pataky Bálint [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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

---

<div class="post-metadata">

**Author:** ![Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/77aa72/32.png) [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Post date:** [May 18, 2008, 11:24am UTC](https://www.ruby-forum.com/t/gtk-widget-visible/137919/3 "2008-05-18T11:24:41Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/77aa72/32.png) [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Post date:** [May 18, 2008, 9:29pm UTC](https://www.ruby-forum.com/t/gtk-widget-visible/137919/4 "2008-05-18T21:29:37Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/77aa72/32.png) [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Post date:** [May 18, 2008, 3:03pm UTC](https://www.ruby-forum.com/t/gtk-widget-visible/137919/5 "2008-05-18T15:03:55Z")

</div>

> 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

---

<div class="post-metadata">

**Author:** ![Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/77aa72/32.png) [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Post date:** [May 20, 2008, 4:30pm UTC](https://www.ruby-forum.com/t/gtk-widget-visible/137919/6 "2008-05-20T16:30:29Z")

</div>

Hi,

In [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
“Re: [ruby-gnome2-devel-en] Gtk::Widget.visible?” on Sun, 18 May 2008  
22:23:22 +0300,  
Dobai-Pataky Bálint [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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
