Why Use GTK+? 356
An anonymous reader writes "IBM DeveloperWorks is running an interesting student article that introduces users to the world of GTK+. It explains what GTK+ is, why you should consider using it, and the benefits it provides. Together with the rest of the series, this installment provides enough introductory information that, if you decide to use GTK+ in your own projects, you'll know where to look for further materials."
Just curious (Score:2, Funny)
Re:Just curious (Score:2, Funny)
Yes.
Re:Just curious (Score:5, Informative)
Re:Just curious (Score:2)
I can't even summon the energy to be abusive about this post.
Nokia (Score:5, Informative)
Re:Nokia (Score:4, Informative)
Re:Nokia (Score:3, Informative)
What is GTA? (Score:3, Informative)
GTK+ is a graphical user interface (GUI) tool kit.
Holy 5417! (Score:5, Funny)
And all this time I thought everyone was talking about a game called "Grand Theft Potassium Ion".
Interestingly... (Score:5, Informative)
Re:Interestingly... (Score:3, Informative)
Also, you are allowed to use GTK+ for proprietary projects (LGPL). The free QT is GPL.
Re:Interestingly... (Score:3, Informative)
Re:Interestingly... (Score:3, Informative)
Yes, QT for windows is GPL, but you must buy commercial licenses because it is GPL and not LGPL.
If you make an application using a GPL library your application is a derrived work, which means it is also GPL.
If you use a LGPL library, your application does not have to be open source, but it must mention somewhere it uses the library.
Re:Interestingly... (Score:2)
It's also free software, though this was a new thing for version 4.
Also, you are allowed to use GTK+ for proprietary projects (LGPL). The free QT is GPL.
And when comparing OOo to gnome office gnome people cite being GPL rather than LGPL as an advantage.
Re:Interestingly... (Score:2)
Because OOo is not a library.
Re:Interestingly... (Score:5, Informative)
The same thing applies to MySQL but people seem to mistake the GPL for the LGPL.
Re:Interestingly... (Score:2)
CEO: Open Source is bad, we can't sell product X, we must give it away freely!
OpenSource Advocate: Why not? Dual-license it, GPL for free stuff, $$$ for commercial usage.
A: Why not use X?
B: Its bad, because it is dual-licensed!
You see a problem here? Telling people that you can sell your stuff AND releasing it as OS and at the same time yelling against it because its only GPL for non-commercial stuff?
Re:Interestingly... (Score:5, Insightful)
I like to call the GPL the viral open source license. Everything it touches is also made open by default.
You would be surprised by the number of developers that I know that developed their apps using MySQL and then had to pay for the comercial license many months later because they didn't read the fine print. Lets just say that if they had known beforehand they would have charged a little more for their applications
I am not against the GPL. I am just amused by the large number of people that advocate it fanatically and yet don't understand it.
Cheers,
Adolfo
Re:Interestingly... (Score:4, Informative)
If you want to use it from something like Perl/PHP whatever, you will find the license cost is zero. If you want to incorporate it as part of an in-house system, there is no issue. It is only if you want to build non-GPL software for distribution. OTOH, you will find that many commercial users have no issues with paying for support. Although not as full featured as Oracle 10g, it costs a tad less.
Re:Interestingly... (Score:2)
The virality of the GPL does not cross the barrier of a database connection. Troll?
Re:Interestingly... (Score:5, Insightful)
The fact that you're ignorant of this crucual detail (which is the foundation of mysql ab's ability to make money) reinforces the GP's point.
Re:Interestingly... (Score:5, Informative)
MySQL even claim that if you implement your own client, it speaks the MySQL protocol, and as such is a derivative work of the MySQL server and so must be made available under the GPL [mysql.com].
Re:Interestingly... (Score:5, Insightful)
Re:Interestingly... (Score:3, Interesting)
Re:Interestingly... (Score:3)
You replied:
We agree on this matter. The GPL is a great open source license. We also agree on human stupidity.
My point is that there is an ever increasing number of people who preach open source like they preach religion. Each person gives his/her own interpretation. Most people that I have worked with cannot
Re:Interestingly... (Score:3, Informative)
Not really. The viralness of the GPL is well founded - what you may be thinking of is how the FSF interperts "derived work", which is a legal grey area at the best of times. In the important cases, like when you statically link GPL code, it's pretty cut & dried. Dynamic linking is more complicated and as far as I know there's never been a c
Re:Interestingly... (Score:3, Interesting)
However, if I understand the MySQL/FSF position correctly, I can't do the same thing with MySQL drivers because my application is considered to be a "derived work" of MySQL. Neither Oracle or MS claim any rights over my s
Re:Interestingly... (Score:3, Informative)
you cannot do this. it is either GPL or not, if it is GPL you cannot have "non-commercial" attached to it.
i can develop stuff with a dual-licensed library (GPL and proprietary; say with Qt) and and sell my stuff while distributing the library or its derivative works relying on GPL. however, then i have to release my own work as GPL as well; and my first customer can undersell me, because i cannot restrict further copying. only if i want to restrict further copying
Re:Interestingly... (Score:2, Insightful)
I just hate the GNU zealots. Qt just can't win can they. The entire GNU project is founded on the idea that proprietary software is bad (Stallman even wrote an essay [gnu.org] on why you shouldn't use the LGPL, and renamed the first L from "Library" to "Lesser" to discourage use). But when Qt is using GPL, suddenly the GNU zealots turn around and say, hey that's bad, you can't write proprietary software with it! In fact Qt has the perfect
Re:Interestingly... (Score:5, Informative)
From the article: The author makes it very clear to the reader that other GUI toolkits exist. Since he likes GTK+ he writes an article advocating it. It is not meant as a comparison between different toolkits. It is meant as an introduction to one of them.
Also, considering the wealth of GUI toolkits avaliable [wikipedia.org], his article would loose focus quickly if he meant to mention all of them.
Re:Interestingly... (Score:2)
I hate people who make sweeping generalizations (zing). I'm a GNU zealot and I think Trolltech rocks for using the GPL for QT. I have no patience for proprietary software and I look forward to a time when software like QT is the norm rather than the exception.
Also I think that the majority of GNU zealots would feel the same way about QT
Re:Interestingly... (Score:3, Insightful)
No, the GNU project is founded on the idea that it is beneficial for people to share contributions to software freely. Troll Tech has adopted the GPL, but it's not being run like an open source project.
But when Qt is using GPL, suddenly the GNU zealots turn around and say,
AFAIK, GNU zealots generally have nothing against Qt.
In fact Qt has the perfect business model
So does th
Re:Interestingly... (Score:2)
GTK+ is no more cheaper than Qt, unless you are talking about closed source projects. Gtker's seem to like to advocate pro
Re:Interestingly... (Score:2)
The grandparent had a list of attributes from the article which he said could apply equally to QT or GTK. The parent then pointed out that one of the listed attributes:
Applys only to GTK - not to QT.
The parent was correct. From the article:
Comment removed (Score:4, Insightful)
Distribution on Windows (Score:2, Interesting)
Re:Distribution on Windows (Score:5, Insightful)
Re:Distribution on Windows (Score:5, Insightful)
Re:Distribution on Windows (Score:3, Interesting)
MS still can't do large fonts and resizeable dialogs.
Re:Distribution on Windows (Score:5, Informative)
And MFC.DLL is the equivalent of maybe half of glib and the stubs for the rest of the libs. Count all your non-Office OCX files; those are delivering the rest of the equivalent capability
Re:Distribution on Windows (Score:3, Interesting)
Re:Distribution on Windows (Score:2)
Re:Distribution on Windows (Score:5, Insightful)
The Advantage of course is that for that 6-8meg, it installs with virtually no hassles, and all the way back to w95.
I've dealt with numerous ditribution issues, and while sysadmins are worried about the package size, mostly they are worried about hassle. Try shoe horning
The GTK pack isn't HUGE and it installs with virtually no problems. If download size is a problem the NSIS2 installer does support on the fly package downloads.
Re:Distribution on Windows (Score:2)
Anyway, now it's a pret
Forget something? (Score:5, Insightful)
I think you meant to say it IS a big deal, since it translates to 30 MINUTES of extra download time on a dial-up line, which unfortunately most users are still stuck with. Even broadband lines aren't all 1.5Mb/s.
Re:Distribution on Windows (Score:2)
$ aptitude show libgtk2.0-0
Uncompressed Size: 4608k
Re:Distribution on Windows (Score:2)
Even GNUstep doesn't require that much - the dependency pack for the game, oolite, includes a minimalist GNUstep to support the Objective C runtime and the Foundation, as well as all the required SDL libraries. The resulting autopackage installer for Oolite on Linux is the same size as the
No, 3.5 MB (Score:3, Informative)
Re:Distribution on Windows (Score:5, Informative)
if it depends on 6-8 MB for GTK
Our cross-platform "hello world" program including Gtk [merjis.com] is about 300K compressed in total on Windows.
Rich.
Re:Distribution on Windows (Score:2, Informative)
Biased by my own project wyoGuide (see http://developers.slashdot.org/comments.pl?sid=172 263&cid=14343909 [slashdot.org]) I can say that wxWidgets is probably the best choice for cross-platform development.
O. Wyss
Re:Distribution on Windows (Score:2)
It is just a tool (Score:2, Interesting)
Re:It is just a tool (Score:2)
The Posix subsystem doesn't use the win32 api's, It uses the NT api's which are limited. The win32 subsystem and unix one can't even communicate to each other directly. You can't use the posix api's with the win32 ones since they are running under what seems to be a different operating system them.
Interix is what it used to be called, But now microsoft calls it SFU windows Services For Unix. Which is a misleading name.
Anyways. I can't tell you too many details.
To get thinking about it. In a
Re:It is just a tool (Score:2)
The original Posix subsystem that Microsoft provided was rather limited and therefore not very useful. However a company called Internix create a software package that built upon the Posix subsystem but provided a complete Unix like environment with shell and all the standard tools.
A couple of years ago, Microsoft bought Internix and now provides the software for free to Windows users. Their main purpose of the software is to allow people using applications that run
With the bazillion GUI toolkits out there.. (Score:3, Interesting)
For in house stuff I've been on a command line, or straight GLUT kick if I need to display graphics or data in a quick and dirty fashion. Obviously that's not going to work for everything, but you'd be suprised how far it goes.
Are there any cross platform (linux, mac, windows) GUI RAD tools ala Builder, yet?
Re:With the bazillion GUI toolkits out there.. (Score:5, Informative)
You have QT Designer that is part of the QT Toolkit. [trolltech.com]
Re:With the bazillion GUI toolkits out there.. (Score:2)
Yes - and there has been for years. Java + IntelliJ or NetBeans. Even open source Java has reached the stage where it will run cross-platform GUIs.
Re:Java (Score:2)
Indeed, GTK+ for instance.
Yes - but my point is - why do you even need to know that you are using GTK+? Isn't this as irrelevant as knowing which filesystem type you are saving to? With something like SWT on Java you can use GTK+, Win32, Motif, MacOS/X etc. without knowing or caring which GUI is implementing your widgets. Surely this is the way forward, rather than trying to code for a particular GUI library?
Re:With the bazillion GUI toolkits out there.. (Score:4, Informative)
These guys [monodevelop.com] love to use it but it is more of a political issue than a technological one.
And now, If you'll excuse me, I've got some work to finish on Photoshop vi.
Cross-platform GUI RAD (for GTK+, etc): wxDesigner (Score:5, Informative)
Are there any cross platform (linux, mac, windows) GUI RAD tools ala Builder, yet?
Yes -- wxDesigner is a very nice RAD for use with the wxWidgets GUI-building environment. wxWidgets is a cross-platform GUI framework which uses native widgets. On Linux, it uses GTK+. On Windows, it uses Windows widgets. On Mac, it uses Mac widgets. There are other somewhat-supported platforms. This approach contrasts with that of the Qt framework -- another cross-platform builder (which is excellent), which implements all its own widgets on each platform. Also unlike Qt, wxWidgets is not bound by the GPL -- you're pretty much free to do as you like with it (i.e. incorporating it into commercial apps, without the requirement that you release your source code, or pay any licensing fee). wxDesigner is a very nice GUI RAD builder for wxWidgets. It's not free, but it's cheap. You definitely get your money's worth.
Re:Cross-platform GUI RAD (for GTK+, etc): wxDesig (Score:2, Insightful)
BTW see http://developers.slashdot.org/comments.pl?sid=17
GUI? (Score:5, Funny)
Re:GUI? (Score:5, Funny)
Thousands of developers all over the world are misled with the apparent ease of printf'ing the text to the stdout. They all miss the most important fact: the printf doesn't actually generate the text! You still have to supply it, although the printf marketeers might want you to think otherwise.
Another thing - where are the mathematical foundations for printf? Relational databases rely on solid theory that dates back to 1795. Printf enthusiasts cannot deny the fact that it just lacks proper scientific support. It's a sad thing that giant amounts of investors' money are poured into a technology that relies on a wishy-washy muddy set of 'format specifiers'. Haha, 'format specifiers'! I challenge you to come up with a proper mathematical definition for that!
And a final death blow to the whole 'printf' craze. It has no support whatsoever for colors or blinking text! Young printf-bamboozled programmers all over the world realize they're using a purely academic technology when the real world requirements call for a blinking 'Hello world\n' or a colourful 'Foobar'!
Re:GUI? (Score:2)
"\e[32mReally?\e[0m\n"
or blinking text!
"\e[5mHello world\e[0m\n"
"\e[5mHello world\n\e[0;34;1mF\e[36mo\e[32mo\e[33mb\e[31ma\e[
(spell \e as \033 to make stone-age compilers like AIX cc happy)
Re:not portable (Score:2)
In other words, on every single terminal in existence made within the last >15 years.
This may be an issue if the output goes to something that is not a terminal (like redirected to some GUI), but, in that case you can simply check isatty() or pipe it through ansi2txt or ansi2html (bundled with a package of mine [sf.net], trivial to recreate on your own).
The Question is... (Score:5, Funny)
Tempting.... (Score:3, Interesting)
Re:Tempting.... (Score:5, Informative)
People do rave about the Qt docs I know.
Re:Tempting.... (Score:3, Informative)
It's a very, very good read, even for non-Gaim developers. On the plus side, you'll be supporting open-source development if you purchase it.
Re:Tempting.... (Score:4, Informative)
Though when things get really tough and I absolutely have to know the little details, I like to hit the source http://cvs.gnome.org/viewcvs/gtk%2B/gtk/ [gnome.org] instead.
Re:Tempting.... (Score:2)
Okay, d.g.o [gnome.org] is still a pain to use and still has some old stuff, but the API reference should qualify as "good documentation". GNOME core libraries are basically all documented - except libgnomeprint/libgnomeprintui, which have large gaps - and if you don't find enough documentation, Just. File. A. Bug. [gnome.org].
GTK is alright...but no raves (Score:5, Interesting)
No, I'm not kidding: a dialog box with three buttons should be:
D(H:50,W:200){M:"Quit without saving?",B1:"Save"(do_save()),B2:"Don't Save"(no_op&exit()),B3:"Cancel"(drop_quit())};
Re:GTK is alright...but no raves (Score:2)
Umm... you're supposed to roll that yourself. Write either a wrapper function or a macro for the common stuff you do with your toolkit. That, or move on from C to a more applicative language like lisp or ocaml.
I mean, it's a five-minute thing to write the D wrapper you want; do it and move on with your life.
Actually, standard versions of wrapper 'd be good. (Score:2, Insightful)
Also it would be one less function that has to be written and maintained across the thousands of projects that use GTK.
Re:GTK is alright...but no raves (Score:5, Insightful)
Um, you mean like this C# code?
Many slashdotters like to drone on about how evil business practices got Microsoft where it is today. But one thing that definitely helped is that, for much of GUI history, it's been easier to write GUI code for Windows than for almost any other platform.
Re:GTK is alright...but no raves (Score:4, Insightful)
His code specified the height, width, alternate text for the buttons (which some of us want without having to make a new dialog at times) and methods/functions to perform when the buttons are activated. Currently, a wrapper/class/function is the only way to accomplish all that in one line.
Re:GTK is alright...but no raves (Score:3, Insightful)
I know it differs from what the OP asked for, but how is automatically determining width and height a bad thing? To prove my point, I encourage you to give a specific size for your dialog box and then come back and tell me how it looks when you change your default font to something that a person with vision problems would use. Dynamically computing dialog sizes is A Good Thing(TM).
Re:GTK is alright...but no raves (Score:3, Insightful)
"Uhm, we _need_ to change 'No' button to 'Review' - that should be easy to do, right? 5 seconds worth, right?" - so said the boss.
Re:GTK is alright...but no raves (Score:3, Informative)
Re:GTK is alright...but no raves (Score:3, Informative)
How is that easier than this example from the Qt dcoumentation:
QMessageBox::question(this,tr("Overwrite File?"),tr("A file called %1 already exists.Do you want to overwrite it?").arg(filename),tr("&Yes"),tr("&No"),QString:: null,0,1))
Note that Qt provides translation to your local language and choice of button text and keyboard shortcut as well.
for much of GUI history, it's been easier to write GUI code
Re:GTK is alright...but no raves (Score:4, Informative)
Then again, actually GTK has what you want anyways, despite my earlier response rant:
Re:GTK is alright...but no raves (Score:3, Funny)
I'm pretty sure you can do this with Visual Basic.. happy now?
Re:GTK is alright...but no raves (Score:2)
*Ahem* and let's belay the jabber about the *cough* *cough* "superiority" of so-called "Windows-programming". I tried C++ in Windows, and I was least impressed of all my programming experiences. We're talking GNU/Linux hence the name "GTK" which stands for "GIMP" tool kit, and "GIM
A better title would be "Why use a toolkit"? (Score:2, Interesting)
It doesn't seem to give any information about GTK+ itself, even what the difference between GTK+ and plain GTK is (I am guessing that GTK+ is simply the C++ bindings for GTK).
Basically, I think this introduction is too simplified and high level. I imagine that anyone who ever even considered writ
wxWindow (Score:2, Interesting)
Re:wxWindow (Score:2)
wxWidgets? (Score:4, Informative)
I don't have any numbers, but I think the performance would be better and the distribution size shouldn't suffer much (as with Qt or GTK+).
Article? (Score:2)
Maybe if the following parts say something interesting, it would be worthy of making it to t
Yes but... (Score:5, Informative)
A question for someone who knows more about GUI toolkits: What are the issues involved in matching the appearance between toolkit controls and the native controls?
Re:Yes but... (Score:2)
Fortunatly I only boot into Windows to play the odd game, but when I do, programs that use the gtk-wimp [sourceforge.net] theme don't look out of place at all.
At the end of the day, however, the only way to have a cross-platform application to feel native on any platform is to implement a completly separate, native interface. Use GTK+ for Gnome, Qt for KDE, Cocoa f
Re:Yes but... (Score:3, Informative)
Nope. Firefox is built using a custom toolkit designed explicitly for Mozilla.
Firefox has the ability to import theme data from both Windows XP and GTK+, so it should look (sort of) like a native app under both platforms. It comes real close under Windows, but it still messes some things up. I've never tried it under GNOME since they added GTK+ themeing support, so I have no idea if it works under that.
However, the Mozilla toolkit is actually much closer to properly mimicing the Windows environment t
Other languages (Score:4, Interesting)
I often need to rapidly prototype a graphical UI, and one that's not just a standard set of static attributes. I find that for these cases the graphical layout tools fall down pretty quickly, and I'm back to writing code to make the UI.
Now, if I'm going to be writing code for GUI prototypes, I want code that I can write, test, and show off fast. I don't want to start a language war, but to me that says "not C++."
So a big question for me is "what other languages does your toolkit support easily?" Is there a good perl interface? python? scheme? What can I use to lash it together quickly?
For this kind of thing, sadly enough, it seems like the venerable Tcl + Tk combination is still hard to beat.
And when you need an alternative language APIs, we need documentation that is native to those languages. All too many of these toolkits provide some rudimentary alternative UI, but it's just an export of the C++ API, and the programmer is expected to read the C++ documentation, and mentally convert that to the appropriate perl, python or what-have-you alternative.
So what are the easy cross-platform, scripting UI alternatives? Tcl + Tk, python + wxWidgets, and what else? Any way to get at those Swing libraries without heavy lifting with Java?
Re: Other languages (Score:3, Informative)
For GTK+, see http://www.gtk.org/bindings.html [gtk.org], where they have a status table for ~28 languages. Presumably the Qt site does the same thing.
> And when you need an alternative language APIs, we need documentation that is native to those languages. All too many of these toolkits provide some rudimentary alternative UI, but it's
Why I chose GTK+ (Score:4, Informative)
I haven't read the article, since GTK+ is already my preferred GUI toolkit. And this in spite of the fact that I run KDE as my primary desktop! I run both Gnome and KDE, and my choice of KDE over Gnome is based more on organization and flexibility than it is on the underlying GUI toolkit.
As background: My wrote my first GUI programs back in the days of Window 3.1, and while most of my work is on data-crunching engines, I do write quite a few GUI applications. I need to rapidly generate an interface, back it with code, and have it presentable on Windows and Linux.
As a programmer, I don't like QT. It feels klunky, bloated; nor do I find QT Designer all that friendly. Beyond matters of taste and comfort, TrollTech requires a commercial license for certain tools (e.g., a MathML widget) that I can obtain under GPL for GTK+.
I'm rather fond of Glade. Most of my GTK+ GUI programs are in C, some in C++; I define an interface in Glade, fill in the appropriate functions, and I'm ready to rock and roll.
GTK+ 2.8 brought with it Cairo [cairographics.org], a very nice drawing toolkit. I just put together a little interactive graphics application, just to better familiarize myself with Cairo, and the result is quite nice. [coyotegulch.com]
In the near future, I'll be writing some very extensive OpenGL applications, and I'll likely wrap these in a GTK+ GUI. If something better comes along, I'll try it -- but for now, GTK+ provides what I need. Your mileage may vary.
In the interests of salesmanship (Score:3, Informative)
GTK+ is a toolkit for GIMP.
GIMP is an open sourced graphics manipulation package (think Photoshop but free as in speech and beer).
Re:yawn (Score:2)
Yeah right.
Re:yawn (Score:2, Insightful)
(I find it hilarious that I was marked offtopic for pointing out that the original story was offtopic. I stand by that comment regardless of how it's modded, though.)
Okay, you're undoubtedly right. (By the way, I maintain a Perl-Gtk module, so I don't mean to knock on Gtk. It's simple to use, and importantly for me the Perl-Gtk community is very active.)
I'm not sure though for example why you couldn't implement a word processor
Re:yawn (Score:2)
Re:gtk is doomed (Score:2)
Have you SEEN the mono and VB runtimes recently?
Go look at the usability testing Novell's been doing with Gnome -
Re:Time For Apple To Release The Cocoa Runtime (Score:3, Informative)
Comment as you will, they have actually proven to perfom exceptionally well and been quite resilient and easy to install across a variety of platforms (like most in our industry, we have a combination of Windows, Mac OSX, and Linux desktops with Solaris, Irix, and HP/UX servers).
For thing