Live data from Hacker News

How Does One Create A Gtk+ Application?

blogs.gnome.org

41–50 of 103 posts

Re: How Does One Create A Gtk+ Application?

#41

If you need GTK for something, really, don't bother. It's a bag of hurt. Qt, WxWidgets, or even something else. I'm so glad the Web and Modern Browsers reinvented "desktop applications".

I actually like writing GTK way more then Qt. I like the fact it is C and easily integrates with any language I wish to use. Though I use Qt, the Mac support on GTK is terrible at best. Windows support is even worse (or non-existent) which makes me question their "cross platform gui" title. If I was to suggest a method, I would suggest using each platforms GUI language and make a backend in something cross platform.

> and easily integrates with any language I wish to use.

Qt has just about as many bindings as GTK does.

Re: How Does One Create A Gtk+ Application?

#42
post #18

Earlier quoted context omitted.

How would people feel about a cleanup-focused API-compatible fork of Qt, in the style of LibReSSL?

It would be stupid and pointless? The Qt Project is an incredibly open environment. You want cleanups, go and file some PRs. WTF is it with people's first instinct being "let's fork instead of contributing fixes"?

Not everybody likes Qt's CLA.

Re: How Does One Create A Gtk+ Application?

#43

This post was written by Morten Welinder, the author of Gnumeric and a popular GNOME blogger. I feel really bad for GTK developers. The GNOME guys have clearly taken the toolkit from a "general purpose" direction to a much more gnome-centric one. At the same time though, I can't help but be hopeful for the future. Qt is a wonderful project, with a bunch of wonderful licenses, developed in a wonderfully-open environme…

I've always preferred Gtkmm over Qt. That might be because Gtk+ (and Gtkmm) doesn't try to be an "everything, including the kitchen sink" library (and, in related news, I've never been a fan of the Gnome API -- even though I was a fan of the Gnome desktop until Gnome 3). However, it's always seemed a little perverse to me to have Gtk+ try to imitate '90s-style C++ in C, and then to use a C++ wrapper around that.

The signals system of Gtkmm seems pretty neat.

Re: How Does One Create A Gtk+ Application?

#44

Earlier quoted context omitted.

It would be stupid and pointless? The Qt Project is an incredibly open environment. You want cleanups, go and file some PRs. WTF is it with people's first instinct being "let's fork instead of contributing fixes"?

Not everybody likes Qt's CLA.

And by "Not everybody" you of course mean "People who don't know any better", right? The Qt legal situation has changed a lot lately, especially since Nokia went out of the picture. Look it up:

https://qt-project.org/legal.html

Re: How Does One Create A Gtk+ Application?

#45

    Parts of the gui that used to render correctly now stops updating at all.
I suffer this problem with an image viewer (geeqie) on debian. I have to restore/maximize the window to force a redraw and it has been like that for months.

Re: How Does One Create A Gtk+ Application?

#46
post #28
post #17

It's unfortunate that Linux and/or Linux distributions have not yet solved the problem of supporting parallel versions of dependencies. Even Node's package manager supports that. The end result is that rolling release distros break stuff often, as applications can't be tested and executed in isolation of each other. The "solution" to this is releasing everything every 6 months, when you can actually test everything t…

> Even Node's package manager supports [parallel versions of dependencies] I feel like your emphasis is backwards. It's not surprising that NodeJS, a new project, has solved some of these problems. NPM has the luxury of decades of experience from dozens of linux package managers and package managers from other languages. Plus, they're not tied to the legacy use cases the same way that (e.g.) apt is.

Do you have a link that would educate me about some of these problems? Package management interests me because I might find myself developing a package manager in the near future, but I don't know much about it.

Not supporting multiple versions of the same software is something that I identified as a problem though.

Re: How Does One Create A Gtk+ Application?

#47
post #18

Earlier quoted context omitted.

How would people feel about a cleanup-focused API-compatible fork of Qt, in the style of LibReSSL?

It would be stupid and pointless? The Qt Project is an incredibly open environment. You want cleanups, go and file some PRs. WTF is it with people's first instinct being "let's fork instead of contributing fixes"?

Sorry, "fork" was the wrong term. How about "long-term working branch that might get merged eventually, but also might get used in preference to the original to the point that people start just submitting their PRs directly to it"? (Think egcs's "fork" of gcc.)

Re: How Does One Create A Gtk+ Application?

#48

ABI compatibility should not be a huge problem for distributions. They can just recompile all the packages linking against GTK+ when they update it. The crazy stuff is having your window decorations disappear when running a GTK application under openbox because somebody thought it would be funny to screw with gtk+-3.12 [1]. [1]: http://redmine.audacious-media-player.org/boards/1/topics/11...

Exactly. I feel like this post was blaming Gtk+ when it seems like the real problem was the distro not realizing that their package dependencies didn't trigger a rebuild.

If something breaks ABI compatibility, that doesn't mean it is API incompatible. It just means all you need to do is recompile dependents and everyone's happy. It sounds like almost all of the problems in this post were caused by a failure to rebuild dependents. That's a general problem that can affect any library, not just Gtk+.

Re: How Does One Create A Gtk+ Application?

#49

I just watched this [1] video from Dirk Hohndel describing the migration motives and process from Gtk+ to Qt for subsurface (started by Linus). TLDR: * Qt has a community of people developing applications, has good documentation (precise, good coverage) and people who care * Gtk+ has a bunch of Gnome developers, if you want to develop an application, you're out of luck [1]: https://www.youtube.com/watch?v=ON0A1dsQOV0

I just finished watching this, it was pretty interesting. Thanks.

Re: How Does One Create A Gtk+ Application?

#50
post #12

This state of Gtk sad, but I'm really glad we (VLC) moved to Qt, a few years ago (2006), before many applications did the switch, and when it was an unpopular move. Before that time, we were using WxWidgets and had many issues, notably with Unicode and Windows support. WxWidget APIs and behaviors were changing too much between releases (even minor ones). When we moved, we were in the early Qt 4.1/4.2 days, and most V…

Around that time I worked for Trolltech and got a good view of how that project was run. The trolls took compatibility very seriously. From devs that were running KDE 3 using the current nightly build of Qt 3 to swapping out the Qt library of various Qt applications with the next Qt release to find any regressions ourselves, keeping things working was important. Dogfooding with KDE, internal tools etc was expected by developers. It is not to say we didn't make mistakes, but we did try to prevent as much as we could. A good API really goes hand in hand with compatibility. Because almost any API change in C++ is incompatible and because any public API we would be stuck with for years there was a huge incentive to get it right. When designing any new API there was always multiple rounds of API design sessions often with many different developers providing feedback and always feedback from the documentation team. Is this API extensible? Does it use the same terminology as the rest of Qt? Could any of the function names be named better? Is there any api missing or that could be removed, etc. New classes had examples and demos not just for documentation purposes, but often enough written first to help find the best API (before actually implementing it) and second to be used to regression test compatibility. Before a release all new API was reviewed one last time to catch any errors that might have slipped through. Many of the lessons learned can be found in "The Little Manual of API design" that was written by one of the Tolls Jasmin Blanchette http://www4.in.tum.de/~blanchet/api-design.pdf It is because of all of this effort that when you are using classes in Qt you often can intuitively know what how the api would work. Again we did make mistakes, but we tried to learn from them and we were not shy about holding back on an API that wasn't ready for a release rather than commit to an API that we were not sure about. I recall more than one API being delayed for the better 6 months or so before being included in the next release (4.3 v.s. 4.2 for example). The result was always a better API and a more bug free class, a win all around.
Post reply on HN