框架基于gtk 开发。
目前还在封装一些组件和规划架构。
https://github.com/Dorbmon/GDUF
```go
package main
import (
"fmt"
"main.go/core"
"strconv"
)
func main() {
num := 1
numStr := "1"
app, _ := core.NewApp("rx.rx")
process := float64(0)
var mainWin core.Window
entry := core.Entry{Text: core.Str("Initial Text")}
mainWin = core.Window{
Title: core.Str("TestWindow"),
DefaultSize: &core.Vector2{
X: 200,
Y: 500,
},
Body: &core.Column{
Children: []core.Basic{
&core.Button{
Text: core.Str("点我来增加"),
OnClick: func() {
fmt.Println(entry.GetText())
num++
numStr = strconv.Itoa(num)
process += 0.01
mainWin.Update()
},
},
&core.Text{Text: &numStr},
&entry,
&core.Image{ImageFile: core.Str("t.png"), DefaultSize: &core.Vector2{
X: 200,
Y: 200,
}},
&core.ProcessBar{Fraction: &process},
},
ElementPadding: 4,
},
}
app.AddWindow(&mainWin)
app.Run()
}
```
![深度截图_选择区域_20210103231721.png](https://static.studygolang.com/210103/32ec4db5ef34b58ed7a0d0f6acc4d556.png)
有疑问加站长微信联系(非本文作者)