diff options
author | Matt Wilson <msw@redhat.com> | 2001-09-18 15:10:28 +0000 |
---|---|---|
committer | Matt Wilson <msw@src.gnome.org> | 2001-09-18 15:10:28 +0000 |
commit | c35aaa7fc93de7cd42da19caf2c3c00d7370af28 (patch) | |
tree | ec59bd946ecd0770d283f514ba6d2b3b09b10517 | |
parent | a54b45e798a99d873ee7dd6db291c9ef0cbbb8a9 (diff) | |
download | pygtk-c35aaa7fc93de7cd42da19caf2c3c00d7370af28.tar.gz |
add columns and selection to the fields
001-09-18 Matt Wilson <msw@redhat.com>
* gtk/gtk.defs (CList): add columns and selection to the fields
* gtk/gtk.override (GtkCList.selection): implementation for
getting the selection of a CList
-rw-r--r-- | gtk/gtk.defs | 2 | ||||
-rw-r--r-- | gtk/gtk.override | 26 |
2 files changed, 27 insertions, 1 deletions
diff --git a/gtk/gtk.defs b/gtk/gtk.defs index d45d930d..bcff5d17 100644 --- a/gtk/gtk.defs +++ b/gtk/gtk.defs @@ -811,8 +811,10 @@ (c-name "GtkCList") (gtype-id "GTK_TYPE_CLIST") (fields + '("GList*" "selection") '("gint" "focus_row") '("gint" "rows") + '("gint" "columns") ) ) diff --git a/gtk/gtk.override b/gtk/gtk.override index 60ea1c8e..60fa2a64 100644 --- a/gtk/gtk.override +++ b/gtk/gtk.override @@ -634,7 +634,31 @@ _wrap_gtk_clist_get_selection_info(PyGObject *self, PyObject *args, Py_INCREF(Py_None); return Py_None; } -} +} +%% +override-attr GtkCList.selection +guint row; +GList *selection; +PyObject *py_int, *ret = PyList_New(0); + +if (ret == NULL) + return NULL; + +for (selection = GTK_CLIST(self->obj)->selection; selection != NULL; + selection = selection->next) { + row = GPOINTER_TO_UINT(selection->data); + + py_int = PyInt_FromLong(row); + + if (!py_int) { + Py_DECREF(ret); + return NULL; + } + + PyList_Append(ret, py_int); + Py_DECREF(py_int); +} +return ret; %% override gtk_combo_set_popdown_strings kwargs static PyObject * |