[glade--] glade-- generates buggy code with Gtk::Image?



Hello and Happy New Year to the list.

I am new to this list, but not to glade. After over two years of
profitable usage of glade+libglademm as an interface designer, I tried
to experiment with glade-- as a code generator.

Now, if my interface includes a Gtk::Image widget, I get so many
(undocumented) problems that I wonder if anybody has met them already,
if it's a glade-- bug, or if I'm just missing some very obvious concept.

To replicate the problem, just create a new gtk+ project, select c++ as
language, create a window a put an image into it. Save the project,
build the source code, run autogen.sh and make:

window1_glade.cc: In constructor ‘window1_glade::window1_glade()’:
window1_glade.cc:53: error: ‘PixbufLoader’ is not a member of ‘Gdk’
...

Clearly, glade-- forgot to #include <gdkmm/pixbufloader.h>. Let's add it
in window1_glade.hh and run make again:

window1_glade.cc: In constructor ‘window1_glade::window1_glade()’:
window1_glade.cc:54: error: ‘_data’ was not declared in this scope

What? Glade-- is using _data without having declared it? Let's have a
"grep _data *.hh *.cc":

window1_glade.hh:        GlademmData *gmm_data;
window1_glade.cc:   gmm_data = new GlademmData(get_accel_group());
window1_glade.cc:   _image1_loader->write(_data, sizeof _data);
window1_glade.cc:{  delete gmm_data;

Indeed, _data is used, but never declared. Even if I declare and
initialize it somewhere, this is not what I want, because at startup I
still don't know what image I should load. Using a pixbuf loader seems
an unnecessary complication and source of bugs. Why not just
instantiating the Gtk::Image and letting the user load whatever image in
whatever fashion s/he prefers?

The temporary solution I found is: do not add the Gtk::Image using
glade; instead, do it manually in the constructor of window1. However,
I'd like to be able to add Gtk:Images direcly from glade. 

Any hints? BTW, here are the versions of my tools:

Gnome glade-2 2.12.0
glademm V2.6.0 
g++ (GCC) 4.0.2 20050808 (prerelease) (Ubuntu 4.0.1-4ubuntu9) [but using
older versions is the same]
autoconf (GNU Autoconf) 2.59
automake (GNU automake) 1.9.5
GNU Make 3.80
 pkg-config --modversion gtkmm-2.4
2.8.0

Thank you veeeery much!

albx









[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]