From 673c2191dc9a7d1a86965b1235364ba1e342370e Mon Sep 17 00:00:00 2001 From: viviman <962464Nas> Date: Fri, 6 May 2022 13:39:47 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=8C=85=E9=94=99=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data_func/go_to_tray/demo02/main.go | 4 +++- .../data_func/go_to_tray/demo03/main.go | 4 +++- .../data_func/go_to_tray/demo04/.keepgit | 1 + .../data_func/go_to_tray/demo04/main.go | 15 --------------- .../data_func/go_to_wails/demo02/main.go | 3 +++ .../go_to_walk/demo01/{main.go1 => main.go} | 10 ++++------ .../go_to_walk/demo02/{main.go1 => main.go} | 5 +++-- .../go_to_walk/demo03/{main.go1 => main.go} | 9 +++------ .../go_to_walk/demo04/{main.go1 => main.go} | 10 ++-------- .../go_to_walk/demo05/{main.go1 => main.go} | 8 +++----- .../go_to_walk/demo06/{main.go1 => main.go} | 8 +++----- .../go_to_walk/demo07/{main.go1 => main.go} | 6 +++--- .../go_to_walk/demo08/{main.go1 => main.go} | 8 +++----- .../go_to_walk/demo09/{main.go1 => main.go} | 6 +++--- .../go_to_walk/demo10/{main.go1 => main.go} | 8 ++------ .../go_to_walk/demo11/{main.go1 => main.go} | 6 +++--- .../go_to_walk/demo12/{main.go1 => main.go} | 5 +++-- .../go_to_walk/demo13/{main.go1 => main.go} | 13 ++++++------- .../go_to_walk/demo14/{main.go1 => main.go} | 19 +++++++------------ .../go_to_walk/demo15/{main.go1 => main.go} | 6 +++--- .../go_to_walk/demo16/{main.go1 => main.go} | 6 +++--- .../go_to_walk/demo17/{main.go1 => main.go} | 8 ++------ .../go_to_walk/demo18/{main.go1 => main.go} | 8 ++------ .../go_to_walk/demo19/{main.go1 => main.go} | 5 ++--- .../go_to_walk/demo20/{main.go1 => main.go} | 3 +++ .../go_to_walk/demo21/{main.go1 => main.go} | 6 ++---- .../{go_to_gui => go_to_walk/demo22}/main.go | 4 +++- 27 files changed, 78 insertions(+), 116 deletions(-) create mode 100644 golang_learn/data_func/go_to_tray/demo04/.keepgit delete mode 100644 golang_learn/data_func/go_to_tray/demo04/main.go rename golang_learn/data_func/go_to_walk/demo01/{main.go1 => main.go} (84%) rename golang_learn/data_func/go_to_walk/demo02/{main.go1 => main.go} (89%) rename golang_learn/data_func/go_to_walk/demo03/{main.go1 => main.go} (92%) rename golang_learn/data_func/go_to_walk/demo04/{main.go1 => main.go} (74%) rename golang_learn/data_func/go_to_walk/demo05/{main.go1 => main.go} (93%) rename golang_learn/data_func/go_to_walk/demo06/{main.go1 => main.go} (94%) rename golang_learn/data_func/go_to_walk/demo07/{main.go1 => main.go} (95%) rename golang_learn/data_func/go_to_walk/demo08/{main.go1 => main.go} (98%) rename golang_learn/data_func/go_to_walk/demo09/{main.go1 => main.go} (98%) rename golang_learn/data_func/go_to_walk/demo10/{main.go1 => main.go} (98%) rename golang_learn/data_func/go_to_walk/demo11/{main.go1 => main.go} (93%) rename golang_learn/data_func/go_to_walk/demo12/{main.go1 => main.go} (97%) rename golang_learn/data_func/go_to_walk/demo13/{main.go1 => main.go} (88%) rename golang_learn/data_func/go_to_walk/demo14/{main.go1 => main.go} (86%) rename golang_learn/data_func/go_to_walk/demo15/{main.go1 => main.go} (97%) rename golang_learn/data_func/go_to_walk/demo16/{main.go1 => main.go} (98%) rename golang_learn/data_func/go_to_walk/demo17/{main.go1 => main.go} (90%) rename golang_learn/data_func/go_to_walk/demo18/{main.go1 => main.go} (78%) rename golang_learn/data_func/go_to_walk/demo19/{main.go1 => main.go} (96%) rename golang_learn/data_func/go_to_walk/demo20/{main.go1 => main.go} (97%) rename golang_learn/data_func/go_to_walk/demo21/{main.go1 => main.go} (90%) rename golang_learn/data_func/{go_to_gui => go_to_walk/demo22}/main.go (96%) diff --git a/golang_learn/data_func/go_to_tray/demo02/main.go b/golang_learn/data_func/go_to_tray/demo02/main.go index 635c1eb..97a2331 100644 --- a/golang_learn/data_func/go_to_tray/demo02/main.go +++ b/golang_learn/data_func/go_to_tray/demo02/main.go @@ -1,3 +1,6 @@ +//go:build windows +// +build windows + package main import ( @@ -6,7 +9,6 @@ import ( "net/http" "github.com/braintree/manners" - "github.com/lxn/walk" ) func handler(w http.ResponseWriter, r *http.Request) { diff --git a/golang_learn/data_func/go_to_tray/demo03/main.go b/golang_learn/data_func/go_to_tray/demo03/main.go index 18327dd..0a3ce8c 100644 --- a/golang_learn/data_func/go_to_tray/demo03/main.go +++ b/golang_learn/data_func/go_to_tray/demo03/main.go @@ -1,3 +1,6 @@ +//go:build windows +// +build windows + package main import ( @@ -9,7 +12,6 @@ import ( "time" "github.com/braintree/manners" - "github.com/lxn/walk" ) type MyWindow struct { diff --git a/golang_learn/data_func/go_to_tray/demo04/.keepgit b/golang_learn/data_func/go_to_tray/demo04/.keepgit new file mode 100644 index 0000000..d2bd535 --- /dev/null +++ b/golang_learn/data_func/go_to_tray/demo04/.keepgit @@ -0,0 +1 @@ +增加版本控制 \ No newline at end of file diff --git a/golang_learn/data_func/go_to_tray/demo04/main.go b/golang_learn/data_func/go_to_tray/demo04/main.go deleted file mode 100644 index 4099b9c..0000000 --- a/golang_learn/data_func/go_to_tray/demo04/main.go +++ /dev/null @@ -1,15 +0,0 @@ -package main - -import ( - "fmt" - "github.com/braintree/manners" - "net/http" -) - -func main() { - err := manners.ListenAndServe(":54022", http.DefaultServeMux) - if err == nil { - fmt.Println("哼") - } - fmt.Println("哈哈") -} diff --git a/golang_learn/data_func/go_to_wails/demo02/main.go b/golang_learn/data_func/go_to_wails/demo02/main.go index 8b308bf..400009b 100644 --- a/golang_learn/data_func/go_to_wails/demo02/main.go +++ b/golang_learn/data_func/go_to_wails/demo02/main.go @@ -1,3 +1,6 @@ +//go:build windows +// +build windows + package main import ( diff --git a/golang_learn/data_func/go_to_walk/demo01/main.go1 b/golang_learn/data_func/go_to_walk/demo01/main.go similarity index 84% rename from golang_learn/data_func/go_to_walk/demo01/main.go1 rename to golang_learn/data_func/go_to_walk/demo01/main.go index 910a50f..64ccf5c 100644 --- a/golang_learn/data_func/go_to_walk/demo01/main.go1 +++ b/golang_learn/data_func/go_to_walk/demo01/main.go @@ -1,15 +1,13 @@ -package main +//go:build windows +// +build windows -import ( - "github.com/lxn/walk" - . "github.com/lxn/walk/declarative" -) +package main func main() { var inTE1, inTE2, outTE *walk.TextEdit MainWindow{ Title: "码表转换生成器", - Icon: "src/data_func/go_to_walk/demo01/img/rc.ico", + Icon: "src/data_func/go_to_walk/demo01/img/rc.ico", MinSize: Size{600, 400}, Layout: VBox{}, Children: []Widget{ diff --git a/golang_learn/data_func/go_to_walk/demo02/main.go1 b/golang_learn/data_func/go_to_walk/demo02/main.go similarity index 89% rename from golang_learn/data_func/go_to_walk/demo02/main.go1 rename to golang_learn/data_func/go_to_walk/demo02/main.go index e9c8c2a..ac9b4b4 100644 --- a/golang_learn/data_func/go_to_walk/demo02/main.go1 +++ b/golang_learn/data_func/go_to_walk/demo02/main.go @@ -1,9 +1,10 @@ +//go:build windows +// +build windows + package main import ( "fmt" - "github.com/lxn/walk" - . "github.com/lxn/walk/declarative" "strings" ) diff --git a/golang_learn/data_func/go_to_walk/demo03/main.go1 b/golang_learn/data_func/go_to_walk/demo03/main.go similarity index 92% rename from golang_learn/data_func/go_to_walk/demo03/main.go1 rename to golang_learn/data_func/go_to_walk/demo03/main.go index 9e08c12..16a2a0c 100644 --- a/golang_learn/data_func/go_to_walk/demo03/main.go1 +++ b/golang_learn/data_func/go_to_walk/demo03/main.go @@ -1,9 +1,7 @@ -package main +//go:build windows +// +build windows -import ( - "github.com/lxn/walk" - "github.com/lxn/win" -) +package main // 失败! @@ -31,4 +29,3 @@ func main() { // 运行窗体 window.Run() } - diff --git a/golang_learn/data_func/go_to_walk/demo04/main.go1 b/golang_learn/data_func/go_to_walk/demo04/main.go similarity index 74% rename from golang_learn/data_func/go_to_walk/demo04/main.go1 rename to golang_learn/data_func/go_to_walk/demo04/main.go index e6c4fb1..8f63e44 100644 --- a/golang_learn/data_func/go_to_walk/demo04/main.go1 +++ b/golang_learn/data_func/go_to_walk/demo04/main.go @@ -1,6 +1,5 @@ -// 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. +//go:build windows +// +build windows package main @@ -8,11 +7,6 @@ import ( "log" ) -import ( - "github.com/lxn/walk" - . "github.com/lxn/walk/declarative" -) - func main() { var te *walk.TextEdit diff --git a/golang_learn/data_func/go_to_walk/demo05/main.go1 b/golang_learn/data_func/go_to_walk/demo05/main.go similarity index 93% rename from golang_learn/data_func/go_to_walk/demo05/main.go1 rename to golang_learn/data_func/go_to_walk/demo05/main.go index fb17659..c8d5935 100644 --- a/golang_learn/data_func/go_to_walk/demo05/main.go1 +++ b/golang_learn/data_func/go_to_walk/demo05/main.go @@ -1,9 +1,7 @@ -package main +//go:build windows +// +build windows -import ( - "github.com/lxn/walk" - . "github.com/lxn/walk/declarative" -) +package main import ( "fmt" diff --git a/golang_learn/data_func/go_to_walk/demo06/main.go1 b/golang_learn/data_func/go_to_walk/demo06/main.go similarity index 94% rename from golang_learn/data_func/go_to_walk/demo06/main.go1 rename to golang_learn/data_func/go_to_walk/demo06/main.go index 6ae06fa..dd86f2c 100644 --- a/golang_learn/data_func/go_to_walk/demo06/main.go1 +++ b/golang_learn/data_func/go_to_walk/demo06/main.go @@ -1,9 +1,7 @@ -package main +//go:build windows +// +build windows -import ( - "github.com/lxn/walk" - . "github.com/lxn/walk/declarative" -) +package main // 失败了! diff --git a/golang_learn/data_func/go_to_walk/demo07/main.go1 b/golang_learn/data_func/go_to_walk/demo07/main.go similarity index 95% rename from golang_learn/data_func/go_to_walk/demo07/main.go1 rename to golang_learn/data_func/go_to_walk/demo07/main.go index 219aefb..9e8bf50 100644 --- a/golang_learn/data_func/go_to_walk/demo07/main.go1 +++ b/golang_learn/data_func/go_to_walk/demo07/main.go @@ -1,12 +1,12 @@ +//go:build windows +// +build windows + package main import ( "fmt" "log" "strings" - - "github.com/lxn/walk" - . "github.com/lxn/walk/declarative" ) // 失败了! diff --git a/golang_learn/data_func/go_to_walk/demo08/main.go1 b/golang_learn/data_func/go_to_walk/demo08/main.go similarity index 98% rename from golang_learn/data_func/go_to_walk/demo08/main.go1 rename to golang_learn/data_func/go_to_walk/demo08/main.go index 1c35ae6..bf598f2 100644 --- a/golang_learn/data_func/go_to_walk/demo08/main.go1 +++ b/golang_learn/data_func/go_to_walk/demo08/main.go @@ -1,3 +1,6 @@ +//go:build windows +// +build windows + package main // 失败了! @@ -15,11 +18,6 @@ import ( "time" ) -import ( - "github.com/lxn/walk" - . "github.com/lxn/walk/declarative" -) - type ShuJu struct { Name string Pwd string diff --git a/golang_learn/data_func/go_to_walk/demo09/main.go1 b/golang_learn/data_func/go_to_walk/demo09/main.go similarity index 98% rename from golang_learn/data_func/go_to_walk/demo09/main.go1 rename to golang_learn/data_func/go_to_walk/demo09/main.go index d18e012..d47f036 100644 --- a/golang_learn/data_func/go_to_walk/demo09/main.go1 +++ b/golang_learn/data_func/go_to_walk/demo09/main.go @@ -1,11 +1,11 @@ +//go:build windows +// +build windows + package main import ( "fmt" "sort" - - "github.com/lxn/walk" - . "github.com/lxn/walk/declarative" ) type Condom struct { diff --git a/golang_learn/data_func/go_to_walk/demo10/main.go1 b/golang_learn/data_func/go_to_walk/demo10/main.go similarity index 98% rename from golang_learn/data_func/go_to_walk/demo10/main.go1 rename to golang_learn/data_func/go_to_walk/demo10/main.go index 8511ba9..b2382db 100644 --- a/golang_learn/data_func/go_to_walk/demo10/main.go1 +++ b/golang_learn/data_func/go_to_walk/demo10/main.go @@ -1,6 +1,5 @@ -// Copyright 2012 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. +//go:build windows +// +build windows package main @@ -18,10 +17,7 @@ import ( "time" "github.com/PuerkitoBio/goquery" - "github.com/lxn/walk" "github.com/russross/blackfriday" - - . "github.com/lxn/walk/declarative" ) func main() { diff --git a/golang_learn/data_func/go_to_walk/demo11/main.go1 b/golang_learn/data_func/go_to_walk/demo11/main.go similarity index 93% rename from golang_learn/data_func/go_to_walk/demo11/main.go1 rename to golang_learn/data_func/go_to_walk/demo11/main.go index e0cfa59..6f6b1c3 100644 --- a/golang_learn/data_func/go_to_walk/demo11/main.go1 +++ b/golang_learn/data_func/go_to_walk/demo11/main.go @@ -1,10 +1,10 @@ +//go:build windows +// +build windows + package main import ( "strings" - - "github.com/lxn/walk" - . "github.com/lxn/walk/declarative" ) func main() { diff --git a/golang_learn/data_func/go_to_walk/demo12/main.go1 b/golang_learn/data_func/go_to_walk/demo12/main.go similarity index 97% rename from golang_learn/data_func/go_to_walk/demo12/main.go1 rename to golang_learn/data_func/go_to_walk/demo12/main.go index 699b66f..c7f256c 100644 --- a/golang_learn/data_func/go_to_walk/demo12/main.go1 +++ b/golang_learn/data_func/go_to_walk/demo12/main.go @@ -1,9 +1,11 @@ +//go:build windows +// +build windows + package main // 失败了! import ( - "github.com/lxn/walk" "log" ) @@ -57,4 +59,3 @@ func GuiInit() { } mw.Run() } - diff --git a/golang_learn/data_func/go_to_walk/demo13/main.go1 b/golang_learn/data_func/go_to_walk/demo13/main.go similarity index 88% rename from golang_learn/data_func/go_to_walk/demo13/main.go1 rename to golang_learn/data_func/go_to_walk/demo13/main.go index abf72b3..121fedb 100644 --- a/golang_learn/data_func/go_to_walk/demo13/main.go1 +++ b/golang_learn/data_func/go_to_walk/demo13/main.go @@ -1,8 +1,9 @@ +//go:build windows +// +build windows + package main import ( - "github.com/lxn/walk" - . "github.com/lxn/walk/declarative" "log" ) @@ -13,11 +14,11 @@ func main() { var outTE *walk.TextEdit if err := (MainWindow{ - Title: "你好!", + Title: "你好!", // 这样实现将页面加载到主界面上 AssignTo: &mw.MainWindow, - MinSize: Size{600, 400}, - Layout: VBox{}, + MinSize: Size{600, 400}, + Layout: VBox{}, Children: []Widget{ HSplitter{ Children: []Widget{ @@ -38,7 +39,6 @@ func main() { mw.Run() } - // 定义 应用的结构体 type MyMainWindow struct { //匿名 @@ -59,4 +59,3 @@ type MyMainWindow struct { favorites *walk.PushButton unfavorites *walk.PushButton } - diff --git a/golang_learn/data_func/go_to_walk/demo14/main.go1 b/golang_learn/data_func/go_to_walk/demo14/main.go similarity index 86% rename from golang_learn/data_func/go_to_walk/demo14/main.go1 rename to golang_learn/data_func/go_to_walk/demo14/main.go index 0e82f63..7e8b9a8 100644 --- a/golang_learn/data_func/go_to_walk/demo14/main.go1 +++ b/golang_learn/data_func/go_to_walk/demo14/main.go @@ -1,9 +1,7 @@ -package main +//go:build windows +// +build windows -import ( - "github.com/lxn/walk" - . "github.com/lxn/walk/declarative" -) +package main func main() { //main @@ -12,17 +10,17 @@ func main() { var outTE *walk.ProgressBar if err := (MainWindow{ - Title: "测试进度条!", + Title: "测试进度条!", // 这样实现将页面加载到主界面上 AssignTo: &mw.MainWindow, - Size: Size{600, 40}, - Layout: VBox{}, + Size: Size{600, 40}, + Layout: VBox{}, Children: []Widget{ ProgressBar{ AssignTo: &outTE, MaxValue: 100, MinValue: 0, - Value: 0, + Value: 0, }, PushButton{ Text: "关闭", @@ -37,11 +35,9 @@ func main() { return } - mw.Run() } - // 定义 应用的结构体 type MyMainWindow struct { //匿名 @@ -62,4 +58,3 @@ type MyMainWindow struct { favorites *walk.PushButton unfavorites *walk.PushButton } - diff --git a/golang_learn/data_func/go_to_walk/demo15/main.go1 b/golang_learn/data_func/go_to_walk/demo15/main.go similarity index 97% rename from golang_learn/data_func/go_to_walk/demo15/main.go1 rename to golang_learn/data_func/go_to_walk/demo15/main.go index 57b4f89..68c1e59 100644 --- a/golang_learn/data_func/go_to_walk/demo15/main.go1 +++ b/golang_learn/data_func/go_to_walk/demo15/main.go @@ -1,3 +1,6 @@ +//go:build windows +// +build windows + package main import ( @@ -5,9 +8,6 @@ import ( "io" "os" "strings" - - "github.com/lxn/walk" - . "github.com/lxn/walk/declarative" ) type MyMainWindow struct { diff --git a/golang_learn/data_func/go_to_walk/demo16/main.go1 b/golang_learn/data_func/go_to_walk/demo16/main.go similarity index 98% rename from golang_learn/data_func/go_to_walk/demo16/main.go1 rename to golang_learn/data_func/go_to_walk/demo16/main.go index 1b50698..9c08dca 100644 --- a/golang_learn/data_func/go_to_walk/demo16/main.go1 +++ b/golang_learn/data_func/go_to_walk/demo16/main.go @@ -1,3 +1,6 @@ +//go:build windows +// +build windows + package main import ( @@ -5,9 +8,6 @@ import ( "io" "os" "strings" - - "github.com/lxn/walk" - . "github.com/lxn/walk/declarative" ) type MyMainWindow struct { diff --git a/golang_learn/data_func/go_to_walk/demo17/main.go1 b/golang_learn/data_func/go_to_walk/demo17/main.go similarity index 90% rename from golang_learn/data_func/go_to_walk/demo17/main.go1 rename to golang_learn/data_func/go_to_walk/demo17/main.go index 9405bbe..1ab84b3 100644 --- a/golang_learn/data_func/go_to_walk/demo17/main.go1 +++ b/golang_learn/data_func/go_to_walk/demo17/main.go @@ -1,14 +1,10 @@ -// Copyright 2016 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. +//go:build windows +// +build windows package main import ( "log" - - "github.com/lxn/walk" - . "github.com/lxn/walk/declarative" ) func main() { diff --git a/golang_learn/data_func/go_to_walk/demo18/main.go1 b/golang_learn/data_func/go_to_walk/demo18/main.go similarity index 78% rename from golang_learn/data_func/go_to_walk/demo18/main.go1 rename to golang_learn/data_func/go_to_walk/demo18/main.go index be4fe79..2daa0cc 100644 --- a/golang_learn/data_func/go_to_walk/demo18/main.go1 +++ b/golang_learn/data_func/go_to_walk/demo18/main.go @@ -1,14 +1,10 @@ -// Copyright 2010 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. +//go:build windows +// +build windows package main import ( "strings" - - "github.com/lxn/walk" - . "github.com/lxn/walk/declarative" ) func main() { diff --git a/golang_learn/data_func/go_to_walk/demo19/main.go1 b/golang_learn/data_func/go_to_walk/demo19/main.go similarity index 96% rename from golang_learn/data_func/go_to_walk/demo19/main.go1 rename to golang_learn/data_func/go_to_walk/demo19/main.go index f4b763c..154735a 100644 --- a/golang_learn/data_func/go_to_walk/demo19/main.go1 +++ b/golang_learn/data_func/go_to_walk/demo19/main.go @@ -1,6 +1,5 @@ -// Copyright 2011 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. +//go:build windows +// +build windows package main diff --git a/golang_learn/data_func/go_to_walk/demo20/main.go1 b/golang_learn/data_func/go_to_walk/demo20/main.go similarity index 97% rename from golang_learn/data_func/go_to_walk/demo20/main.go1 rename to golang_learn/data_func/go_to_walk/demo20/main.go index 62201e0..9e308ce 100644 --- a/golang_learn/data_func/go_to_walk/demo20/main.go1 +++ b/golang_learn/data_func/go_to_walk/demo20/main.go @@ -1,3 +1,6 @@ +//go:build windows +// +build windows + package main import ( diff --git a/golang_learn/data_func/go_to_walk/demo21/main.go1 b/golang_learn/data_func/go_to_walk/demo21/main.go similarity index 90% rename from golang_learn/data_func/go_to_walk/demo21/main.go1 rename to golang_learn/data_func/go_to_walk/demo21/main.go index 8ca6579..3ee5870 100644 --- a/golang_learn/data_func/go_to_walk/demo21/main.go1 +++ b/golang_learn/data_func/go_to_walk/demo21/main.go @@ -1,11 +1,9 @@ -// Copyright 2011 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. +//go:build windows +// +build windows package main import ( - "github.com/lxn/walk" "log" ) diff --git a/golang_learn/data_func/go_to_gui/main.go b/golang_learn/data_func/go_to_walk/demo22/main.go similarity index 96% rename from golang_learn/data_func/go_to_gui/main.go rename to golang_learn/data_func/go_to_walk/demo22/main.go index 8c3c9ae..eda83ec 100644 --- a/golang_learn/data_func/go_to_gui/main.go +++ b/golang_learn/data_func/go_to_walk/demo22/main.go @@ -1,7 +1,9 @@ +//go:build windows +// +build windows + package main import ( - "github.com/lxn/walk" "log" )