SetIcon([] byte) Doesn't work. #3600
Unanswered
Sawita-code
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Hi there! Thanks for this feedback. Thanks again 🙏 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I have been trying to implement a cross-platform systray for wails v2 (using wails v2 + getlantern package) but it gives linker error in macOS.
Hence i have been trying to achieve the same using wails v3 alpha.
Below is the code in which i am trying to set a custom icon using the SetIcon() function, but the code panics at runtime.
Am i doing something wrong or this is an issue?
And is there any other approach to achieve systray in v2 which works on all three platforms(windows, linux, macOS)?
code:
icon, err := os.ReadFile("myicon.ico")
if err != nil {
fmt.Println("err ", err)
icon = icons.SystrayLight
// panic(err)
}
systemTray = systemTray.SetIcon(icon)
Error :
panic: The operation completed successfully.
goroutine 1 [running, locked to thread]:
github.com/samber/lo.must({0xd5a5e0, 0x12d4e80}, {0x0, 0x0, 0x0})
C:/Users/user5/go/pkg/mod/github.com/samber/[email protected]/errors.go:53 +0x1a5
github.com/samber/lo.Must[...](0x0?, {0xd5a5e0, 0x12d4e80?}, {0x0?, 0x3b480?, 0x0?})
C:/Users/user5/go/pkg/mod/github.com/samber/[email protected]/errors.go:65 +0x36
github.com/wailsapp/wails/v3/pkg/application.(*windowsSystemTray).run(0xc00023b500)
D:/wails/v3/pkg/application/systemtray_windows.go:188 +0x178
github.com/wailsapp/wails/v3/pkg/application.InvokeSync.func1()
D:/wails/v3/pkg/application/mainthread.go:28 +0x42
github.com/wailsapp/wails/v3/pkg/application.(*windowsApp).invokeCallback(0xc0000e4000, 0x31f?, 0x8?)
D:/wails/v3/pkg/application/mainthread_windows.go:125 +0x2ce
github.com/wailsapp/wails/v3/pkg/application.(*windowsApp).wndProc(0x0?, 0xc00011f190?, 0x11f130?, 0x0?, 0xc00011f3c8?)
D:/wails/v3/pkg/application/application_windows.go:229 +0x352
syscall.SyscallN(0x7ff957c38260, {0xc0000883b0?, 0x1, 0x81a7d3?})
C:/Program Files/Go/src/runtime/syscall_windows.go:544 +0x11d
syscall.(*Proc).Call(0x764365?, {0xc0000883b0, 0x1, 0x1})
C:/Program Files/Go/src/syscall/dll_windows.go:166 +0x39
syscall.(*LazyProc).Call(0xc000252030, {0xc0000883b0, 0x1, 0x1})
C:/Program Files/Go/src/syscall/dll_windows.go:286 +0x45
github.com/wailsapp/wails/v3/pkg/w32.DispatchMessage(0x0?)
D:/wails/v3/pkg/w32/user32.go:441 +0x45
github.com/wailsapp/wails/v3/pkg/application.(*windowsApp).runMainLoop(0xc0000e4000)
D:/wails/v3/pkg/application/mainthread_windows.go:64 +0xa5
github.com/wailsapp/wails/v3/pkg/application.(*windowsApp).run(0xc0000e4000)
D:/wails/v3/pkg/application/application_windows.go:189 +0xe5
github.com/wailsapp/wails/v3/pkg/application.(*App).Run(0xc000272308)
D:/wails/v3/pkg/application/application.go:553 +0x3d6
main.main()
D:/OmniClient_v3/web/client/main.go:254 +0x557
ERROR task: Failed to run task "run": exit status 2
wails3 doctor
Wails Doctor
System
┌────────────────────────────────────────────────────────────────────────────────────────────────────┐
| Name | Windows 10 Home Single Language |
| Version | 2009 (Build: 22631) |
| ID | 23H2 |
| Branding | Windows 11 Home Single Language |
| Platform | windows |
| Architecture | amd64 |
| Go WebView2Loader | true |
| WebView2 Version | 126.0.2592.87 |
| CPU | AMD Ryzen 5 5500U with Radeon Graphics |
| GPU 1 | AMD Radeon(TM) Graphics (Advanced Micro Devices, Inc.) - Driver: 31.0.21910.5 |
| Memory | 8GB |
└────────────────────────────────────────────────────────────────────────────────────────────────────┘
Build Environment
┌─────────────────────────────────────────────────────────┐
| Wails CLI | v3.0.0-alpha.4 |
| Go Version | go1.22.5 |
| Revision | 5fcebd0 |
| Modified | false |
| -buildmode | exe |
| -compiler | gc |
| CGO_CFLAGS | |
| CGO_CPPFLAGS | |
| CGO_CXXFLAGS | |
| CGO_ENABLED | 1 |
| CGO_LDFLAGS | |
| GOAMD64 | v1 |
| GOARCH | amd64 |
| GOOS | windows |
| vcs | git |
| vcs.modified | false |
| vcs.revision | 5fcebd0 |
| vcs.time | 2024-07-02T08:49:19Z |
└─────────────────────────────────────────────────────────┘
Dependencies
┌───────────────────────────┐
| npm | 10.5.2 |
| NSIS | Not Installed |
└─ * - Optional Dependency ─┘
Beta Was this translation helpful? Give feedback.
All reactions