# Nested TreeView

**URL:** <https://www.ruby-forum.com/t/nested-treeview/145245>\
**Category:** Ruby-Gnome 2\
**Created:** [August 7, 2008, 4:39am UTC](https://www.ruby-forum.com/t/nested-treeview/145245 "2008-08-07T04:39:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![roxah](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/54ee81/32.png) [@roxah](https://www.ruby-forum.com/u/roxah)\
**Post date:** [August 7, 2008, 4:39am UTC](https://www.ruby-forum.com/t/nested-treeview/145245/1 "2008-08-07T04:39:07Z")

</div>

Hello all,

Is it possible to have nested TreeViews/TreeStores? I’m trying to  
extend RSQLiteGUI to display relational associations and I’m wondering  
how I can do this with TreeView…

–  
Thanks!  
Bryan

---

<div class="post-metadata">

**Author:** ![roxah](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/54ee81/32.png) [@roxah](https://www.ruby-forum.com/u/roxah)\
**Post date:** [August 7, 2008, 1:24pm UTC](https://www.ruby-forum.com/t/nested-treeview/145245/2 "2008-08-07T13:24:19Z")

</div>

Hi,

In [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
“[ruby-gnome2-devel-en] Nested TreeView” on Thu, 7 Aug 2008 04:39:07  
+0200,  
Bryan R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Is it possible to have nested TreeViews/TreeStores? I’m trying to  
> extend RSQLiteGUI to display relational associations and I’m wondering  
> how I can do this with TreeView…

Did you see ‘Tree View/Tree Store’ sample in  
gtk/sample/gtk-demo/main.rb sample program? Is it what you  
want?

## Thanks,

kou

---

<div class="post-metadata">

**Author:** ![roxah](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/54ee81/32.png) [@roxah](https://www.ruby-forum.com/u/roxah)\
**Post date:** [August 7, 2008, 2:12pm UTC](https://www.ruby-forum.com/t/nested-treeview/145245/3 "2008-08-07T14:12:44Z")

</div>

Hi Kou,

Wow, I did not know that demo existed… that will be very useful to me  
in the future, thanks! Now, to answer your question: The TreeStore  
example in the demo is not exactly what I was looking for. I’d like to  
have nested TreeStores if possible. So, for example, let’s say I have a  
table in a database that has a column for its id, a column for its name,  
and a column for its value. Then lets say I have another table that has  
a column for its id, a column for the id of the row in the other table  
it belongs to, its name, and its value. Thus the second table belongs  
to the first table, and the first table has many second tables. In the  
TreeStore, if the first table has some rows in the second table that  
belong to it, I’d like to be able to expand it out so that a whole new  
TreeStore is shown for the rows in the second table. Very similar to  
what the ActiveScaffold Ruby on Rails plugin does if you’ve ever seen  
that demo.

–  
Thanks!  
Bryan

Kouhei S. wrote:

> Did you see ‘Tree View/Tree Store’ sample in  
> gtk/sample/gtk-demo/main.rb sample program? Is it what you  
> want?

Thanks,

> –  
> kou

---

<div class="post-metadata">

**Author:** ![roxah](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/54ee81/32.png) [@roxah](https://www.ruby-forum.com/u/roxah)\
**Post date:** [August 9, 2008, 12:15pm UTC](https://www.ruby-forum.com/t/nested-treeview/145245/4 "2008-08-09T12:15:51Z")

</div>

> Wow, I did not know that demo existed

The demos helped me a LOT. At this point I want to chime in and express  
my personal thanks to everyone who helped create these demos. They are  
very useful.
