-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
运行不起来,可以提供下完整的demo吗 #3
Comments
那个建立Application的时候,不要你创建,需要用GVCL中的函数 |
运行提示如下:
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x20 pc=0x52a42c]
goroutine 1 [running]:
github.com/suiyunonghen/GVCL/Components/Controls.(*WApplication).Run(0xc000148000)
D:/GO/GOPATH/src/github.com/suiyunonghen/GVCL/Components/Controls/Forms.go:154 +0xec
main.main()
D:/GO/GoProject/003-gvcl/main.go:69 +0x2cd
Process finished with exit code 2
我的代码:
package main
import (
controls "github.com/suiyunonghen/GVCL/Components/Controls"
"github.com/suiyunonghen/GVCL/WinApi"
)
type GForm1 struct {
controls.GForm
Button1 *controls.GButton
Edit1 *controls.GEdit
}
func NewForm1(app *controls.WApplication) *GForm1 {
frm := new(GForm1)
frm.SubInit()
frm.Button1 = controls.NewButton(frm)
frm.Button1.SetWidth(80)
frm.Button1.SetHeight(30)
frm.Button1.SetLeft(frm.Width() - 90)
frm.Button1.SetTop(frm.Height() - 80)
frm.Button1.SetCaption("确定关闭")
}
func main() {
app := new(controls.WApplication)
app.ShowMainForm = true
m := app.CreateForm()
m.SetLeft(200)
m.SetTop(50)
m.SetCaption("测试窗体")
}
The text was updated successfully, but these errors were encountered: