go-qt5
go-qt5 copied to clipboard
menubar disappears and panics on app close in windows
I'm not sure if you have windows, but if you open up a menu (like in examples/widgets.go) and then you close that menu by making it lose focus, the menubar completely disappears and I see a remove item &{Menu{0x12c342e0}}
in console. When you close the app, it panics:
panic: runtime error: call of nil func value
[signal 0xc0000005 code=0x0 addr=0x0 pc=0x0]
goroutine 1 [syscall]:
github.com/salviati/go-qt5/qt5._Cfunc_drv(0x8, 0x3)
C:/Users/outroot/AppData/Local/Temp/go-build940075959/github.com/salviati/go-qt5/qt5/_obj/_cgo_defun.c:42 +0x31
I don't have windows, however I got the menubar disappear under GNU/Linux (amd64), using go 1.0.3. It doesn't panic though. It may be a problem with the lengthy widgets.go, which I just pulled from visualfc's go-ui. Can you provide a minimal code that reproduces the problem?
I could, but widgets.go seems like a good test case. Even if I have just a simple window with a menubar, it does exactly the same thing.
I wrote a minimal test case, and confirmed that the problem is in the bindings. Unfortunately, I don't have any time to spare on this project these days. Patches are welcome.
Can you point me in the right direction? I'll take a look. Honestly not entirely sure how this binding works, and how the lua is used and everything. If you have time for a quick rundown it would be nice.
Sure. If it's something specific to menu/menubar, you can start by checking make/lua/ui/{menu,menubar}.lua and move up in the dependency tree: widget.lua and hand-written code under goqtdrv5 (cdrv.cpp is generated by lua scripts).