ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
## 1.安装 ~~~ go get fyne.io/fyne/v2 ~~~ ## 2.示例 ~~~ type App struct { output *widget.Label } var myapp App func main() { a := app.New() w := a.NewWindow("Hello World") output, entry, btn := myapp.makeUI() w.SetContent(container.NewVBox(output, entry, btn)) w.Resize(fyne.Size{Width: 500, Height: 500}) w.ShowAndRun() } func (app *App) makeUI() (*widget.Label, *widget.Entry, *widget.Button) { output := widget.NewLabel("Hello, World!") entry := widget.NewEntry() btn := widget.NewButton("Enter", func() { app.output.SetText(entry.Text) }) app.output = output return output, entry, btn } ~~~