Re: GtkGC shared auto-release



On Wed, 2007-12-12 at 09:49 +1100, Kevin Ryde wrote:

These couple of lines seem to work, and yes it has to be DESTROY, not
FINALIZE_INSTANCE (or so I believe and found).  But maybe there's an
easier way I haven't realized.  If the concept is sound enough what I
don't have is a particularly good name, something suggestive of release
or shared or pool, but still close to the GtkGC or Gtk2::GC which is its
basis.

For FINIALIZE_INSTANCE, you need to subclass with Glib::Object::Subclass
(or Glib::Type->register).  But that doesn't seem to be necessary.

How about calling the package Gtk2::Ex::GCPool or similar?  I think it
would also be cleaner if you separated the pool class from the custom
Gtk2::Gdk::GC class.  That is, have Gtk2::Ex::GCPool->get bless the gc
into Gtk2::Ex::GCPool::CustomGC and put the @ISA mangling and DESTROY in
that package.

-- 
Bye,
-Torsten




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