It seems there's an issue with using an anonymous function in signal_connect,
it works with a named one:
1. function openButton_toggled_cb(widgetptr, user_data)
2. println(typeof(widgetptr))
3. widget = convert(ToggleButton, widgetptr)
4. println("open "*(Gtk.getproperty(widget,:active,Bool)?"y":"n"))
5. if Gtk.getproperty(widget,:active,Bool)
6. Gtk.setproperty!(stack, "visible-child",filechooserwidget)
7. println("show file chooser")
8. else
9. Gtk.setproperty!(stack, "visible-child",drawingarea)
10. println("show drawing area")
11. end
12. return nothing
13. end
14.
15. signal_connect(
16. openButton_toggled_cb,
17. openButton,
18. "toggled",
19. Void,
20. (),
21. false,
22. )
Note that you also need to return nothing to match the declared Void return
type. Possibly related to https://github.com/JuliaLang/Gtk.jl/issues/161