# Gtk::Builder can't handle new Gtk::Box definition

**URL:** <https://www.ruby-forum.com/t/gtk-builder-cant-handle-new-gtk-box-definition/217975>\
**Category:** Ruby-Gnome 2\
**Created:** [March 17, 2012, 8:17pm UTC](https://www.ruby-forum.com/t/gtk-builder-cant-handle-new-gtk-box-definition/217975 "2012-03-17T20:17:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [March 17, 2012, 8:17pm UTC](https://www.ruby-forum.com/t/gtk-builder-cant-handle-new-gtk-box-definition/217975/1 "2012-03-17T20:17:36Z")

</div>

Hi everyone,

it seems that the new version of Glade generates files in which  
Gtk::VBox and Gtk::HBox are replaced by a standard Gtk::Box with an  
orientation (vertical or horizontal) property.  
This seemingly breaks Gtk::Builder. An example follows:(interface  
definition, testib.glade)

\<?xml version="1.0" encoding="UTF-8"?\> \<!-- 

interface-requires gtk+ 3.0 --\> False  
 True False vertical   
  
  
  
  
(test program)–require ‘gtk2’

builder = Gtk::Builder.newbuilder.add\_from\_file(“testib.glade”)

objects = builder.objectsobjects.first.toplevel.show

Gtk.main  
–This results in a segfault. If “GtkBox” in the glade file is replaced  
with “GtkVBox” everything works as expected.

The error message is GLib-GObject-WARNING \*\*:cannot create instance of  
abstract (non-instantiatable) type `GtkBox’My guess is that builder  
tries to instantiate Gtk::Box (which is abstract) instead of the correct  
VBox or HBox. How can I fix this? I’ve tried to take a look at the  
source but I can’t find anything of use…

Andrea

---

<div class="post-metadata">

**Author:** ![ribbed21](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f9ae1b/32.png) [@ribbed21](https://www.ruby-forum.com/u/ribbed21)\
**Post date:** [March 21, 2012, 5:59pm UTC](https://www.ruby-forum.com/t/gtk-builder-cant-handle-new-gtk-box-definition/217975/2 "2012-03-21T17:59:21Z")

</div>

Le Sat, 17 Mar 2012 20:17:02 +0100,  
“andrea” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) a écrit :

> Hi everyone,
> 
> it seems that the new version of Glade generates files in which  
> Gtk::VBox and Gtk::HBox are replaced by a standard Gtk::Box with an  
> orientation (vertical or horizontal) property.

Yes. This has been discussed a few months ago :  
[http://www.ruby-forum.com/topic/2385140](http://www.ruby-forum.com/topic/2385140)

conclusion : use glade 3.8

regards

Simon
