Re: [gtkmm] Gdk::GC doesn't work as described



On Fri, 2002-12-06 at 04:30, Juan Linietsky wrote:
> Glib::RefPtr<Gdk::GC> MyGC;
> MyGC = Gdk::GC::create(drawingarea);
> 
> It used to be
> Gdk_GC MyGC;
> MyGC.create(drawingarea);
> 
> Beats me why it needs to be that more complicated, I am probably doing something wrong anyway.

The new way is far simpler and more consistent. You'll get used to it.
You can of course simplify your first line to:
Glib::RefPtr<Gdk::GC> refGC = Gdk::GC::create(drawingarea);

In particular, you should never need to worry about reference counting
in gtkmm2, just pass those RefPtrs around and let the RefPtr worry about
the details.

-- 
Murray Cumming
murray usa net
www.murrayc.com




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