# Size of a Gtk::Expander

**URL:** <https://www.ruby-forum.com/t/size-of-a-gtk-expander/180330>\
**Category:** Ruby-Gnome 2\
**Created:** [December 17, 2009, 4:20pm UTC](https://www.ruby-forum.com/t/size-of-a-gtk-expander/180330 "2009-12-17T16:20:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![coubi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c68b51/32.png) [@coubi](https://www.ruby-forum.com/u/coubi)\
**Post date:** [December 17, 2009, 4:20pm UTC](https://www.ruby-forum.com/t/size-of-a-gtk-expander/180330/1 "2009-12-17T16:20:53Z")

</div>

Hi Gnomer!

I try to resize a window after I unexpand a Gtk::Expander. The window  
show a empty place where the hidden child of the expander is supposed to  
be. I do not know if it is the expected behaviour or a bug.

A quick code to demonstrate :

require ‘gtk2’

e=Gtk::Expander.new(“toto”)  
e.add(Gtk::Label.new(“toto”))  
w=Gtk::Window.new  
w.add(e)  
w.show\_all  
e.signal\_connect(‘activate’){|widget| w.resize(w.size[0], 1)}

Gtk.main

A quick workaround :

require ‘gtk2’

l=Gtk::Label.new(“toto”)  
e=Gtk::Expander.new(“toto”)  
b=Gtk::VBox.new  
b.pack\_start(e)  
b.pack\_start(l)  
w=Gtk::Window.new  
w.add(b)  
w.show\_all  
l.hide  
e.signal\_connect(‘notify::expanded’){|widget, foo|  
if widget.expanded?  
l.show  
else  
l.hide  
w.resize(w.size[0], 1)  
end  
}

Gtk.main
