# \[gtk\] - My image the Treeview column

**URL:** <https://www.ruby-forum.com/t/gtk-my-image-the-treeview-column/178602>\
**Category:** Ruby\
**Created:** [November 7, 2009, 5:22pm UTC](https://www.ruby-forum.com/t/gtk-my-image-the-treeview-column/178602 "2009-11-07T17:22:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![demas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c2a13f/32.png) [@demas](https://www.ruby-forum.com/u/demas)\
**Post date:** [November 7, 2009, 5:22pm UTC](https://www.ruby-forum.com/t/gtk-my-image-the-treeview-column/178602/1 "2009-11-07T17:22:44Z")

</div>

Hi all,

I need to display the images in the one of columns in the Treeview.  
I have found this example  
([http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk2-treev-pxbr](http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk2-treev-pxbr)).

But in this example are used the standard gnome icons:

> > parent[$pixbuf] = Gtk::Stock::DIALOG\_INFO

I have tried to change code to:

```
pixbuf = Gdk::Pixbuf.new('/home/demas/settings/awn_icons/emacs.png')
parent[$pxbuf] = pixbuf

```

but it doesn’t work.

How can I display images in the threeview column?

---

<div class="post-metadata">

**Author:** ![demas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c2a13f/32.png) [@demas](https://www.ruby-forum.com/u/demas)\
**Post date:** [November 8, 2009, 5:03pm UTC](https://www.ruby-forum.com/t/gtk-my-image-the-treeview-column/178602/2 "2009-11-08T17:03:12Z")

</div>

I think I have found the answer:

```
user_renderer = Gtk::CellRendererPixbuf.new
col = Gtk::TreeViewColumn.new
col.title = "pic"
col.pack_start(user_renderer, false)

pixbuf = Gdk::Pixbuf.new('/home/demas/settings/awn_icons/emacs.png')
user_renderer.set_pixbuf(pixbuf)
```

---

<div class="post-metadata">

**Author:** ![demas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c2a13f/32.png) [@demas](https://www.ruby-forum.com/u/demas)\
**Post date:** [November 8, 2009, 5:07pm UTC](https://www.ruby-forum.com/t/gtk-my-image-the-treeview-column/178602/3 "2009-11-08T17:07:37Z")

</div>

Or better:

```
iter = @store.append
iter[0] = twi.message()
iter[1] = 

```

Gdk::Pixbuf.new(’/home/demas/settings/awn\_icons/emacs.png’)

```
....

user_renderer = Gtk::CellRendererPixbuf.new
col = Gtk::TreeViewColumn.new
col.title = "pic"
col.pack_start(user_renderer, false)
col.add_attribute(user_renderer, 'pixbuf', 1)
```
