当我尝试运行以下golang代码时,终端中的输出为“退出状态3221225477”。然后程序关闭。我正在使用fyne GUI软件包。您能帮我解决这个问题吗? 包主
import (
"net/url"
"fyne.io/fyne"
"fyne.io/fyne/app"
"fyne.io/fyne/layout"
"fyne.io/fyne/theme"
"fyne.io/fyne/widget"
)
func main() {
app := app.New()
app.Settings().SetTheme(theme.LightTheme())
entry := widget.NewEntry()
entry.SetText("Path")
w := app.NewWindow("Hello")
link, err := url.Parse("https://www.inovatian.com/")
if err != nil {
fyne.LogError("Could not parse URL", err)
}
w.SetContent(widget.NewVBox(
widget.NewLabelWithStyle("Welcome to Inovatian App",
fyne.TextAlignCenter, fyne.TextStyle{Bold: true}),
layout.NewSpacer(),
widget.NewHyperlinkWithStyle("inovatian", link, fyne.TextAlignCenter,
fyne.TextStyle{}),
layout.NewSpacer(),
widget.NewGroup("",
fyne.NewContainerWithLayout(layout.NewGridLayout(2),
widget.NewButton("Next", func() {
app.Quit()
}),
widget.NewButton("Cancel", func() {
app.Quit()
}),
),
),
))
w.CenterOnScreen()
w.Resize(fyne.NewSize(240, 180))
w.ShowAndRun()
}
答案 0 :(得分:2)
在ubuntu上工作(下面的屏幕截图)。
根据this,十六进制的返回值3221225477为0xC0000005或STATUS_ACCESS_VIOLATION,它们报告为“无效的内存地址或空指针取消引用”。 因此,在Windows版本的Fyne GUI库中可能是一个问题。
答案 1 :(得分:1)