Hey everyone! I'm currently working on a small device that probes various things and I started developing a companion UI using Tkinter. I got to the point where I needed to implement a system tray icon to allow minimizing the app and peek at the probe values without fully opening the program. However, I realized this could get complicated for Linux users due to the split between Qt and GTK, especially since each has its own method for handling system tray functionality. Should I stick with Tkinter for a universal approach, or would it be better to create separate UIs that cater specifically to Windows and Linux (using PyQt for KDE and PyGTK for Gnome)? I know going with multiple frameworks means extra work, but I initially designed the GUI for the specific use of peeking at the system tray. Any advice?
2 Answers
I haven’t used Tkinter personally, but I’ve read that integrating `pystray` for system tray icons with your Tkinter project could be straightforward. It claims to work across Windows, MacOS, and Linux. Just an idea, but if you’re still early in development, switching frameworks could save you time in the long run. WxPython is also a solid option, offering sys tray icons with tooltips, and like Qt, it works on all platforms.
If you're aiming for a universal UI, I’d suggest going with Qt. While Gtk offers a great look on GNOME, it won't support system tray functionality for a while, if at all. Qt is just more versatile in this case.
When you mention using Qt, do you mean PyQt6? I've been using that for my recent projects. Should I focus on learning Qt itself or is PyQt6 sufficient for my needs?
Totally agree on Qt being the go-to. Tkinter’s easy because it has no extra dependencies, but you might find it gets messy quickly. Plus, it’s pretty simple to find examples that include tray icons in Qt apps.