[pygtk] passing gtk image or pixbuf to C

Chris Camacho chris_camacho at yahoo.com
Sat Feb 28 20:27:04 WST 2009


so far I have

static PyObject* pyexttest_update(PyObject *self, PyObject *args) {

	guchar * pixels;

	PyGObject *py_widget;                         
	GtkWidget *widget;  
	PyTypeObject *pytype; 

	if (!PyArg_ParseTuple(args, "O!", &pytype,&py_widget))
		return NULL;
  	widget = GTK_WIDGET(py_widget->obj);
	pixels = gdk_pixbuf_get_pixels (GTK_WIDGET(widget));

        return Py_BuildValue("i", 0); // TODO return code

}

however when I try to call it I get

TypeError: argument 1 must be 

whats the correct way to pass a gtkwidget to C ?

Thanks



      


More information about the pygtk mailing list