[accerciser/pygi] Adding CellRendererText attributes to GtkTreeViewColumn properly



commit b79056db60d781745187d1b5624ce06096608eed
Author: Javier HernÃndez <jhernandez emergya es>
Date:   Mon Aug 29 11:35:50 2011 +0200

    Adding CellRendererText attributes to GtkTreeViewColumn properly

 plugins/interface_view.py |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)
---
diff --git a/plugins/interface_view.py b/plugins/interface_view.py
index 252e00b..edab7ac 100644
--- a/plugins/interface_view.py
+++ b/plugins/interface_view.py
@@ -703,34 +703,39 @@ class _SectionHypertext(_InterfaceSection):
                           int, # End offset
                           object) # Anchor object
     treeview.set_model(self.links_model)
+
     crt = gtk.CellRendererText()
     tvc = gtk.TreeViewColumn(_('Name'))
-    tvc.add_attribute(crt, _("Name"), 1)
     tvc.set_sizing(gtk.TreeViewColumnSizing.AUTOSIZE)
     tvc.set_resizable(True)
     tvc.pack_start(crt, True)
+    tvc.add_attribute(crt, 'text', 1)
     treeview.append_column(tvc)
+
     crt = gtk.CellRendererText()
     tvc = gtk.TreeViewColumn(_('URI'))
-    tvc.add_attribute(crt, _('URI'), 3)
     tvc.set_sizing(gtk.TreeViewColumnSizing.AUTOSIZE)
     tvc.set_resizable(True)
     tvc.pack_start(crt, True)
+    tvc.add_attribute(crt, 'text', 3)
     treeview.append_column(tvc)
+
     crt = gtk.CellRendererText()
     tvc = gtk.TreeViewColumn(_('Start'))
-    tvc.add_attribute(crt, _('Start'), 4)
     tvc.set_sizing(gtk.TreeViewColumnSizing.AUTOSIZE)
     tvc.set_resizable(True)
     tvc.pack_start(crt, True)
+    tvc.add_attribute(crt, 'text', 4)
     treeview.append_column(tvc)
+
     crt = gtk.CellRendererText()
     tvc = gtk.TreeViewColumn(_('End'))
-    tvc.add_attribute(crt, _('End'), 5)
     tvc.set_sizing(gtk.TreeViewColumnSizing.AUTOSIZE)
     tvc.set_resizable(True)
     tvc.pack_start(crt, True)
-    treeview.append_column(tvc)    
+    tvc.add_attribute(crt, 'text', 5)
+    treeview.append_column(tvc)
+
     selection = treeview.get_selection()
     show_button = ui_xml.get_object('button_hypertext_show')
     show_button.set_sensitive(self._isSelectedInView(selection))



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]