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

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

Le Sat, 17 Mar 2012 20:17:02 +0100,
“andrea” [email protected] 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

conclusion : use glade 3.8

regards

Simon

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