forked from go/golangs_learn
12 changed files with 92 additions and 4 deletions
@ -0,0 +1,3 @@ |
|||||
|
set GOARCH=amd64 |
||||
|
set GOOS=linux |
||||
|
go build main.go |
@ -0,0 +1,3 @@ |
|||||
|
set GOARCH=arm |
||||
|
set GOOS=linux |
||||
|
go build main.go |
@ -1,8 +1,9 @@ |
|||||
SET CGO_ENABLED=0 |
SET CC=gcc |
||||
|
SET CGO_ENABLED=1 |
||||
# shellcheck disable=SC2121 |
# shellcheck disable=SC2121 |
||||
set GOARCH=amd64 |
set GOARCH=amd64 |
||||
# shellcheck disable=SC2121 |
# shellcheck disable=SC2121 |
||||
set GOOS=linux |
set GOOS=darwin |
||||
rsrc -manifest main.manifest -ico main.ico -o main.syso |
rsrc -manifest main.manifest -ico main.ico -o main.syso |
||||
go generate |
go generate |
||||
go build main.go |
go build -gccgoflags="-DDARWIN -x objective-c -fobjc-arc" -ldflags="framework=Cocoa" . |
@ -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
|
||||
|
} |
After Width: | Height: | Size: 6.3 KiB |
@ -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> |
Binary file not shown.
@ -1,4 +1,4 @@ |
|||||
set GO111MODULE=on |
env GO111MODULE=on |
||||
SET CGO_ENABLED=0 |
SET CGO_ENABLED=0 |
||||
set GOARCH=386 |
set GOARCH=386 |
||||
set GOOS=windows |
set GOOS=windows |
@ -0,0 +1,6 @@ |
|||||
|
SET CC=gcc |
||||
|
set GO111MODULE=on |
||||
|
SET CGO_ENABLED=0 |
||||
|
set GOARCH=amd64 |
||||
|
set GOOS=linux |
||||
|
go build main.go |
@ -0,0 +1,6 @@ |
|||||
|
SET CC=gcc |
||||
|
set GO111MODULE=on |
||||
|
SET CGO_ENABLED=0 |
||||
|
set GOARCH=arm |
||||
|
set GOOS=linux |
||||
|
go build main.go |
@ -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" . |
@ -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…
Reference in new issue