Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgnacio Rodríguez <ignacio@sugarlabs.org>2013-02-15 11:26:52 (GMT)
committer Ignacio Rodríguez <ignacio@sugarlabs.org>2013-02-15 11:26:52 (GMT)
commit253017bb52dd01b5aee591998ab63147be6401d0 (patch)
treee17a4ee1a8b64aeb0d1f3489d7eb7d9178ac9d43
parent08b46add08fce190e7bce3507b65c82bfc0080fd (diff)
Patch (thx Alan) for pixbuf's in TreeView
-rw-r--r--canvas.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/canvas.py b/canvas.py
index 2032fd0..38af386 100644
--- a/canvas.py
+++ b/canvas.py
@@ -44,15 +44,15 @@ def _gen_activity(_id, parent):
text6 = "<b>Downloads: %s</b>" % _activity_props[7]
text7 = "<b>Homepage: %s</b>" % _activity_props[8]
text = text1 + "\n" + text2 + "\n" + text3 + "\n" + text4 + "\n" + text5 + "\n" + text6 + "\n" + text7
- """
+ pixbuf_icon = None
try:
- pixbuf_icon = utils.get_icon(self._id)
- self.icon.set_from_pixbuf(pixbuf_icon)
+ pixbuf_icon = utils.get_icon(_id)
except:
pass
- """
- texto = [text1, text1, text]
- return texto
+
+ info = [pixbuf_icon, text1, text]
+ return info
+
class Canvas(gtk.Notebook):
@@ -100,7 +100,7 @@ class List(gtk.TreeView):
def __init__(self, parent):
gtk.TreeView.__init__(self)
- self._model = gtk.ListStore(str, str, str)
+ self._model = gtk.ListStore(gtk.gdk.Pixbuf, str, str)
self.set_model(self._model)
self.icon = gtk.CellRendererPixbuf()
@@ -114,6 +114,7 @@ class List(gtk.TreeView):
self.icon_column.pack_start(self.icon, False)
+ self.icon_column.add_attribute(self.icon, 'pixbuf', 0)
self._name_column.pack_start(self._name, True)
self.description_column.pack_start(self.description, True)