160 points · by pjmlp · 6y ago · 80 comments
So - more Glade files as examples would be really helpful! Apperantly, most GNOME apps don't use it,not I just can't find the Glade source files for them.
But I guess the fact that the tutorial link brings you to a tutorial which doesn't work with the Glade version in the screenshot already gives away that glad might not be first priority.
It's still pretty good tough.
https://wiki.gnome.org/Projects/GTK/Inspector
What you'll find is that several GNOME apps use separate widget libraries like libdazzle and libhandy to get their look-and-feel. These aren't necessary, but they may save you some work to make your program feel a little bit more GNOME-like.
I'll miss the old gtk.org... spent countless hours on that site... the gnome c interfaces will always be near to my heart... Love the new design though that looks great.
It still baffles me that System Monitor uses real-time charting that is made entirely out of DrawingArea's and there aren't any good charting components in GTK period.
Just grab the source for the settings app to see how it's done.
I don't think the core gnome/gtk folks have historically made use of glade, though maybe that's changing.
GTK talks of native look-and-feel, but it's very poor at Windows look or feel. I have evaluated GTK for building apps that would be primarily used on Windows, and I gave up in short order after trying quite a few themes (ones trying to be like Windows 7, 10/Win32, 10/UWP, &c.). They were uniformly woefully bad for both look and feel, on my high-DPI environment. I got the impression some of them would have been better on a low-DPI device, but every last one of them would still have been bad in various serious ways. It always started with the title bar looking and behaving completely incorrectly, so GTK apps on Windows that want to look not awful start by telling GTK to let the OS draw the title bar. Then you get your file picker modals; and things like Inkscape drop GTK on the floor there, and call the Win32 API instead, on Windows.
And all this is fairly typical if you want it to feel native.
[1] https://www.bleepingcomputer.com/news/security/kali-linux-ad...
[2] https://www.kali.org/wp-content/uploads/2019/11/kali-underco...
I think it's pretty strange that the code example widget defaults to showing JavaScript code, considering that C is GTK's native language.
I don't really think that C being the native language has any significance in this case.
* this disclaimer because yes I know that gtk was a originally a quick hack to avoid Motif.. that definitely changed by 2.0.
https://developer.gnome.org/gnome-devel-demos/stable/js.html...
It's simply something that works everywhere and can easily have performant and ergonomic bindings for $your-favorite-language.
What's going on with that app icon carousel, though? On mouse-over it shows the link cursor, but nothing happens when you click the icons.
The feature list could also use some editing. I'm not sure what "enticing features" and "superb performance" have to do with "stability", and there is some random capitalization here and there.
;)
What it has going for it is that Qt, perhaps the second most popular cross-platform GUI toolkit, developed on top of C++98 and had a lot of functionality to fill in for libraries missing for the language - which by now are outdated and have standard or more-popular alternatives.
(Actually, Glib is also somewhat like that in some respects.)
Caveat: I'm the opposite of an authority on writing UI code.
And that works even better now with GObject Introspection, which provides a generic way to access any GObject-based library from any language (kind of like COM's typelibs or WinRT's projections): https://gi.readthedocs.io/en/latest/
My choices are more on what is better for the user and not on what is cool for the developer. Also if you have a small tool that the user will use it a few minutes he will not complain about it's look the functionality is important. As an example the games Sims 3 runs on Windows and Mac(not the latest Catalina) and community made tools for cleaning save files. Most popular tool was .Net and Windows only but someone made a Java tool that was cross-platform, the users were happy/great full and not entitled to demand profesional looking GUI for such a tool.
My advice , if you need a simple UI, buttons, labels, inputs then you should use the thing that has the best support for the language and platform you target. If you need to embed a uptodate webview or a video player or you need to draw graphs, customize widgets then you need a different tool.
If you can provide what you need in details, what platforms, languages and features you need then people could help eliminate the bad choices.
The reality is that if your app is substantive in its GUI requirements, then neither Qt nor GTK will entirely shield you from platform specifics, and both of them will fall down in some situations (a little different for each toolkit).
Historical note: I decided to use GTK and not Qt because in the 1990s, Qt, despite being written in C++, was incredibly non-C++-idiomatic. It had its own string class, and required a Qt-provided pre-processor to be run on your code to get their signals/slots mechanism to work (think "anonymous callbacks"). GTK, by contrast, had a C++ binding that fully embraced the power of the C++ of the time. At this point, this difference between them has largely gone away. Qt has far more in its toolset to help people design and build apps, but when you get down to what they can actually do at runtime, there's not a lot of difference.
My one outstanding gripe about GTK is that the initial "G" used to stand for GIMP (it was written to support the development of that application), but now stands for GNOME. This doesn't ruin GTK as a general application toolkit, but some of the design decisions (at several different levels) do reflect its status as the "GNOME Toolkit" rather than a totally platform-agnostic GUI toolkit.
Yeah, but there were good reasons for Qt to do that, I think that is just a taste thing, when you want to make an application that works the fact that Qt has a sane string,vector, signals is a plus(you did not need boost or third party code) , coming from Java or .Net Qt feels right.
For GUIs I did not hit cross platform related issues. I think I had to re-arrange some menus depending on OS but not to use native code. The only time I had to use some native stuff and I had to include windows.h was because I needed to on a multi screen setup to get each screen dimensions and at that moment this was not implemented or bugged(I do not remember).
About GTK, I strongly dislike the fact they are using their own File Chooser dialog and not the native one and that you can't customize the sorting order in it, especially on GTK2. So I have a few GTK2 apps and I always find it hartd to find my files because n how them are sorted , though in GTK3 I found a config options to change it a bit.
I would still use GTK if the problem to solve would require Python and a simple GUI like ask the user for a name, to chose a file, input some text. show an image and it is a Linux tool only.
About GNOME I agree, it could be possible in future GTK won't officially support menus, tray icons and other things that GNOME does not want.
This video https://www.youtube.com/watch?v=ON0A1dsQOV0 is about the reasons Subsurface (a diving app started by Linus Torvalds) changed from GTK to Qt. Things might have improved from GTK I can't tell and also for simpler GUIs GTK might be enough.
Make desktop-like apps great again! Webatizing everything proved a mistake, unless you have deep dev pockets. Time to re-group.
Side note, GTK seems to lack a direct editable "data grid" widget with expandable columns. On a typical data grid, you can drag a column border to expand or reduce column width. It's a common need for data-centric CRUD apps. There are work-arounds, but they are awkward.
Up front and center code examples are nice, and IMO works well.
The Rust-example would have been a running application on my machine, had I not already been in bed and reading it on my phone.
Good job!
I hope wxRust will catchup some day.
These are trending presentation libraries in iOS. Most of these have 500+ stars on github, and few have more than 2 K stars.
Feel free to contact me via sudeep at agicent dot com.
How do I actually run the code examples that you've provided?
For example, I started a new Cargo project and pasted the Rust example provided into my main.rs. It failed compilation. Should I have added a few dependencies to my Cargo.toml first? Should I have upgraded Rust first?
I upgraded Rust, btw. And added lines to my Cargo.toml. No bueno. Now, I have to go hunting elsewhere for answers.
A few extra lines of instruction would definitely save the thousands of developers who're bound to get stuck.
It is expected that one would know how to properly add dependencies — and if they did not, they should go read the documentation (from the 'Docs' link at the top of the page).
I hate to be dismissive, but did you rtfm?
Shouldn't there be some continuity between the examples provided on the webpage and tfm?
There doesn't need to be any further instructions on the landing page, though. Again, that's what the docs are for.