Live data from Hacker News

How Does One Create A Gtk+ Application?

blogs.gnome.org

71–80 of 103 posts

Re: How Does One Create A Gtk+ Application?

#71

Earlier quoted context omitted.

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.

GTK runs on Linux with X11, Wayland, and probably even some BSDs. Technically that qualifies as cross-platform.

And Mac with X11 emulator/vm/what ever XQuartz is. And Windows if you use the 2 year old version that has a ton of issues (UI bugs, glitches, old GTK bugs, etc).

Running on multiple Linux DE's/OS's is not cross platform as far as I am concerned, even though technically it is lol.

Re: How Does One Create A Gtk+ Application?

#72

Earlier quoted context omitted.

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.

No it doesn't...

http://www.gtk.org/language-bindings.php - 3.10 - 12 http://en.wikipedia.org/wiki/List_of_language_bindings_for_Q... - 7

And of that 7, 3 are the only "language integrations". The rest are parts (Go-QML)/part of Qt (QtQuick, C++).

So 12 to 3 for GTK. And the GTK language binding is not complete, for example Rust has a GTK binding (though not done).

Re: How Does One Create A Gtk+ Application?

#73
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…

Well (I think) part of the whole point of a package manager is to reduce space by sharing dependencies. Npm seems to actually store a copy of the dependency individually for each package that requires it . I really think that is inefficient and a step backwards.

A good package manager should allow to: -share dependencies -provide a way to install multiple versions of the same package

These requirements are not mutually exclusive. With a proper file system hierarchy both of them could be accomplished.

Most of the popular distribution's package managers (apt, pacman, etc) support the sharing dependencies but almost none of them support installing multiple versions of the package.

Given that storage space is very cheap nowadays I think a package manager like NPM which stores copies of the dependencies is not that bad actually.

Re: How Does One Create A Gtk+ Application?

#74
post #14

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 feel really conflicted about Qt. On one hand, as a graphical toolkit/environment, it's great. It's well-structured and easy to use, and QML is basically everything web applications should have been. On the other hand, as a C++ library it really couldn't be worse, with its flagrant reinvention of the standard library, pervasive UTF16, complex object hierarchies, raw pointers, extensive use of macros, etc., etc. Mayb…

> flagrant reinvention of the standard library

That's b/c the C++ standard library (or its implementation among various compilers) was terrible 13 years ago when Qt 3 was released. Some say it still is.

Re: How Does One Create A Gtk+ Application?

#75
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…

I remember when Gtk 2.0 came out. IIRC, at the time, Qt seemed to be bloated and slow compared to Gtk, but Gtk had a lot of breaking changes and was more work to program with. I was unimpressed with having to constantly figure out how to update my Gentoo system when Gtk kept moving functions from one library to another, which required hacking in symlinks to point to new libraries that programs required. It was a real…

Er, what? I ran Gentoo from 2001 until mid-2013, and I was a maintainer and core developer of parts of Xfce (a Gtk-based desktop environment) from early 2004 until late 2009, and I have no idea what you're talking about.

Gtk was a pain to develop with, sure, but only due to the awkwardness of GObject's attempts to build an OO system on top of C.

From a user perspective, I never saw the problems you're describing. Even having built Xfce out-of-tree all the time, I never recall having to do a full rebuild due to a Gtk update.

I've since moved on; it's a shame to hear what the OP is saying about 3.x, but 2.x most certainly didn't have these problems that you describe.

Re: How Does One Create A Gtk+ Application?

#76
It would be nice, if the author would back his claims by specific references. Comparing the upstream tracker reports for GTK+ and Qt shed a different light on ABI compatibility between versions:

http://www.upstream-tracker.org/versions/gtk+.html http://www.upstream-tracker.org/versions/qt.html

(Yes, yes, Qt does more than just GUI, I know …)

Re: How Does One Create A Gtk+ Application?

#77
>How does one shield oneself from this, i.e., how does one ensure that the binary compiled (say) three years (or months) ago continues to work reasonably?

Static linking should save you from from this hell. I don't know if gtk even supports it, I know glibc does not, whitch is a shame.

Re: How Does One Create A Gtk+ Application?

#78
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…

> It's unfortunate that Linux and/or Linux distributions have not yet solved the problem of supporting parallel versions of dependencies.

They do and they have, but they can't conjure-up libraries that haven't been properly versioned and released upstream.

If the GTK+ team can't maintain an ABI then they need to start releasing versions under different sonames such that programs like wireshark link against "libgtk-3.so.0.1200.2" and not "libgtk-3.so.0", then the package managers will be able to do the right thing.

Re: How Does One Create A Gtk+ Application?

#79
post #28

Earlier quoted context omitted.

> 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.

I don't recommend developing a package manager until you have done a lot of research. Its a field with non trivial problems and a lot of existing experience, and a lot of implementations that may well solve your issues.

Re: How Does One Create A Gtk+ Application?

#80
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…

"It's unfortunate that Linux and/or Linux distributions have not yet solved the problem of supporting parallel versions of dependencies."

Uh, they have. For ever.

I have parts of boost 1.49, 1.53, 1.54 and 1.55 together on my system. I have GTK2 and GTK3 together on my system. I have Qt3, Qt4 and Qt5 together on my system. Python2 and Python3. libpoppler19, libpoppler44 and libpoppler46.

Post reply on HN