fyne-io / systray

a cross platfrom Go library to place an icon and menu in the notification area
Apache License 2.0
223 stars 41 forks source link

Build menus on demand #61

Open thallgren opened 10 months ago

thallgren commented 10 months ago

Sometimes, a menu hierarchy is not known when the application starts, and it is expensive to fully populate the menu. It would be therefore be great if a menu could be built on demand (when hovered on a mac, or when clicked on a Linux).

Ideally, this would be implemented by providing a way to register a callback function that would be called when the menu is about to be displayed. This function would then populate the menu. Ideally, such a callback function would also be possible on the top menu, and get called when the tray icon is clicked.