diff finch/libgnt/pygnt/gnt.override @ 18724:bfa12b00f54b

Export gnt_widget_get_size for pygnt. I tried to export _register_action, but it doesn't work.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Mon, 30 Jul 2007 20:24:04 +0000
parents 7389b597a812
children fae29ba432c8
line wrap: on
line diff
--- a/finch/libgnt/pygnt/gnt.override	Sun Jul 29 19:00:49 2007 +0000
+++ b/finch/libgnt/pygnt/gnt.override	Mon Jul 30 20:24:04 2007 +0000
@@ -32,6 +32,7 @@
  gntbox.override
  gntfilesel.override
  gnttree.override
+ gntwidget.override
 %%
 modulename gnt
 %%
@@ -92,4 +93,32 @@
 
 	return list;
 }
+%%
+override gnt_register_action
+static GHashTable *actions;
 
+
+
+static PyObject *
+_wrap_gnt_register_action(PyGObject *self, PyObject *args, PyObject *kwargs)
+{
+	static char *kwlist[] = {"name", "callback", NULL};
+	PyGObject *callback;
+	GClosure *closure;
+	char *name;
+
+	if (!PyArg_ParseTuple(args, "sO:gnt.gnt_register_action", &name, &callback)) {
+		return NULL;
+	}
+
+	if (!PyCallable_Check(callback)) {
+		PyErr_SetString(PyExc_TypeError, "the callback must be callable ... doh!");
+		return NULL;
+	}
+
+	gnt_register_action(name, callback->obj);
+
+	Py_INCREF(Py_None);
+	return Py_None;
+}
+