Raising the abstraction level



tiggr@gerbil.org (Pieter Schoenmakers) writes:

>    I still think that raising the programming level is the right approach
>    in this context.
> 
> I agree.

Me too.
 
> <obtopic>
> It's a pitty that Gdk/Gtk do reference counting.

Why do you think that?  What should it do instead?  I know from
lurking here that you must have some experience with `raising the
programming level', so I really want to know.

The ref counting stuff is in fact intended to raise the abstraction
level.  It gives you an abstraction to do proper resource management.

> It is even more a pitty that the Gdk objects (and some of the Gtk
> objects) do not have some common superclass, like GtkObject is for a
> lot of Gtk classes.  Now there are 12 different *_ref functions, to
> name but one deficiency.

The 12 functions aren't different.  They all do the same thing, albeit
for different types.  There are not 12 different reference counting
schemes in place.  It's just one, but you have to remember that you
have to use gtk_font_ref for GdkFonts and gdk_pixmap_ref for
GdkPixmaps, for example.  This is because it is a C API to Gtk+.  I'm
sure other language bindings do it differently.  Gtk-- probably has
unified access to reference counting by using C++'s overloading
features.



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