# Gtk::TreeView, Libglade and Ruby

**URL:** <https://www.ruby-forum.com/t/gtk-treeview-libglade-and-ruby/54323>\
**Category:** Ruby\
**Created:** [March 1, 2006, 4:13pm UTC](https://www.ruby-forum.com/t/gtk-treeview-libglade-and-ruby/54323 "2006-03-01T16:13:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Lesniak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c67d28/32.png) [@Michael\_Lesniak](https://www.ruby-forum.com/u/Michael_Lesniak)\
**Post date:** [March 1, 2006, 4:13pm UTC](https://www.ruby-forum.com/t/gtk-treeview-libglade-and-ruby/54323/1 "2006-03-01T16:13:45Z")

</div>

Hello,

I have created a small testcase for working with a TreeView which I  
can’t get to run for reasons I couldn’t find out.

— Sample code begin ---------------------  
list = Gtk::ListStore.new(String, String)  
data = [[“One”, “1”], [“Two”, “2”]]  
data.each do |item|  
iter = list.append  
item.each\_with\_index do |str, id|  
msg “@#{id} -\> #{str}”  
iter[id] = str  
end  
end

```
	# Update treeview
	@list.model = list

	# Add it to the view
	renderer = Gtk::CellRendererText.new
	name = Gtk::TreeViewColumn.new(
	  "Name",
	  renderer,
	  :text => 0)
	@list.append_column(name)

```

— Sample code end -----------------------

where @list is a treeview, obtained from glade with

@list = @glade[‘treeview’]

The window shows up and I can write text into, such that the search  
function of the TreeView pops up; but nevertheless, my data is not  
shown.

Any ideas what is wrong here?

Thanks in advance,  
Michael Lesniak
