I think the problem is that you create your widgets locally in the constructor.
So they get destroyed after the constructor is called(end of scope).
You should make them as private or protected variables of your class(in your
class implementaion).
> Date: Sun, 31 May 2009 14:13:37 +0200
> Subject: Troubles with containers
> From: [email protected]
> To: [email protected]
>
> Hi,
> I'm trying to build a small dialog for an othello / reversi game using
> gtkmm, here is the constructor of my Gtk::Dialog :
>
>
> NewGameDialog::NewGameDialog()
> {
> Gtk::Entry entry;
> Gtk::Label label("Name");
> Gtk::VBox vbox_a;
> vbox_a.pack_start(label, Gtk::PACK_SHRINK);
> vbox_a.pack_start(entry, Gtk::PACK_SHRINK);
>
> Gtk::RadioButton radiobtn_a("Human");
> Gtk::RadioButtonGroup group = radiobtn_a.get_group();
> Gtk::RadioButton radiobtn_b(group, "Bot (CPU)");
> Gtk::VBox vbox_b;
> vbox_b.pack_start(radiobtn_a, Gtk::PACK_SHRINK);
> vbox_b.pack_start(radiobtn_b, Gtk::PACK_SHRINK);
>
> Gtk::ComboBoxText combobox;
> combobox.append_text("Bot::Stupid");
> combobox.append_text("Bot::Normal");
> combobox.append_text("Bot::God");
> Gtk::HBox hbox_a;
> hbox_a.pack_start(vbox_b, Gtk::PACK_EXPAND_PADDING);
> hbox_a.pack_start(combobox, Gtk::PACK_EXPAND_PADDING);
>
> Gtk::VBox vbox_c;
> vbox_c.pack_start(vbox_a, Gtk::PACK_EXPAND_PADDING);
> vbox_c.pack_start(hbox_a, Gtk::PACK_EXPAND_PADDING);
>
> get_vbox()->add(vbox_c);
> set_default_size(268, 128);
> show_all();
> }
>
> currently the dialog is showing up with its correct size, but there's
> nothing in it.
> Can anyone help me with this ?
> _______________________________________________
> gtkmm-list mailing list
> [email protected]
> http://mail.gnome.org/mailman/listinfo/gtkmm-list
_________________________________________________________________
Έχετε Messenger; Έχετε και Windows Live. Μάθετε περισσότερα.
http://microsoft.com/windows/windowslive_______________________________________________
gtkmm-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/gtkmm-list