tauri-apps / tray-icon

Tray icons for Desktop Applications.
Apache License 2.0
228 stars 33 forks source link

How to use MenuItem on Linux? #99

Closed zkxs closed 1 year ago

zkxs commented 1 year ago

I'm trying to interact with a CheckMenuItem on the event loop in Linux, and I can't figure out how because of the following requirements:

I'm sure I'm missing something, but it looks impossible for the event loop to interact with MenuItems on Linux. If the examples could be updated to show how this is supposed to be done I'd appreciate it!

amrbashir commented 1 year ago

instead of calling gtk::main, you can create a loop and call gtk::main_iteration_do, and you can pair that with a channel to send requests from the main thread to and listen to it on the gtk thread so it modifies the menu.