Live data from Hacker News

How Does One Create A Gtk+ Application?

blogs.gnome.org

81–90 of 103 posts

Re: How Does One Create A Gtk+ Application?

#81

Earlier quoted context omitted.

Speaking from a Windows user perspective, Qt interfaces feel near-native, much unlike Gtk interfaces, where many of the little details don't quite match native behavior. But there is this massively annoying little bug where submenus close immediately when you hover another top menu item before reaching the submenu. This makes quickly navigating menus quite cumbersome. (Doesn't happen with native Windows interfaces.)…

Am I correct thinking you are talking about this bug? https://bugreports.qt-project.org/browse/QTBUG-20094 If so, then yes they are aware of it and treating it as critical. Edit: Reading into this bug is so cool. This video was linked from it, fascinating stuff: https://www.youtube.com/watch?v=90NsjKvz9Ns&t=18m46s

Exactly, yes! Thank you! This really is fascinating. So the problem is fundamentally solved since 1986. Let's hope Qt will follow soon! :)

Re: How Does One Create A Gtk+ Application?

#82
post #67

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

> ABI compatibility should not be a huge problem for distributions. That's just fine, until you want to release a binary application that targets more than one distribution...

If you really want to do that you should statically link it.

Re: How Does One Create A Gtk+ Application?

#83
post #60

There is a lot of truth in this but it does take a very lazy attitude to testing. The simple truth is that if you need your application to support certain distributions, you need to be there on the development releases testing them and either submitting bug reports or improving your application. And you can automate much of this with a pile of bootable ISOs and a scriptable virtual machine. Testing isn't new.

Testing is not enough. I release an application "today" (and "today" for example is when Gtk 3.4 is released), and six months down the line the Gtk team decides to release Gtk 3.6 which breaks just about every application that has a GtkTable. As an application developer, I believe I have a right to be pissed. How do I file a grievance? I go to the GNOME bug tracker to find my bug. CLOSED: WONTFIX - we don't care, our…

I think you're conflating "what's released and out there" with "what's being used or distributed".

I'm saying you can test on the versions distributions are actually shipping (and the ones they're about to be using). In a lot of distributions you can rely on that staying stable for a period of time.

If your application depends on an older GTK library the solution is simple: depend on that version or ship it with your application. This is pretty unusual in the Linux world but old hat for Windows developers where you can only really depend on Win32; and for anything else your installer makes sure it's present.

And finally, for the third time, I'll state that I'm not saying there aren't legitimate issues with how GTK+ is developed. There clearly are... I'm just saying that some of the things Morten wrote show issues in their own development process as much as anything else.

Re: How Does One Create A Gtk+ Application?

#84
post #75

Earlier quoted context omitted.

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

What distro/OS are you using now, might I ask?

Re: How Does One Create A Gtk+ Application?

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

Which distribution supports it in general? Sure, there are particular instances of it being supported, but it's not supported in general.

Re: How Does One Create A Gtk+ Application?

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

Yes, npm uses more space than what is necessary, but luckily disk space is cheap. That said, npm does optimize the disk space usage a bit. If I have package A which depends on packages B and C, both of which need D, then (if the versions match), D will be installed only once.

Re: How Does One Create A Gtk+ Application?

#87
post #67

Earlier quoted context omitted.

> ABI compatibility should not be a huge problem for distributions. That's just fine, until you want to release a binary application that targets more than one distribution...

If you really want to do that you should statically link it.

A wonderful idea. Let me just statically link an LGPL library into my Commercial application...

Re: How Does One Create A Gtk+ Application?

#88
post #55

There is a lot about GTK I like; it's a C library making compatibility easier[1], it always seemed way faster (less memory bloat?) than QT, and while the widget-packing/nesting style was somewhat ugly, I found it surprisingly easy to write. I was even enjoying Vala. While it was obviously a young language, it had a lot of interesting ideas. Then we got the new 3.x version of GTK with its "lets rewrite everything for…

> The last straw was when they decided to join Pottering's "lets forget Unix and make Linux into Windows" crusade.

Could you give a little more background about this? (True curiosity, I don't doubt that what you say is true!)

Re: How Does One Create A Gtk+ Application?

#89

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.

That's not what people mean when they say "cross platform".

"Cross platform" means supporting all of the widely-used platforms at a given point in time, and supporting them well. Today, that includes at least Windows, OS X, and Linux. Some would even extend that to include the BSDs, Solaris, AIX and HP-UX.

Like others have pointed out, GTK+'s support for OS X and Windows has been very, very lacking. It's nowhere near as seamless as that offered by Qt, Swing, or SWT.

Re: How Does One Create A Gtk+ Application?

#90
I'm actually teaching myself Xt Intrinsics and Xaw, because "lateral thinking with withered technology". It's crazy, I know it's crazy, but when I read about what a moving target the new hotness is, I wonder if there isn't some kernel of wisdom in looking to the battle-tested technology of the past for inspiration.
Post reply on HN