Infinidat / infi.systray

Windows system tray icon
BSD 3-Clause "New" or "Revised" License
215 stars 40 forks source link

Allow menu options to be updatable #12

Open fireph opened 6 years ago

fireph commented 6 years ago

This adds a new parameter to the update function such that the menu_options can be updated the same way that the icon/hover text can be updated. I wanted this functionality for an app where an item in the right click menu changes based on state, and this pull request adds this functionality.

I also tried to avoid duplicated code and keep the menu creation code in one central function "_set_menu_options"

fireph commented 6 years ago

Updated to use DestroyMenu

fenhl commented 6 years ago

Any blockers on getting this merged?

wiggin15 commented 6 years ago

I am still concerned about resource leaks. When using submenus we call "CreatePopupMenu" more times and these resources have to be deleted. We don't do that today (already bad) and this option could make it worse. We should probably keep a collection of all menu and menu icons we create and release them when updating the options.

ZacTallberg commented 4 years ago

@wiggin15 Please please please please can you implement some form of this?? I really want to be able to add new menu options with a dialogue on the fly