Skip to content
This repository has been archived by the owner on Dec 30, 2020. It is now read-only.

Cross-platform set_icon_from_resource? #12

Open
qdot opened this issue Mar 2, 2017 · 3 comments
Open

Cross-platform set_icon_from_resource? #12

qdot opened this issue Mar 2, 2017 · 3 comments

Comments

@qdot
Copy link
Owner

qdot commented Mar 2, 2017

On windows, we can set an icon via a resource name. On linux, we can use set_icon_from_stock or themes. Not sure what the situation on mac is. Is there a way to unify all of these under the same generic function?

@qdot qdot mentioned this issue Mar 2, 2017
@qdot qdot modified the milestone: v1.0 - Solidify API Mar 2, 2017
@daniel-abramov
Copy link
Contributor

I think we can do something similar to what I've done when I worked on set_icon_from_buffer() for Windows. Since resource topic is something that is not unified across platforms, we can use include_bytes!(), this gives us some sort of "crossplatform resources" I guess. In this case the only thing we have to support is a function which accepts the icon as a slice (perhaps &'static [u8]). I implemented the similar function on Windows already (you've merged it recently), yesterday I implemented the same thing for Mac in my fork.

@qdot
Copy link
Owner Author

qdot commented Mar 3, 2017

Ok. I'll see if there's something available in gtk that would accept that kind of argument too. You familiar with anything @jonhoo? The Go systray thing I was cribbing off of takes a blob, saves to it /tmp, and opens that file, which seems hacky.

@jonhoo
Copy link

jonhoo commented Mar 3, 2017

Closest I can think of is gtk_status_icon_set_from_pixbuf, but like everything else relating to tray icons this has been deprecated in 3.14 :(

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants