Re: When and when not to use Glib::RefPtr?



On Tue, 2005-04-05 at 21:57 +0000, Matthias Kaeppler wrote:
> Hello,
> 
> is there a general rule of thumb which classes require access through a
> Glib::RefPtr? For example, based on the gtkmm tutorial, a TreeModel is
> constructed directly, while a TreeView is handled through a RefPtr.

It's the other way around.

>  What's the
> point?

Any gtkmm/glibmm class that has no public constructor, but which has
public static create() functions, can only be used via RefPtr. You have
no choice.

In general, stuff that derives from Glib::Object must be used via
RefPtr, apart from things that derive from Gtk::Object, which should not
be used via RefPtr.

-- 
Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com




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