创建module项目:go mod init test_go
test.go
package main
import (
"github.com/lxn/walk"
. "github.com/lxn/walk/declarative"
"strings"
)
func main() {
var inTE, outTE *walk.TextEdit
MainWindow{
Title: "SCREAMO",
MinSize: Size{600, 400},
Layout: VBox{},
Children: []Widget{
HSplitter{
Children: []Widget{
TextEdit{AssignTo: &inTE},
TextEdit{AssignTo: &outTE, ReadOnly: true},
},
},
PushButton{
Text: "SCREAM",
OnClicked: func() {
outTE.SetText(strings.ToUpper(inTE.Text()))
},
},
},
}.Run()
}
需要下载依赖:go mod tidy
第三步:编写配置test.manifest
PerMonitorV2, PerMonitor
True
第四步:编译打包
下载依赖
go get github.com/akavel/rsrc
编译依赖
rsrc -manifest test.manifest -o rsrc.syso
重命名:将test.manifest修改为test.exe.manifest
打包
go build
go build -ldflags="-H windowsgui"
./test_go.exe
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)