Re: help on array of widgets

> 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
m_VBox.pack_start(&buttons[0], Gtk::PACK_SHRINK); // <-- not sure how to do it :(


Mj Mendoza IV,
Developer, KonsolScript

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