golang 如何开发windows窗口界面
2021-01-05 12:27
标签:应用 ext pat nta 开发 HERE manifest UNC key golang 如何开发windows窗口界面 标签:应用 ext pat nta 开发 HERE manifest UNC key 原文地址:https://www.cnblogs.com/MyUniverse/p/13185022.htmlgolang 如何开发windows窗口界面
go get github.com/lxn/walk
package main
import (
"log"
"strings"
"github.com/lxn/walk"
."github.com/lxn/walk/declarative"
)
func init(){
log.SetFlags(log.Ldate|log.Lshortfile)
}
func main(){
var inTE,outTE *walk.TextEdit
MainWindow{
Title: "test",
MinSize: Size{600,400},
Layout: VBox{},
Children: []Widget{
HSplitter{
Children:[]Widget{
TextEdit{AssignTo:&inTE,MaxLength:10},
TextEdit{AssignTo:&outTE,ReadOnly:true},
},
},
PushButton{
Text: "SCREAM",
OnClicked: func(){
outTE.SetText(strings.ToUpper(inTE.Text()))
},
},
},
}.Run()
}
go get github.com/akavel/rsrc
拉取下来之后,就会在GOPATH/src/bin中会发现有一个rsrc.exe
rsrc -manifest gui.manifest -o rsrc.syso
go build -ldflags="-H windowsgui"
文章标题:golang 如何开发windows窗口界面
文章链接:http://soscw.com/index.php/essay/40262.html