r7023 - hippo-canvas/trunk/python



Author: hp
Date: 2007-12-11 15:16:54 -0600 (Tue, 11 Dec 2007)
New Revision: 7023

Modified:
   hippo-canvas/trunk/python/canvas-box-child.c
Log:
make HippoCanvasBoxChild attributes work

Modified: hippo-canvas/trunk/python/canvas-box-child.c
===================================================================
--- hippo-canvas/trunk/python/canvas-box-child.c	2007-12-11 21:03:08 UTC (rev 7022)
+++ hippo-canvas/trunk/python/canvas-box-child.c	2007-12-11 21:16:54 UTC (rev 7023)
@@ -107,21 +107,24 @@
 static PyObject *
 _wrap_hippo_canvas_box_child__get_item(PyObject *self, void *closure)
 {
-    HippoCanvasItem *ret;
+    PyHippoCanvasBoxChild *py_child;
 
-    ret = HIPPO_CANVAS_BOX_CHILD(pygobject_get(self))->item;
+    py_child = (PyHippoCanvasBoxChild*) self;
+    g_assert(py_child->child);
+    
     /* pygobject_new handles NULL checking */
-    return pygobject_new((GObject *)ret);
+    return pygobject_new((GObject*) py_child->child->item);
 }
 
 static PyObject *
 _wrap_hippo_canvas_box_child__get_visible(PyObject *self, void *closure)
 {
-    gboolean ret;
-    
-    ret = HIPPO_CANVAS_BOX_CHILD(pygobject_get(self))->item;
+   PyHippoCanvasBoxChild *py_child;
 
-    return PyBool_FromLong(ret);
+    py_child = (PyHippoCanvasBoxChild*) self;
+    g_assert(py_child->child);
+ 
+    return PyBool_FromLong(py_child->child->visible);
 }
 
 static const PyGetSetDef hippo_canvas_box_child_getsets[] = {
@@ -191,7 +194,7 @@
 py_hippo_canvas_box_child_new(HippoCanvasBoxChild *child)
 {
     PyHippoCanvasBoxChild *obj = hippo_canvas_box_child_get_qdata(child, pyhippo_proxy_quark());
-    if (obj  == NULL) {
+    if (obj == NULL) {
 	obj = PyObject_NEW(PyHippoCanvasBoxChild, &PyHippoCanvasBoxChild_Type);
 
 	obj->child = child;



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