diff options
author | James Henstridge <james@daa.com.au> | 2002-07-07 14:31:43 +0000 |
---|---|---|
committer | James Henstridge <jamesh@src.gnome.org> | 2002-07-07 14:31:43 +0000 |
commit | 33f1cf2b5872279edb7b85c03e7828bff405759f (patch) | |
tree | b9fb9a3ca3ac4fbf0ca5d622e0306e408d5cdabe /gobject | |
parent | 416bdfd3ea663024bf44d7d58939565caa7c4f35 (diff) | |
download | pygtk-33f1cf2b5872279edb7b85c03e7828bff405759f.tar.gz |
add __grefcount__ property.
2002-07-07 James Henstridge <james@daa.com.au>
* pygobject.c (pygobject_get_refcount): add __grefcount__ property.
Diffstat (limited to 'gobject')
-rw-r--r-- | gobject/pygobject.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gobject/pygobject.c b/gobject/pygobject.c index da8d17c0..abcc0100 100644 --- a/gobject/pygobject.c +++ b/gobject/pygobject.c @@ -1,3 +1,4 @@ +/* -*- Mode: C; c-basic-offset: 4 -*- */ #include "pygobject-private.h" static const gchar *pygobject_class_id = "PyGObject::class"; @@ -249,7 +250,6 @@ pygobject_init(PyGObject *self, PyObject *args, PyObject *kwargs) PyObject *key, *item; gint pos = 0; GObjectClass *class; - gint retval = 0; if (!PyArg_ParseTuple(args, ":GObject.__init__", &object_type)) return -1; @@ -833,8 +833,15 @@ pygobject_get_dict(PyGObject *self, void *closure) return self->inst_dict; } +static PyObject * +pygobject_get_refcount(PyGObject *self, void *closure) +{ + return PyInt_FromLong(self->obj->ref_count); +} + static PyGetSetDef pygobject_getsets[] = { { "__dict__", (getter)pygobject_get_dict, (setter)0 }, + { "__grefcount__", (getter)pygobject_get_refcount, (setter)0, }, { NULL, 0, 0 } }; |