summaryrefslogtreecommitdiff
path: root/gtk/gtktreeview.override
diff options
context:
space:
mode:
authorJohan Dahlin <johan@src.gnome.org>2005-02-15 17:55:07 +0000
committerJohan Dahlin <johan@src.gnome.org>2005-02-15 17:55:07 +0000
commitbaede8449035475e71cc630a35272e3010e62640 (patch)
treeadd2bcc813f7771de71d7f509791601a3db4ca9f /gtk/gtktreeview.override
parent5e26efaa9f802f94a4d9ea03d402c8f29ab86be0 (diff)
downloadpygtk-baede8449035475e71cc630a35272e3010e62640.tar.gz
Undeprecate gtk.icon_size_get_name and gtk.icon_size_lookup and remove
* gtk/gtk.defs: Undeprecate gtk.icon_size_get_name and gtk.icon_size_lookup and remove broken methods.
Diffstat (limited to 'gtk/gtktreeview.override')
-rw-r--r--gtk/gtktreeview.override32
1 files changed, 31 insertions, 1 deletions
diff --git a/gtk/gtktreeview.override b/gtk/gtktreeview.override
index 698e3eb9..4aa550ac 100644
--- a/gtk/gtktreeview.override
+++ b/gtk/gtktreeview.override
@@ -926,6 +926,20 @@ _wrap_gtk_tree_model_tp_getitem(PyGObject *self, PyObject *item)
pyg_boxed_get(item, GtkTreeIter));
}
+ if (PyInt_Check(item)) {
+ int value = PyInt_AsLong(item);
+
+ if (value < 0) {
+ /* Since value is always negative at this point,
+ * we need to do an invertion.
+ */
+ value = _wrap_gtk_tree_model_tp_length(self) - -value;
+
+ Py_DECREF(item);
+ item = PyInt_FromLong(value);
+ }
+ }
+
path = pygtk_tree_path_from_pyobject(item);
if (!path) {
PyErr_SetString(PyExc_TypeError,
@@ -950,7 +964,23 @@ _wrap_gtk_tree_model_tp_setitem(PyGObject *self, PyObject *item,
if (pyg_boxed_check(item, GTK_TYPE_TREE_ITER)) {
iter = pyg_boxed_get(item, GtkTreeIter);
} else {
- GtkTreePath *path = pygtk_tree_path_from_pyobject(item);
+ GtkTreePath *path;
+
+ if (PyInt_Check(item)) {
+ int value = PyInt_AsLong(item);
+
+ if (value < 0) {
+ /* Since value is always negative at this point,
+ * we need to do an invertion.
+ */
+ value = _wrap_gtk_tree_model_tp_length(self) - -value;
+
+ Py_DECREF(item);
+ item = PyInt_FromLong(value);
+ }
+ }
+
+ path = pygtk_tree_path_from_pyobject(item);
if (!path) {
PyErr_SetString(PyExc_TypeError,