# Why not table display?

**URL:** <https://www.ruby-forum.com/t/why-not-table-display/189864>\
**Category:** Ruby-Gnome 2\
**Created:** [June 9, 2010, 4:17am UTC](https://www.ruby-forum.com/t/why-not-table-display/189864 "2010-06-09T04:17:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![luofeiyu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/9de0a6/32.png) [@luofeiyu](https://www.ruby-forum.com/u/luofeiyu)\
**Post date:** [June 9, 2010, 4:17am UTC](https://www.ruby-forum.com/t/why-not-table-display/189864/1 "2010-06-09T04:17:30Z")

</div>

i want to create a blank table ,here is my program:  
require ‘gtk2’  
window = Gtk::Window.new(“Table”)  
window.signal\_connect(“delete\_event”) do  
Gtk.main\_quit  
false  
end  
window.border\_width = 200  
table = Gtk::Table.new(10, 10, false)  
window.add(table)  
window.show\_all  
Gtk.main

when i run ,i can see a window ,not table in it,why?

---

<div class="post-metadata">

**Author:** ![luofeiyu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/9de0a6/32.png) [@luofeiyu](https://www.ruby-forum.com/u/luofeiyu)\
**Post date:** [June 9, 2010, 9:06am UTC](https://www.ruby-forum.com/t/why-not-table-display/189864/2 "2010-06-09T09:06:25Z")

</div>

Le mercredi 09 juin 2010 à 04:17 +0200, Pen T. a écrit :

> when i run ,i can see a window ,not table in it,why?

What do you expect ?

A Gtk Table is a layout object, it is not visible by itself.  
You have to add objects into the table, and they will be aligned in rows  
and columns

---

<div class="post-metadata">

**Author:** ![luofeiyu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/9de0a6/32.png) [@luofeiyu](https://www.ruby-forum.com/u/luofeiyu)\
**Post date:** [June 9, 2010, 11:57am UTC](https://www.ruby-forum.com/t/why-not-table-display/189864/3 "2010-06-09T11:57:25Z")

</div>

please see my attachment,how to create the cell-like graph?which kind of  
widget to be added ?

---

<div class="post-metadata">

**Author:** ![luofeiyu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/9de0a6/32.png) [@luofeiyu](https://www.ruby-forum.com/u/luofeiyu)\
**Post date:** [June 9, 2010, 12:30pm UTC](https://www.ruby-forum.com/t/why-not-table-display/189864/4 "2010-06-09T12:30:44Z")

</div>

Tables are made in GTK with the Tree View Widget.

Tree view widgets are very powerful but also complicated. Explaining  
in an email how to do it would take too long. But there is a tutorial  
on it:

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

```
   MikeC

```
