I would like to start a Gtk.jl
window with two buttons, one of them being invisible; the visible button toggles the visibility of the invisible one.
I cannot set the visibility of the “invisible” button until after I start the Gtk main loop. Setting other properties, such as label
before the main loop instead works as expected.
Is this a bug?
using Gtk
win = GtkWindow("Visible buttons")
b1 = GtkCheckButton("Click Me")
#set_gtk_property!(b1, :label, "Button 1")
b2 = GtkButton("This button disappears")
set_gtk_property!(b2, :visible, false)
signal_connect(b1, "clicked") do w
set_gtk_property!(b2,
:visible, get_gtk_property(w, :active, Bool))
end
g = GtkGrid()
g[1,1] = b1
g[2,1] = b2
push!(win, g)
showall(win)
#set_gtk_property!(b2, :visible, false) # uncomment this to hide the button b2