Glade and Gtk

Using GtkReactive and Gtk, I can create a GUI that creates new GUI elements:

using GtkReactive, Gtk.ShortNames
w = Window("a")
a = button("a")
b = Box(:h)
push!(b, a)
foreach(a) do _
    cb = checkbox(rand(Bool))
    foreach(println, cb)
    push!(b, cb)
end
push!(w, b)
showall(w)

Can anyone show me a MWE of how to do that with Glade? How would you add rows and columns with checkboxs in them to an existing Grid?

Thanks!

1 Like

Simpler than I thought:

builder = Builder(filename="file.glade")
w = builder["window"]
add = button(; widget=builder["add"])
foreach(add; init=nothing) do _
    g = builder["grid"]
    empty!(g)
    for i = 1:3, j = 1:5
        g[i,j] = checkbox(true)
    end
    showall(w)
    nothing
end
1 Like