jaredks / rumps

Ridiculously Uncomplicated macOS Python Statusbar apps
BSD 3-Clause "New" or "Revised" License
3.09k stars 179 forks source link

Update menu on show #139

Open laktak opened 4 years ago

laktak commented 4 years ago

Would it be possible to only update the menu items (via a callback) before the menu is shown?

I'm showing a history that updates all the time and would like to set the menu only when it is needed.

jaredks commented 4 years ago

It's definitely possible. I'll see if I can look into how to do this soon.

laktak commented 4 years ago

That's great, thanks!

McMuellermilch commented 4 years ago

I'm not sure if it is the same issue, but is it/would it be possible to update the menu when it is shown? I have items in my menu that update all the time and I would like for the items to update "in realtime" while the menu is open.

balu- commented 4 years ago

Any updates on the topic? A hook for when menu is opend would be really helpfull

vinaydawani commented 3 years ago

would love some update on this! I have a script that is fetching data from a website and it updates every day. So updating only the menu everyday would help a lot.

AlexanderWillner commented 3 years ago

Interestingly, this seems to be more complicated than I thought. I worked on #51 by registering a callback to nsstatusitem as I wanted to update the menu on show, however, it seems that this will not fire any notification. The documentation states: If the status item has a menu set, the action is not sent to the target when the status item is clicked; instead, the click causes the menu to appear.. It seems it is possible somehow to work around this limitation, but it's not that straight forward. @jaredks any ideas?

hbmartin commented 1 year ago

Any progress on this? 🤞