Re: help on array of widgets
- From: Mj Mendoza IV <mjmendoza ymail com>
- To: gtkmm-list gnome org
- Subject: Re: help on array of widgets
- Date: Wed, 27 Jul 2011 18:20:40 +0800 (SGT)
> If you are looking for a way to store your widgets in memory, you cannot
> put them directly in a vector, since vectors copy objects and widgets
> instances cannot be copied. You can instead store pointers to your widgets.
I tried making a vector of RefPtr, but how do I instantiate a widget in a RefPtr and placing it on a VBox?
std::vector<Glib::RefPtr<Gtk::Button> > buttons;
Glib::RefPtr<Gtk::Button> foo = Gtk::Button::Button("RefPtr Button", false); // <--- does not work
buttons.push_back(foo);
m_VBox.pack_start(&buttons[0], Gtk::PACK_SHRINK); // <-- not sure how to do it :(
Regards.Mj Mendoza IV,Developer, KonsolScripthttp://www.konsolscript.org
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]