I am computer science student. And I want to write a native desktop app for Ubuntu which will be displayed in the system tray. I tried building a sample app using ElectronJS but it compiles to very big file size for a hello world system tray app.
I have looked into GTK and Qt but I am confused which one I should use. I want to know which one will be easier to pick up and get going.
The safest, simplest option would be C, CLion and GTK. Qt is pretty heavy in it's own ways (though not as much as electron).<p>I might try out relm + rust, to see what the state of the art is: <a href="http://relm.ml/relm-intro" rel="nofollow">http://relm.ml/relm-intro</a><p>I've used <a href="https://www.mono-project.com/docs/gui/gtksharp/" rel="nofollow">https://www.mono-project.com/docs/gui/gtksharp/</a> in the past, and it was easy. Looks like there is a notification area example: <a href="http://www.mono-project.com/docs/gui/gtksharp/widgets/notification-icon/" rel="nofollow">http://www.mono-project.com/docs/gui/gtksharp/widgets/notifi...</a><p>Looks like it's possible in go: <a href="https://github.com/mattn/go-gtk" rel="nofollow">https://github.com/mattn/go-gtk</a><p>And python: <a href="https://python-gtk-3-tutorial.readthedocs.io/en/latest/" rel="nofollow">https://python-gtk-3-tutorial.readthedocs.io/en/latest/</a><p>It doesn't look very supported, but even node has GTK bindings: <a href="https://github.com/WebReflection/node-gtk" rel="nofollow">https://github.com/WebReflection/node-gtk</a><p>Honestly, thanks for bringing this up. Looking at these is interesting an nostalgic. It seems like everyone nowadays just does webapps, and its interesting to see "the state of the desktop in 2018".
People are down on Electron. But to me, it looks more like the future than GTK or QT for many things. In the end, Electron's tradeoff of resource use for ease of development is likely to win because computer capability will always trend above the line needed to run current web browser technology and Ubuntu ships with a browser. OK, Electron is not native. Neither is Java and every argument against Electron was made against Java twenty years ago and performance of Java apps on ordinary computers was often much much worse than Electron on its worst day.[1]<p>The story of computer programming is the story of programmers avoiding the need to write native code. Assemblers, compilers, Cobol, C, C++, Java, Go all exist because hardware is the worst abstraction most of the time. Particularly because it is sticky. Twenty-five years after first programming on TRS-80's and Apple II's, I freaked out about allocating a 10,000 element integer array on a machine with 4GB of RAM and dual quad-core Xeons.<p>That's not to say that writing code at a low level might not be a good learning exercise. But it's not a reason to claim moral/ethical superiority. Engineering is about making meaningful tradeoffs based on project criteria. Resource allocation ought to be evaluated based on the importance of the problem the software solves...and consuming "too much" resources is often a reflection of the problem's importance. and problem importance can be a useful way of evaluating software quality.<p>Don't fight the last war.<p>Good luck.<p>[1]: And there was Java in the browser!
I'm writing a systray application in golang currently. Binaries turn around 3mb.
There's an external library for cross platform tray support somewhere on github, I can't remember exactly what it's called though<p>Edit: it was the first result on Google; <a href="https://github.com/getlantern/systray" rel="nofollow">https://github.com/getlantern/systray</a>
Take a look at Lazarus. It runs natively and outputs native binaries from x86 PCs to ARM *PI like boards.<p><a href="https://www.lazarus-ide.org/" rel="nofollow">https://www.lazarus-ide.org/</a>
<a href="http://wiki.freepascal.org/Lazarus_Application_Gallery" rel="nofollow">http://wiki.freepascal.org/Lazarus_Application_Gallery</a>
They will both probably be about the same, tbh. People seem to like Qt a bit more, but high-quality bindings really only exist for c++ or python. GTK, on the other hand, has bindings for most langauges. You could also use tcl with tk, java (or clojure or kotlin or scala or...) with javafx or swing, d with dlangui...<p>Ultimately, what's important is to start making something. Any language, any toolkit, doesn't <i>really</i> matter all that much. If you don't like it, try another language, another toolkit.
If I had to do it, I would use a language that I am comfortable with and the most used GUI library/framework in that language. I know Java well, so I'd either chose Java/Swing or Java/GTK[1].<p>[1] Java binding is officially supported: <a href="https://www.gtk.org/language-bindings.php" rel="nofollow">https://www.gtk.org/language-bindings.php</a>
Gnome has won the war, it's the default for the major distro's so Gtk.<p>If it's a quick thing then maybe just make it a shell extension.
I'm working on an app now and I using QT. I have used QT off and on over the years from 3.x days even. I still use QT because I feel if I wanted my app to run on other platforms like macOS or Windows I might have an easier time at least with the GUI piece.<p>You can use GTK on other platforms too, I just never have.
I tried writing a GUI app in wxpython and it was pretty straightforward, however you need to figure out how to split up work task from the main rendering process if you go that way!