TomF changes for gnucash-gnome2-dev, 8th batch

TomF TomF at sjpc.org
Tue Apr 1 03:12:00 CST 2003


Derek,

I checked .h files for g_object_ref() and GTK_OBJECT().
GTK_OBJECT does a cast, as you said.  However, I found the following:

/usr/include/gtk-2.0/gtk/
/aquicklist/gnome/glib-2.0.6/
find /aquicklist/gnome/glib-2.0.6/* -name \*.h -print | xargs grep
g_object_.*ref

/aquicklist/gnome/glib-2.0.6/glib/gtypes.h:
typedef void* gpointer; 
gpointer    g_object_ref   (gpointer       object); 
void        g_object_unref (gpointer       object);

If I remember C well enough, the patch will compile and run correctly as
is.  (This was part of batch 7, and the make errors involving ref/unref
disappeared when I made the changes.)  However, I also found:

The GTK+ type system and object system have been moved to GLib, as
"libgobject," and modified somewhat in transit. GtkObject still exists
for compatibility reasons, but should not be used as a base class for
new object implementations.

It's now encouraged to use GObject directly instead of GtkObject for
many operations. (However, the GtkObject functions still exist for
compatibility, so you don't have to change immediately.) 


I think we should leave the patch as is for now, but should put
converting to GObject on the list of cleanup tasks to be done later.


Tom




On 30 Mar 2003 22:34:19 -0500
Derek Atkins <warlord at MIT.EDU> wrote:

> I just started looking at this patch.  Are you sure this is
> correct:
> 
> -  gtk_object_ref (GTK_OBJECT (notebook->notebook));
> +  g_object_ref (GTK_OBJECT (notebook->notebook));
> 
> In particular, are you sure that g_object_ref() is supposed to get
> passed a GtkObject* pointer?  I just want to make sure this is
> correct before committing.  I would have thought that you would have
> to use G_OBJECT() instead of GTK_OBJECT()...
> 
> Does this change actually compile?
> 
> -derek
> 
> TomF <TomF at sjpc.org> writes:
> 
> > This is a combined batch for 7th and 8th.
> > 
> > _______________________________________________
> > gnucash-patches mailing list
> > gnucash-patches at lists.gnucash.org
> > https://lists.gnucash.org/mailman/listinfo/gnucash-patches
> 
> -- 
>        Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
>        Member, MIT Student Information Processing Board  (SIPB)
>        URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
>        warlord at MIT.EDU                        PGP key available


More information about the gnucash-patches mailing list