Browse Source

增加其他子版本代码

master
VIVIMAN 3 years ago
parent
commit
9ffb5fb9fd
  1. 3
      golang_learn/data_func/go_to_tray/demo00/amd-linux.bat
  2. 3
      golang_learn/data_func/go_to_tray/demo00/arm-linux.bat
  3. 7
      golang_learn/data_func/go_to_tray/demo00/mac.bat
  4. 31
      golang_learn/data_func/go_to_tray/demo00/main.go
  5. BIN
      golang_learn/data_func/go_to_tray/demo00/main.ico
  6. 22
      golang_learn/data_func/go_to_tray/demo00/main.manifest
  7. BIN
      golang_learn/data_func/go_to_tray/demo00/main.syso
  8. 2
      golang_learn/data_func/go_to_tray/demo00/win.bat
  9. 6
      golang_learn/data_func/go_to_tray/demo04/amd-linux.bat
  10. 6
      golang_learn/data_func/go_to_tray/demo04/arm-linux.bat
  11. 9
      golang_learn/data_func/go_to_tray/demo04/mac.bat
  12. 7
      golang_learn/data_func/go_to_tray/demo04/win.bat

3
golang_learn/data_func/go_to_tray/demo00/amd-linux.bat

@ -0,0 +1,3 @@
set GOARCH=amd64
set GOOS=linux
go build main.go

3
golang_learn/data_func/go_to_tray/demo00/arm-linux.bat

@ -0,0 +1,3 @@
set GOARCH=arm
set GOOS=linux
go build main.go

7
golang_learn/data_func/go_to_tray/demo04/build.sh → golang_learn/data_func/go_to_tray/demo00/mac.bat

@ -1,8 +1,9 @@
SET CGO_ENABLED=0
SET CC=gcc
SET CGO_ENABLED=1
# shellcheck disable=SC2121
set GOARCH=amd64
# shellcheck disable=SC2121
set GOOS=linux
set GOOS=darwin
rsrc -manifest main.manifest -ico main.ico -o main.syso
go generate
go build main.go
go build -gccgoflags="-DDARWIN -x objective-c -fobjc-arc" -ldflags="framework=Cocoa" .

31
golang_learn/data_func/go_to_tray/demo00/main.go

@ -0,0 +1,31 @@
package main
import (
"github.com/riftbit/go-systray"
"github.com/riftbit/go-systray/example/icon"
)
func main() {
_ = systray.Run(onReady, onExit)
}
func onReady() {
_ = systray.SetIcon(icon.Data)
_ = systray.SetTitle("Awesome App")
_ = systray.SetTooltip("Pretty awesome超级棒")
mQuit := systray.AddMenuItem("Quit", "Quit the whole app", 0)
go func() {
for {
select {
case <-mQuit.OnClickCh():
_ = systray.Quit()
return
}
}
}()
}
func onExit() {
// clean up here
}

BIN
golang_learn/data_func/go_to_tray/demo00/main.ico

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

22
golang_learn/data_func/go_to_tray/demo00/main.manifest

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0" processorArchitecture="*" name="SomeFunkyNameHere" type="win32"/>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"/>
</dependentAssembly>
</dependency>
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2, PerMonitor</dpiAwareness>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">True</dpiAware>
</windowsSettings>
</application>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="requireAdministrator"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>

BIN
golang_learn/data_func/go_to_tray/demo00/main.syso

Binary file not shown.

2
golang_learn/data_func/go_to_tray/demo04/build.bat → golang_learn/data_func/go_to_tray/demo00/win.bat

@ -1,4 +1,4 @@
set GO111MODULE=on
env GO111MODULE=on
SET CGO_ENABLED=0
set GOARCH=386
set GOOS=windows

6
golang_learn/data_func/go_to_tray/demo04/amd-linux.bat

@ -0,0 +1,6 @@
SET CC=gcc
set GO111MODULE=on
SET CGO_ENABLED=0
set GOARCH=amd64
set GOOS=linux
go build main.go

6
golang_learn/data_func/go_to_tray/demo04/arm-linux.bat

@ -0,0 +1,6 @@
SET CC=gcc
set GO111MODULE=on
SET CGO_ENABLED=0
set GOARCH=arm
set GOOS=linux
go build main.go

9
golang_learn/data_func/go_to_tray/demo04/mac.bat

@ -0,0 +1,9 @@
SET CC=gcc
SET CGO_ENABLED=1
# shellcheck disable=SC2121
set GOARCH=amd64
# shellcheck disable=SC2121
set GOOS=darwin
rsrc -manifest main.manifest -ico main.ico -o main.syso
go generate
go build -gccgoflags="-DDARWIN -x objective-c -fobjc-arc" -ldflags="framework=Cocoa" .

7
golang_learn/data_func/go_to_tray/demo04/win.bat

@ -0,0 +1,7 @@
env GO111MODULE=on
SET CGO_ENABLED=1
set GOARCH=386
set GOOS=windows
rsrc -manifest main.manifest -ico main.ico -o main.syso
go generate
go build -ldflags="-s -w -H=windowsgui" -o 꽉데으-頓契솰왠.exe
Loading…
Cancel
Save