# Populate Gtk::TreeView?

**URL:** <https://www.ruby-forum.com/t/populate-gtk-treeview/98460>\
**Category:** Ruby\
**Created:** [July 14, 2006, 9:57pm UTC](https://www.ruby-forum.com/t/populate-gtk-treeview/98460 "2006-07-14T21:57:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![stepheneb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/71e660/32.png) [@stepheneb](https://www.ruby-forum.com/u/stepheneb)\
**Post date:** [July 14, 2006, 9:57pm UTC](https://www.ruby-forum.com/t/populate-gtk-treeview/98460/1 "2006-07-14T21:57:35Z")

</div>

Hi,

I’m in need of a Gtk::TreeView in an application. I create the treeview  
and add it to my window (and the blank widget is indeed there) but I  
can’t seem to add anything to the treeview. I create a treestore, get  
the iterator and use that to add data, but it doesn’t seem to work, and  
the tree isn’t updated. Where am I going wrong?

Thanks

---

<div class="post-metadata">

**Author:** ![stepheneb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/71e660/32.png) [@stepheneb](https://www.ruby-forum.com/u/stepheneb)\
**Post date:** [July 14, 2006, 10:11pm UTC](https://www.ruby-forum.com/t/populate-gtk-treeview/98460/2 "2006-07-14T22:11:19Z")

</div>

Stephen Branley wrote:

> –  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).  
> Posting the code could help us to help you.

Ken

---

<div class="post-metadata">

**Author:** ![stepheneb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/71e660/32.png) [@stepheneb](https://www.ruby-forum.com/u/stepheneb)\
**Post date:** [July 15, 2006, 8:29pm UTC](https://www.ruby-forum.com/t/populate-gtk-treeview/98460/3 "2006-07-15T20:29:02Z")

</div>

Am Samstag, den 15.07.2006, 04:57 +0900 schrieb Stephen Branley:

> Hi,
> 
> I’m in need of a Gtk::TreeView in an application. I create the treeview  
> and add it to my window (and the blank widget is indeed there) but I  
> can’t seem to add anything to the treeview. I create a treestore, get  
> the iterator and use that to add data, but it doesn’t seem to work, and  
> the tree isn’t updated. Where am I going wrong?

Hi,

there could different faults.

First you have to attache renderers to the view-colums. Than you have to  
take care, that the renderer get notified when the model get changed.

Take a look at the treeview-example at

[http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-treeview](http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-treeview)

If you have further questions, please send the relevant parts of your  
code.

Cheers  
detlef
