Browse Source

新增其他功能

master
VIVIMAN 3 years ago
parent
commit
e2ed71bc6d
  1. 32
      golang_learn/data_func/go_to_andlabs/demo01/main.go
  2. 2
      golang_learn/data_func/go_to_windows/build.bat
  3. 1
      golang_learn/go.mod
  4. 2
      golang_learn/go.sum

32
golang_learn/data_func/go_to_andlabs/demo01/main.go

@ -0,0 +1,32 @@
package main
import (
"github.com/andlabs/ui"
_ "github.com/andlabs/ui/winmanifest"
)
func main() {
err := ui.Main(func() {
name := ui.NewEntry()
button := ui.NewButton("Greet")
greeting := ui.NewLabel("")
box := ui.NewVerticalBox()
box.Append(ui.NewLabel("Enter your name:"), false)
box.Append(name, false)
box.Append(button, false)
box.Append(greeting, false)
window := ui.NewWindow("Hello", 200, 100, false)
window.SetChild(box)
button.OnClicked(func(*ui.Button) {
greeting.SetText("Hello, " + name.Text() + "!")
})
window.OnClosing(func(*ui.Window) bool {
ui.Quit()
return true
})
window.Show()
})
if err != nil {
panic(err)
}
}

2
golang_learn/data_func/go_to_windows/build.bat

@ -2,4 +2,4 @@ set GO111MODULE=on
set GOARCH=386
rsrc -manifest main.manifest -ico serviceMonitor.ico -o rsrc.syso
go build -ldflags="-s -w -H=windowsgui"
upx -9 ./serviceMonitor.exe
upx -9 ./go_to_windows.exe

1
golang_learn/go.mod

@ -6,6 +6,7 @@ require (
fyne.io/fyne v1.4.3
github.com/360EntSecGroup-Skylar/excelize v1.4.1
github.com/PuerkitoBio/goquery v1.7.1
github.com/andlabs/ui v0.0.0-20200610043537-70a69d6ae31e
github.com/axgle/mahonia v0.0.0-20180208002826-3358181d7394
github.com/bitly/go-simplejson v0.5.0
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869

2
golang_learn/go.sum

@ -47,6 +47,8 @@ github.com/Kodeworks/golang-image-ico v0.0.0-20141118225523-73f0f4cfade9/go.mod
github.com/PuerkitoBio/goquery v1.7.1 h1:oE+T06D+1T7LNrn91B4aERsRIeCLJ/oPSa6xB9FPnz4=
github.com/PuerkitoBio/goquery v1.7.1/go.mod h1:XY0pP4kfraEmmV1O7Uf6XyjoslwsneBbgeDjLYuN8xY=
github.com/akavel/rsrc v0.8.0/go.mod h1:uLoCtb9J+EyAqh+26kdrTgmzRBFPGOolLWKpdxkKq+c=
github.com/andlabs/ui v0.0.0-20200610043537-70a69d6ae31e h1:wSQCJiig/QkoUnpvelSPbLiZNWvh2yMqQTQvIQqSUkU=
github.com/andlabs/ui v0.0.0-20200610043537-70a69d6ae31e/go.mod h1:5G2EjwzgZUPnnReoKvPWVneT8APYbyKkihDVAHUi0II=
github.com/andybalholm/cascadia v1.2.0 h1:vuRCkM5Ozh/BfmsaTm26kbjm0mIOM3yS5Ek/F5h18aE=
github.com/andybalholm/cascadia v1.2.0/go.mod h1:YCyR8vOZT9aZ1CHEd8ap0gMVm2aFgxBp0T0eFw1RUQY=
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=

Loading…
Cancel
Save