comparison finch/libgnt/pygnt/gnttree.override @ 18713:8000beb73585

propagate from branch 'im.pidgin.pidgin' (head c2cc31f23a71f23062555721f8101fc9c997bae2) to branch 'libgnt.pygnt' (head e69d5919b7bf3b9ace0cb482c147654e60e135a8)
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sun, 29 Jul 2007 07:59:10 +0000
parents 254823d66aa5
children 54a28e05e8af
comparison
equal deleted inserted replaced
18712:c65c4caa817a 18713:8000beb73585
18 * License along with this library; if not, write to the Free Software 18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20 * USA 20 * USA
21 */ 21 */
22 %% 22 %%
23 headrs 23 headers
24 #include "common.h" 24 #include "common.h"
25 %% 25 %%
26 ignore 26 ignore
27 gnt_tree_create_row 27 gnt_tree_create_row
28 gnt_tree_create_row_from_list 28 gnt_tree_create_row_from_list
47 } 47 }
48 if ((py_list = PyList_New(0)) == NULL) { 48 if ((py_list = PyList_New(0)) == NULL) {
49 return NULL; 49 return NULL;
50 } 50 }
51 while (list) { 51 while (list) {
52 PyObject *obj = pyg_pointer_new(G_TYPE_POINTER, list->data); 52 PyObject *obj = list->data;
53 PyList_Append(py_list, obj); 53 PyList_Append(py_list, obj);
54 Py_DECREF(obj); 54 Py_DECREF(obj);
55 list = list->next; 55 list = list->next;
56 } 56 }
57 return py_list; 57 return py_list;
98 g_list_free(list); 98 g_list_free(list);
99 99
100 Py_INCREF(Py_None); 100 Py_INCREF(Py_None);
101 return Py_None; 101 return Py_None;
102 } 102 }
103 %%
104 override gnt_tree_get_selection_data noargs
105 static PyObject *
106 _wrap_gnt_tree_get_selection_data(PyGObject *self)
107 {
108 PyObject *ret = gnt_tree_get_selection_data(GNT_TREE(self->obj));
109 if (!ret)
110 ret = Py_None;
111 Py_INCREF(ret);
112 return ret;
113 }
114 %%
115 override gnt_tree_change_text
116 static PyObject *
117 _wrap_gnt_tree_change_text(PyGObject *self, PyObject *args, PyObject *kwargs)
118 {
119 static char *kwlist[] = { "key", "colno", "text", NULL };
120 char *text;
121 int colno;
122 gpointer key;
103 123
124 if (!PyArg_ParseTupleAndKeywords(args, kwargs,"Ois:GntTree.change_text", kwlist, &key, &colno, &text))
125 return NULL;
126
127 gnt_tree_change_text(GNT_TREE(self->obj), key, colno, text);
128
129 Py_INCREF(Py_None);
130 return Py_None;
131 }
132 %%
133 override gnt_tree_set_row_flags
134 static PyObject *
135 _wrap_gnt_tree_set_row_flags(PyGObject *self, PyObject *args, PyObject *kwargs)
136 {
137 static char *kwlist[] = { "key", "flag", NULL };
138 int flag;
139 gpointer key;
140
141 if (!PyArg_ParseTupleAndKeywords(args, kwargs,"Oi:GntTree.set_row_flags", kwlist, &key, &flag))
142 return NULL;
143
144 gnt_tree_set_row_flags(GNT_TREE(self->obj), key, flag);
145
146 Py_INCREF(Py_None);
147 return Py_None;
148 }
149 %%
150 override gnt_tree_remove
151 static PyObject *
152 _wrap_gnt_tree_remove(PyGObject *self, PyObject *args, PyObject *kwargs)
153 {
154 static char *kwlist[] = { "key", NULL };
155 gpointer key;
156
157 if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O:GntTree.remove", kwlist, &key))
158 return NULL;
159
160 gnt_tree_remove(GNT_TREE(self->obj), key);
161
162 Py_INCREF(Py_None);
163 return Py_None;
164 }