Ai
1 Star 0 Fork 0

youxiuliang/walk

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
clipboard.go 905 Bytes
一键复制 编辑 原始数据 按行查看 历史
Alexander Neumann 提交于 2013-05-18 02:56 +08:00 . Add clipboard example
// Copyright 2013 The Walk Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"log"
)
import (
"github.com/lxn/walk"
. "github.com/lxn/walk/declarative"
)
func main() {
var te *walk.TextEdit
if _, err := (MainWindow{
Title: "Walk Clipboard Example",
MinSize: Size{300, 200},
Layout: VBox{},
Children: []Widget{
PushButton{
Text: "Copy",
OnClicked: func() {
if err := walk.Clipboard().SetText(te.Text()); err != nil {
log.Print("Copy: ", err)
}
},
},
PushButton{
Text: "Paste",
OnClicked: func() {
if text, err := walk.Clipboard().Text(); err != nil {
log.Print("Paste: ", err)
} else {
te.SetText(text)
}
},
},
TextEdit{
AssignTo: &te,
},
},
}).Run(); err != nil {
log.Fatal(err)
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/showyo/walk.git
git@gitee.com:showyo/walk.git
showyo
walk
walk
2a61ddb5a2b8

搜索帮助