First page Back Continue Last page Graphics
What's new: Glib::RefPtr<>
We can only ref and unref GObjects, and the C++ wrapper must stay alive as long as the C instance.
You don't care so use the RefPtr<> smartpointer.
For instance, Gdk::Bitmap can only be instantiated with a create() function:
Glib::RefPtr<Gdk::Bitmap> bitmap =
Gdk::Bitmap::create(window, data, width, height);
if(bitmap)
{
int depth = bitmap->get_depth().
}
Never ref/unref again.