[glade--] Code generation of buttons
André Offringa <[email protected]> Sat, 22 Mar 2008 23:20:52 +0100
| Newsgroups | gmane.comp.gnome.glademm |
|---|---|
| Message-ID | <[email protected]> |
Hello Glademm list,
I have an odd problem using glade-- to generate code... When I start a =
new project in Glade, add a new Window, then a new VBox and then a new =
Button in the VBox, the following code (part) is generated:
** part of generated window1_glade.cc: **
window1_glade::window1_glade(
)
{ window1 =3D this;
gmm_data =3D new GlademmData(get_accel_group());
button1 =3D Gtk::manage(new class Gtk::Button("button"));
vbox1 =3D Gtk::manage(new class Gtk::VBox(false, 0));
button1->set_flags(Gtk::CAN_FOCUS);
window1->add(*vbox1);
button1->show();
vbox1->show();
}
** end part **
But... vbox1->pack_start(*button1) should have been somewhere. When =
compiling and running this code, the button is not visible. This is also =
the case when placing buttons in the other containers. However, when I =
add the button directly to the Window, the Button does get added:
** part of generated window1_glade.cc: **
window1_glade::window1_glade(
)
{ window1 =3D this;
gmm_data =3D new GlademmData(get_accel_group());
button1 =3D Gtk::manage(new class Gtk::Button("button"));
button1->set_flags(Gtk::CAN_FOCUS);
window1->add(*button1); // <---
button1->show();
}
** end part **
Other components do get added to the VBox, such as labels. When I for =
example add a label and a button to the VBox, the following code is =
generated:
** part of generated window1_glade.cc: **
window1_glade::window1_glade(
)
{ window1 =3D this;
gmm_data =3D new GlademmData(get_accel_group());
label1 =3D Gtk::manage(new class Gtk::Label("label"));
button1 =3D Gtk::manage(new class Gtk::Button("button"));
vbox1 =3D Gtk::manage(new class Gtk::VBox(false, 0));
button1->set_flags(Gtk::CAN_FOCUS);
vbox1->pack_start(*label1); // <--
window1->add(*vbox1);
label1->show();
button1->show();
vbox1->show();
}
** end part **
So... Am I overlooking something terrible, or is this a bug?
Version info:
$ glade-- --version
glademm V2.6.0 (glade to Gtk-- converter)
$ glade-3 --version
glade3 3.4.3
(I'm using Debian Testing)
Kind regards,
Andr=E9 Offringa