olback / tray-item-rs

Multi-platform Tray Indicator
https://crates.io/crates/tray-item
MIT License
287 stars 39 forks source link

cannot run example windows #51

Closed dvof closed 11 months ago

dvof commented 11 months ago

Man I like the language, but around 90% of the examples I run from repos just fail or don't even build.

cargo run --example macos                                                                              
   Compiling tray-item v0.9.0 (C:\Users\...\Projects\Rust\tray-item-rs)
error[E0599]: no method named `add_quit_item` found for mutable reference `&mut tray_item::api::windows::TrayItemWindows` in the current scope
  --> examples\macos.rs:14:11
   |
14 |     inner.add_quit_item("Quit");
   |           ^^^^^^^^^^^^^ help: there is a method with a similar name: `add_menu_item`

error[E0599]: no method named `display` found for mutable reference `&mut tray_item::api::windows::TrayItemWindows` in the current scope
  --> examples\macos.rs:15:11
   |
15 |     inner.display();
   |           ^^^^^^^ method not found in `&mut TrayItemWindows`

For more information about this error, try `rustc --explain E0599`.
error: could not compile `tray-item` (example "macos") due to 2 previous errors
olback commented 11 months ago

In this particular case, you're building the MacOS example. That will not work on Windows.

dvof commented 11 months ago

Works perfectly, I was just in a frenzy yesterday cloning repos and trying every example, didn't even stop to think about what macos ment. Thanks for your help!