summaryrefslogtreecommitdiff
path: root/gi/overrides/Gtk.py
diff options
context:
space:
mode:
authorManuel QuiƱones <manuq@laptop.org>2012-07-20 10:37:04 -0300
committerMartin Pitt <martinpitt@gnome.org>2012-07-24 15:28:37 +0200
commita46d165d906d0ac7613f4d946542423e979f39d5 (patch)
tree993f3f226216aa0a8310aab6aaff9c5b91146f8e /gi/overrides/Gtk.py
parent4df676e10a5ea595a0d491af10268f557dd722d7 (diff)
downloadpygobject-a46d165d906d0ac7613f4d946542423e979f39d5.tar.gz
Add set_attributes() override to Gtk.TreeViewColumn
Looking at the C code, gtk_tree_view_column_set_attributesv just calls gtk_cell_layout_clear_attributes and then gtk_cell_layout_add_attribute for each (name, value) passed. This patch makes the same in the overrides. Signed-off-by: Manuel QuiƱones <manuq@laptop.org> Signed-off-by: Martin Pitt <martinpitt@gnome.org>
Diffstat (limited to 'gi/overrides/Gtk.py')
-rw-r--r--gi/overrides/Gtk.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/gi/overrides/Gtk.py b/gi/overrides/Gtk.py
index 68d0f418..8418ca49 100644
--- a/gi/overrides/Gtk.py
+++ b/gi/overrides/Gtk.py
@@ -1399,6 +1399,13 @@ class TreeViewColumn(Gtk.TreeViewColumn):
def set_cell_data_func(self, cell_renderer, func, func_data=None):
super(TreeViewColumn, self).set_cell_data_func(cell_renderer, func, func_data)
+ def set_attributes(self, cell_renderer, **attributes):
+ Gtk.CellLayout.clear_attributes(self, cell_renderer)
+
+ for (name, value) in attributes.items():
+ Gtk.CellLayout.add_attribute(self, cell_renderer, name, value)
+
+
TreeViewColumn = override(TreeViewColumn)
__all__.append('TreeViewColumn')