[gtkmm] RefPtr and add function



I have a question to ask, maybe its a newbie mistake, and if it is I
apologize, but I can't find an answer to it anywhere.  Ive checked the
documentation and searched the mailing list, and didn't find the answer,
so I thought I would ask.

I make a button, like so

Glib::RefPtr<Gtk::Button> button = new Gtk::Button("Button!");

Now, how do I add this to a container?  For instance, the line

add(button);

Doesnt work, because its a pointer.

However, the line

add(*button);

doesnt work, because its a RefPtr, and it can't be directly dereferenced.

So how can I add it to a container?  Seems like RefPtr's usefulness would
be severly limited by this, so I figured there was some way to do it.  Any
help at all would be appreciated.

Pyroman[FO]





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