# Glade, Gtk::Builder and GtkTreeView

**URL:** <https://www.ruby-forum.com/t/glade-gtk-builder-and-gtktreeview/210125>\
**Category:** Ruby-Gnome 2\
**Created:** [July 31, 2011, 7:08pm UTC](https://www.ruby-forum.com/t/glade-gtk-builder-and-gtktreeview/210125 "2011-07-31T19:08:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [July 31, 2011, 7:08pm UTC](https://www.ruby-forum.com/t/glade-gtk-builder-and-gtktreeview/210125/1 "2011-07-31T19:08:42Z")

</div>

This is my first time using Ruby-Gnome2, so please be gentle…

I am trying to use a GtkTreeView I created in glade. I created the  
hierarchy in glade and would rather do this way than create the columns  
in ruby code.

I think my ruby code needs to set a cell renderer for each column as my  
tree is blank. I can’t work out how to set a column’s renderer. Can I do  
this, or will I have to create the columns in ruby?

Thanks, Mike Wilson

---

<div class="post-metadata">

**Author:** ![vh1](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/278dde/32.png) [@vh1](https://www.ruby-forum.com/u/vh1)\
**Post date:** [August 1, 2011, 11:41am UTC](https://www.ruby-forum.com/t/glade-gtk-builder-and-gtktreeview/210125/2 "2011-08-01T11:41:44Z")

</div>

Mike Wilson wrote in post #1014007:

> This is my first time using Ruby-Gnome2, so please be gentle…
> 
> I am trying to use a GtkTreeView I created in glade. I created the  
> hierarchy in glade and would rather do this way than create the columns  
> in ruby code.
> 
> I think my ruby code needs to set a cell renderer for each column as my  
> tree is blank. I can’t work out how to set a column’s renderer. Can I do  
> this, or will I have to create the columns in ruby?

In glade, you right-click on your treeview, or any column, and choose  
“Edit …”. In the hierarchy tab, you select a column, right-click, and  
“Add child whatever”, most likely Text.

Don’t forget to rename it. Don’t forget to edit the “text” property, so  
as it points to what you want from the liststore. See attachment.

Simon

---

<div class="post-metadata">

**Author:** ![vh1](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/278dde/32.png) [@vh1](https://www.ruby-forum.com/u/vh1)\
**Post date:** [August 1, 2011, 3:53pm UTC](https://www.ruby-forum.com/t/glade-gtk-builder-and-gtktreeview/210125/3 "2011-08-01T15:53:40Z")

</div>

Simon A. wrote in post #1014144:

> In glade, you right-click on your treeview, or any column, and choose  
> “Edit …”. In the hierarchy tab, you select a column, right-click, and  
> “Add child whatever”, most likely Text.
> 
> Don’t forget to rename it. Don’t forget to edit the “text” property, so  
> as it points to what you want from the liststore. See attachment.
> 
> Simon

Brilliant – just what I needed. Thanks
