# \[Gtk.jl\] Stuck with GtkTreeView generated with Glade

**URL:** <https://discourse.julialang.org/t/gtk-jl-stuck-with-gtktreeview-generated-with-glade/56328>\
**Category:** Visualization\
**Tags:** gtk, ui\
**Created:** [March 2, 2021, 12:34pm UTC](https://discourse.julialang.org/t/gtk-jl-stuck-with-gtktreeview-generated-with-glade/56328 "2021-03-02T12:34:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Azzaare](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/azzaare/32/21008_2.png) [@Azzaare](https://discourse.julialang.org/u/Azzaare)\
**Post date:** [March 2, 2021, 12:34pm UTC](https://discourse.julialang.org/t/gtk-jl-stuck-with-gtktreeview-generated-with-glade/56328/1 "2021-03-02T12:34:26Z")

</div>

Hi there,

I have started a Gtk.jl project with a base layout generated by Glade.  
I struggle with assigning a GtkTreeModel to a Glade generated GtkTreeView

Even though I could generate the TreeView manually, I feel I am missing something. Can someone help? Below is a somewhat M(non)WE (I do not provide a glade file, but let me know if needed)

```julia
 # Associates widgets from GtkBuilder
    win = builder["window"]
    ...
    tree = builder["tree"]
    ls = GtkTreeStore(String)
    info = push!(ls, ("Information",))
    index = push!(ls, ("Index",))
    test = push!(ls, ("Test",), index)
    tm = GtkTreeModel(ls)

    # push!(tree, GtkTreeModel(ls)) # doesn't work
    # set_gtk_property!(tree, :child, tm) # doesn't work

```

---

<div class="post-metadata">

**Author:** ![Azzaare](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/azzaare/32/21008_2.png) [@Azzaare](https://discourse.julialang.org/u/Azzaare)\
**Post date:** [March 3, 2021, 7:36am UTC](https://discourse.julialang.org/t/gtk-jl-stuck-with-gtktreeview-generated-with-glade/56328/2 "2021-03-03T07:36:29Z")

</div>

It seems that the general way to do it for Gtk (even non-julian) is to not generate the TreeView widgets with Glade. We can thus add them manually, initialised correctly, to their container widget.

---

<div class="post-metadata">

**Author:** ![Erik\_Engheim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/erik_engheim/32/8122_2.png) [@Erik\_Engheim](https://discourse.julialang.org/u/Erik_Engheim)\
**Post date:** [January 26, 2022, 3:14pm UTC](https://discourse.julialang.org/t/gtk-jl-stuck-with-gtktreeview-generated-with-glade/56328/3 "2022-01-26T15:14:39Z")

</div>

How you tried creating the store in Glade? I have done some examples in the past where I created the store in Glade itself and assigned it to a widget in Glade. You could probably reference it from the code and replace content in it.

---

<div class="post-metadata">

**Author:** ![tknopp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tknopp/32/3569_2.png) [@tknopp](https://discourse.julialang.org/u/tknopp)\
**Post date:** [January 26, 2022, 4:23pm UTC](https://discourse.julialang.org/t/gtk-jl-stuck-with-gtktreeview-generated-with-glade/56328/4 "2022-01-26T16:23:37Z")

</div>

For TreeView I usually define the model in code and push the TreeView into a Box generated by Glade. We had a similar case recently: [https://github.com/JuliaGraphics/Gtk.jl/issues/606](https://github.com/JuliaGraphics/Gtk.jl/issues/606)
