Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: allow loading icon directly from icon file #86

Open
merlinz01 opened this issue Jan 29, 2025 · 2 comments · May be fixed by #87
Open

Feature: allow loading icon directly from icon file #86

merlinz01 opened this issue Jan 29, 2025 · 2 comments · May be fixed by #87

Comments

@merlinz01
Copy link

Currently to set the icon on Windows one must read the file bytes, and then this library writes those bytes back to disk in order to call the LoadImage function. I am suspecting this to be the reason why the icon sometimes doesn't show up in my application. Could the winTray.setIcon method be made public through a simple wrapper function? I would be happy to contribute a PR.

@andydotxyz
Copy link
Member

andydotxyz commented Jan 29, 2025

It seems unlikely that this is the cause of your icon not appearing because this is a well-trod code path that works for many people before.
More likely it would relate to file format or size, you can see an example in the repo.

The handle based API you're looking to expose would have to be for windows only because it won't compile on any other platform. If you think it is valuable then go ahead - but I doubt very much this solves your problem.

Note also that with a GUI app it is a bad idea to reference relative files in your code because once it is compiled the file will go away - that is why we normally deal with []byte instead of *File.

@merlinz01
Copy link
Author

See #87 for what I'm wishing for.

@merlinz01 merlinz01 linked a pull request Jan 29, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants