Ciantic / trayicon-rs

Tray Icon Rust
MIT License
53 stars 17 forks source link

How to change menu item text after menu was created? #3

Closed slonopotamus closed 1 year ago

slonopotamus commented 2 years ago

I want to do some kind of runtime changes to the menu, however failing to find any relevant API. Thanks in advance

Ciantic commented 2 years ago

The idea here is that they are not mutable, you should have State -> Menu builder, and re-run it.

See this how to change the checked/disabled state based on application state:

https://github.com/Ciantic/trayicon-rs/blob/b11000e572eccd0c398e358e6e43e296c40b984d/src/menubuilder.rs#L220-L249

Similarily you could change the menu item name based on the application state.