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

Mac example with custom icons #42

Open
oren0e opened this issue Jul 20, 2023 · 2 comments
Open

Mac example with custom icons #42

oren0e opened this issue Jul 20, 2023 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@oren0e
Copy link

oren0e commented Jul 20, 2023

This super simple example does work on my mac:

use tray_item::{IconSource, TrayItem};

fn main() {
    let mut tray = TrayItem::new("Tray Example", IconSource::Resource("")).unwrap();

    let mut inner = tray.inner_mut();
    inner.display();
}

But I want to see an example where I can display a custom png icon and then based on some event or condition - change that icon to something else. It's not clear how to do this in this case.

@LighghtEeloo
Copy link

Same here. I saw the macos impl of tray-item-rs using cocoa::appkit::NSImage, and tracked down to this documentation. However, I'm not sure how to create the app bundle...

@olback olback added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Oct 18, 2023
@ColeTownsend
Copy link

This super simple example does work on my mac:

use tray_item::{IconSource, TrayItem};

fn main() {
    let mut tray = TrayItem::new("Tray Example", IconSource::Resource("")).unwrap();

    let mut inner = tray.inner_mut();
    inner.display();
}

But I want to see an example where I can display a custom png icon and then based on some event or condition - change that icon to something else. It's not clear how to do this in this case.

You can dynamically set the png icon by running set_icon again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants