Slashdot Mirror


Why Use GTK+?

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

78 of 356 comments (clear)

  1. Just curious by Saven+Marek · · Score: 2, Funny

    Does gimp still use GTK+ of some version or some other for its toolkit?

    1. Re:Just curious by JanneM · · Score: 2, Funny

      Does gimp still use GTK+ of some version or some other for its toolkit?

      Yes.

      --
      Trust the Computer. The Computer is your friend.
    2. Re:Just curious by strider44 · · Score: 4, Informative

      Yes Gimp still uses the Gimp Tool Kit.

  2. Nokia by ultrabot · · Score: 5, Informative

    One interesting consideration when determining what toolkit to go with is that the GUI toolkit for Nokia's new internet tablet is GTK+.

    --
    Save your wrists today - switch to Dvorak
    1. Re:Nokia by Anonymous Coward · · Score: 4, Informative

      It's actually a modified version of GTK+, with some components removed (those that they felt weren't needed given the constraints of the device) and some new stuff added in (mainly the "Hildon" libraries) for creating new applications that can take advantage of the device-specific widgets and layout.

    2. Re:Nokia by ebassi · · Score: 2, Informative

      The interesting bit is that, thanks to the Maemo project, Nokia is gving back to the community some of the changes made to the GTK libraries - namely, the stylus mode and other issues that emerged during development of the Hildon platform library.

      --
      You can save space. Or you can save time. Don't ever count on saving both at once. -- First Law of Algorithmic Analisys
  3. What is GTA? by earthstar · · Score: 3, Informative
    For those who didnt RTA,

    GTK+ is a graphical user interface (GUI) tool kit.
    That is, it's a library (or, in fact, a collection of several closely related libraries) that allow you to create GUI-based applications. Think of GTK+ as a toolbox in which you can find many ready building blocks for creating GUIs.

    Originally, GTK+ was created as a spin-off of another well-known open source project: the GNU Image Manipulation Program (GIMP). While working on early GIMP versions, Peter Mattis and Spencer Kimball created GTK (which stands for GIMP Toolkit) as an alternative to the Motif tool kit, which at that time was not free. (The plus sign was added to the name later, when the tool kit gained object-oriented features and extensibility.)

    That was almost 10 years ago. Today, a lot of activity is still going on with the latest GTK+ version -- 2.8 -- and while GIMP certainly continues to be one of the best-known programs using GTK+, it is by far not the only one. Literally thousands of applications have been written for GTK+, and at least two major desktop environments (Xfce and GNOME) use GTK+ to provide a full working environment for users.
  4. Interestingly... by Lendrick · · Score: 4, Informative
    These all apply to Qt as well. To each their own. :)

    • It's both modern and actively developed and maintained, with a vibrant surrounding community.
    • It offers a wide array of options for extending your work to as many people as possible, including a sophisticated framework for internationalization, localization, and accessibility.
    • It's simple and easy to use, both for developers and users.
    • It's well designed, flexible, and extensible.
    • It's free software with a liberal open source license.
    • It's portable, both from the user's and the developer's perspective.

    1. Re:Interestingly... by Anonymous Coward · · Score: 3, Informative

      QT/X11 is indeed free software, but what about QT/w32 ?
      Also, you are allowed to use GTK+ for proprietary projects (LGPL). The free QT is GPL.

    2. Re:Interestingly... by adolfojp · · Score: 4, Informative
      It's free software with a liberal open source license.
      Eh... not quite, unless you plan to make open source software exclusively. http://www.trolltech.com/products/qt/licensing.htm l
      The same thing applies to MySQL but people seem to mistake the GPL for the LGPL.
    3. Re:Interestingly... by adolfojp · · Score: 5, Insightful

      You make a very good point.

      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

    4. Re:Interestingly... by FidelCatsro · · Score: 2, Informative

      QT/w32 is believe is now GPL as are all version , but you may also purchase a commercial license if you so wish .

      --
      The only things certain in war are Propaganda and Death. You can never be sure which is which though
    5. Re:Interestingly... by rsidd · · Score: 2, Insightful
      Eh... not quite, unless you plan to make open source software exclusively.

      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 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 business model -- if you want to write proprietary software, you buy a license from them and give them some revenue (as lots of people do), and if you want to write free software, it's all yours. The GNU supporters should be holding Qt up as an example.

      Anyway... let people choose the toolkits based on their merits. Plenty of people seem to be choosing both. (Mozilla=GTK+, Opera=Qt. Acrobat Reader=GTK+, Scribus=Qt. Etc.) But I dislike disingenuous articles like the present developerworks article which pretends that GTK+ is the only toolkit that exists. Everyone knows Qt exists too -- if you believe GTK+ is better, explain why, but don't sweep the discussion under the carpet.

    6. Re:Interestingly... by adolfojp · · Score: 5, Informative
      ... I dislike disingenuous articles like the present developerworks article which pretends that GTK+ is the only toolkit that exists.

      From the article:
      In actuality, modern GUI tool kits do more than merely avoid duplication. They offer many advanced capabilities that users have come to expect in their applications and which wouldn't be attainable otherwise because the time and work investment in such tool kits exceeds whatever you could spend on a single application. Therefore, if using a GUI in your application is important to you, use a tool kit. There's simply no other way. Now, the only question left is, which tool kit should you use?
      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, his article would loose focus quickly if he meant to mention all of them.
    7. Re:Interestingly... by penguin-collective · · 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

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

      Plenty of people seem to be choosing both.

      Your examples suggest that both are about equally capable. So, the rational thing to do is to pick the cheaper one--Gtk+.

      Everyone knows Qt exists too -- if you believe GTK+ is better, explain why, but don't sweep the discussion under the carpet.

      Gtk+ is better to many people because (1) it is developed like an open source toolkit, and (2) it is free for commercial use.

    8. Re:Interestingly... by agurkan · · Score: 2, Informative

      its only GPL for non-commercial stuff
      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 (or do not want to release source code etc. etc.) i have to use the proprietary license, not if i want to sell my work.

      --
      ato
    9. Re:Interestingly... by hughk · · Score: 3, Informative
      If you visit their website, you will find that MySQL are quite up front about their dual licensing policy.

      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.

      --
      See my journal, I write things there
    10. Re:Interestingly... by Nugget · · Score: 4, Insightful

      It absolutely does if you're using the mysql libraries to connect to the mysql database. Rather than being sanely LGPL'd, the mysql connector libraries are GPL which precludes their use in non-GPL codebases. So, unless you're a GPL developer, you need to purchase a commercial license for mysql (or find a database with less restrictive licensing).

      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.

    11. Re:Interestingly... by cortana · · Score: 5, Informative

      The MySQL client libraries are under the GPL, not the LGPL.

      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.

    12. Re:Interestingly... by doctormetal · · Score: 2, Informative
      QT/w32 is believe is now GPL as are all version , but you may also purchase a commercial license if you so wish

      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.

    13. Re:Interestingly... by squiggleslash · · Score: 3, Insightful
      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
      I'm trying to work out why you'd assume that someone criticising a product for not letting you produce proprietary software that uses it is a "GNU zealot". Is the GP known to you and always ranting on about GNU and how wonderful the GPL, or are you just making an assumption?

      If the GP is genuinely against a license because it means a library cannot be linked against a proprietary program, then they're not a "GNU" (or FSF, or GPL) zealot. They may be a zealot, but they're not a GNU one.

      Many Free Software people, which is a diverse group encompassing many opinions, eschew the GPL for precisely this reason and consider themselves active opponents of it. One example would be the OpenBSD team, and Theo DeRaadt in particular, who is strongly against the GPL because he wants his work to be freely available even to those who'd not make public the source of their released changes.

      These are legitimate opinions. Your characterization is as bad as someone who sees, say, Bush criticised for not proposing a clearly religiously-motivated supreme court nominee, and then Bush criticised for reversing his position, withdrawing the nominee, and making an apparently religiously-inspired one, as "Christian Conservative Zealots not letting Bush win". They're different critics.

      --
      You are not alone. This is not normal. None of this is normal.
    14. Re:Interestingly... by Tellalian · · Score: 4, Insightful

      It'd be interesting to see if such a "claim" would ever hold up in court. You'd think if it did, AOL or MSN would have sued Gaim years ago for breaking their "license". Commonsense would dictate if Gaim can implement a proprietary protocol for interoperability, than anyone could implement MySQL's protocol for the same reason. I don't have a reference on hand, but I believe a court decided client-server interaction didn't constitute a level of usage where licenses like the GPL were applicable.

    15. Re:Interestingly... by adolfojp · · Score: 2
      I said:
      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.
      You replied:
      Stop blamming the GPL what should be blammed on stupidity!
      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 tell the difference between the GPL, LGPL, FreeBSD and the MIT license.

      The sad thing is that I have seen this ignorance not only in script kiddies learning to dabble in php but also in local government computer people who are in charge of the state's entire transportation computer systems. To them open source is nothing but a beautifull abstract idea that lacks solid form, specifications or boundaries.
    16. Re:Interestingly... by jonored · · Score: 3, Interesting

      Leaves me wondering if you could successfully play linking games to keep your software non-GPLed when you distribute it. Construct a general database interface API (or find a compatibly licensed one - not GPL...), write your app to use that API, and distribute it. Also distribute a module that is GPLed that talks to the mysql database. The user links the module with the app, and the GPL asserts itself on this new derivative work; the end user cannot distribute this work without distributing full source; but the end user is restricted from distributing it anyways, if it's a commercial product. If not, then they can distribute it unlinked anyhow. The interface is not a work based on the GPLed work; the GPLed work wasn't involved in it's construction, it's just an database interface tailored to the needs of your app. Your app is only based on the interface; the interface isn't GPLed, no problem. The code that translates your interface to the GPLed work is based on the GPLed work; it must be under the GPL if you are releasing it. That does not, however, do anything to the licensing of the interface or your app. When linked, they are a derivative work, and therefore cannot be copied, distributed, modified and all that except under the GPL; nobody cares. This happens well after you'd want to do any of those with it - it doesn't keep you from using it. This is actually the scheme that the madwifi project uses to get their FCC-mandated binary module into the kernel; it doesn't particularly interact with the kernel, it interacts with their code, based on an interface which is licensed such that the GPL doesn't apply.

    17. Re:Interestingly... by arkanes · · Score: 2, Informative
      The GPL implies that one can "use" the software without restrictions, and then relies on an extra-legal interpretation of copyright law to enforce the "viral-ness".

      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 court case that really spelled out the limits, and I doubt there would be - there still isn't a hard standard for music or written works. The main legal weakpoint of the GPL is actually in an area where it is overly permissive - distribution within an organization is absolutely considerd "distribution" under copyright law and should invoke the GPL, and I'm not sure why they think it shouldn't.

      Not to mention that the FSF's take on the issue of libraries and derived works is entirely different than every commercial library vendor's!

      This is totally false and you won't find any commercial library vendors saying that you don't owe them money because you only dynamically linked to thier library, or because you didn't distribute it.

    18. Re:Interestingly... by JBMesserly · · Score: 2

      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!

      I don't think "GNU zealots" would say that. As you correctly point out, Free Software advocates prefer the GPL to LGPL in almost all cases (this link has more information). Now, years ago the Free Software Foundation recommended against use of QT, because back then it was only available under a non-free license. Now that QT is 100% free software (and even better, under the GPL) there's no reason to avoid it.

      Personally, I think QT, MySQL, BerkeleyDB and others are setting a good example. To a Free software developer, they're just another GPL-compatible software library ready for reuse. To a proprietary software developer, they're just another piece of software that has to be licensed commercially. From QT's perspective, they get testing/improvements/fixes/more free software from Free software developers, and licensing fees from proprietary software developers. Everyone wins.

    19. Re:Interestingly... by IntlHarvester · · Score: 2, Interesting

      No, I can ship a closed-source software product designed to use the Microsoft or Oracle ODBC drivers without having to either distribute the ODBC drivers or pay a nickle to Oracle or MS. Sure, the enduser is paying them, but that's likely why they want to use my software in the first place.

      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 software program, but MySQL does. This may or may not be legally correct, but it is certainly a "gotcha" for folks used to commercial library licences.

      --
      Business. Numbers. Money. People. Computer World.
  5. Distribution on Windows by yogikoudou · · Score: 2, Interesting

    GTK is fine, but as long as it takes a few megabytes to download, only Linux applications will use it. Take a look at The GIMP for example: it is ok to download GTK because it is a big program, but who would develop a small application ( 1MB) if it depends on 6-8 MB for GTK ? On the other hand, Linux users rejoice, as they have good distributions with good dependency resolvers.

    1. Re:Distribution on Windows by Max+Threshold · · Score: 5, Insightful

      Yeah, right. How big is the latest vbrunxxx.dll?

    2. Re:Distribution on Windows by KiloByte · · Score: 4, Insightful

      vbrunxxx.dll? That's nothing. Try the .NET runtime, and talk about bloat again.

      --
      The creatures outside looked from Alt-Right to Antifa; but already it was impossible to say which was which.
    3. Re:Distribution on Windows by CaptnMArk · · Score: 2, Interesting

      And currently, I have better experience with GTK+ than WinForms.

      MS still can't do large fonts and resizeable dialogs.

    4. Re:Distribution on Windows by TheLoneCabbage · · Score: 4, Insightful

      No one distributes software on floppies any more. 6-8MB added to your installer isn't a BIG deal. It translates into another 30sec worth of download. If its a burden on anyone, it's a burden on your webservers.

      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 .NET apps onto w98 systems (it won't install on anything earlier), it's a 21MB hair ball and a real paint to install. Once my employer made the decision to port their entire app base to .NET, which made development LOTS easier, but we went from a 5meg install to a 30meg nightmare that wouldn't run on w95 no matter what (still an issue believe it or not).

      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.

    5. Re:Distribution on Windows by wysiwia · · Score: 2, Informative
      ... I recommend to use wxWidgets ...

      Biased by my own project wyoGuide (see http://developers.slashdot.org/comments.pl?sid=172 263&cid=14343909) I can say that wxWidgets is probably the best choice for cross-platform development.

      O. Wyss

      --
      See http://wyoguide.sf.net/papers/Cross-platform.html
    6. Re:Distribution on Windows by Richard+W.M.+Jones · · Score: 4, Informative

      if it depends on 6-8 MB for GTK

      Our cross-platform "hello world" program including Gtk is about 300K compressed in total on Windows.

      Rich.

    7. Re:Distribution on Windows by Theatetus · · Score: 4, Informative
      I don't know about vbrun but the MFC DLL is less than a meg in size.

      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

      --
      All's true that is mistrusted
    8. Re:Distribution on Windows by Cyberax · · Score: 2, Interesting

      It's about 0, because they are installed along with the Internet Explorer. It's possible to create a _full_ MFC application in just about 500Kb if one uses static versions of MFC and CRT libraries.

  6. It is just a tool by Anonymous Coward · · Score: 2, Interesting

    It's interesting that they advocate using it vs Win32 in their examples. You really don't have a choice of the overhead for a Win32 system. You do have a choice of ignoring the overhead for GTK+. This overhead is why the POSIX and OS/2 implementations in Windows NT and later were never particularly useful. They used additional overhead (and they translated into Win32 function calls anyways!). GTK+ doesn't have this second problem (as far as I know) but it will still require additional overhead. If that's not a problem, then use it to your hearts content. Otherwise, Win32 seems to be the answer.

  7. With the bazillion GUI toolkits out there.. by xtal · · Score: 2, Interesting

    a better question might be.. "why use a gui"

    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?

    --
    ..don't panic
    1. Re:With the bazillion GUI toolkits out there.. by undeadly · · Score: 5, Informative
      Are there any cross platform (linux, mac, windows) GUI RAD tools ala Builder, yet?

      You have QT Designer that is part of the QT Toolkit.

    2. Re:With the bazillion GUI toolkits out there.. by adolfojp · · Score: 3, Informative
      Are there any cross platform (linux, mac, windows) GUI RAD tools ala Builder, yet?
      I like to use this one: http://glade.gnome.org/ Its windows port works fine but I haven't tried the Mac version yet.
      These guys 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. :-P
  8. GUI? by Anonymous Coward · · Score: 5, Funny

    What the hell is wrong with printf?

    1. Re:GUI? by archeopterix · · Score: 5, Funny
      What the hell is wrong with printf?
      Yeah, everyone seems so excited about printf. Having spent 40 years programming computers I can tell you its another fad.

      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'!

  9. The Question is... by Chaffar · · Score: 4, Funny
    Martin Fink Tells it like it is: The question is NOT why you should use GTK+, but WHY NOT? _______ Click here to read more
  10. Tempting.... by ardor · · Score: 2, Interesting

    to start a Gtk+ vs. Qt Flamewar here. Gtk+ is easier to install & handle (moc can be a real PITA sometimes), but until Gtk+ gets a really GOOD documentation and API, I'll stick with Qt. No, neither google nor devhelp are adequate. I want a reference as well done as the Qt one. Does such a thing exist?

    --
    This sig does not contain any SCO code.
    1. Re:Tempting.... by jcupitt65 · · Score: 5, Informative
      The official docs are OK, I think. There's a tutorial too. There's also an excellent book: The Official GNOME2 Developers Guide, but sadly it's not available as a free download.

      People do rave about the Qt docs I know.

    2. Re:Tempting.... by harves · · Score: 3, Informative

      Sorry, but what's wrong with http://developer.gnome.org/doc/API/2.0/gtk/, with every supporting library also document at http://developer.gnome.org/doc/API/?

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

    3. Re:Tempting.... by mpeg4codec · · Score: 2, Informative

      Sean Egan's Open Source Messaging Application Development: Building and Extending Gaim covers basic to intermediate GTK+ programming [with sockets, no less] quite nicely. He meticulously describes everything he does with numerous examples. He never skimps on the details and even gives insights into his own thinking on most problems.

      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.

  11. GTK is alright...but no raves by Hosiah · · Score: 5, Interesting
    I'm not a very big fan of *any* GUI toolkit. GUIs are a pain to program in anyway, no matter what language or library you use. GTK is much easier if you hook it up with Glade, which drains some of the pain from the experience. Personally, for small jobs, I'm more apt to use Tcl/Tk, which is very brief. Literally, I will be unhappy with *every* GUI toolkit until I find one where you can express an entire dialog box in a SINGLE LINE (I don't care how Perl-like the syntax!) and get on with your life.

    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())};

    1. Re:GTK is alright...but no raves by ichin4 · · Score: 5, Insightful

      Um, you mean like this C# code?

      DialogResult result = MessageBox.Show("Quit without saving?", "", MessageBoxButtons.YesNoCancel);

      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.

    2. Re:GTK is alright...but no raves by Theatetus · · Score: 3, Informative

      Then again, actually GTK has what you want anyways, despite my earlier response rant:

      mywidget = gtk_dialog_new_with_buttons("Quit without saving?", GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, "Save", GTK_RESPONSE_OK, "Don't Save", GTK_RESPONSE_CANCEL);
      --
      All's true that is mistrusted
    3. Re:GTK is alright...but no raves by Techster · · Score: 4, Insightful

      Not even close to what the OP wanted. Yours just specifies text, an empty title, and the fact that it has three buttons (yes, no, cancel). You still need a block statement to handle the response, not to mention the fact that width and height will be determined automagically.

      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.

    4. Re:GTK is alright...but no raves by red990033 · · Score: 3, Funny

      >I will be unhappy with *every* GUI toolkit until I find one where you can express an entire dialog box in a SINGLE LINE (I don't care how Perl-like the syntax!) and get on with your life.

      I'm pretty sure you can do this with Visual Basic.. happy now?

      --
      Do what I say, cuz I said it.
      -Meatwad
    5. Re:GTK is alright...but no raves by ceeam · · Score: 2, Insightful

      /me blinks
      /me laughs hard

      "Uhm, we _need_ to change 'No' button to 'Review' - that should be easy to do, right? 5 seconds worth, right?" - so said the boss.

    6. Re:GTK is alright...but no raves by AnyoneEB · · Score: 2, Informative

      I don't know about the C# message dialog, but Java's Swing has a very similar method to which you can add an array of new names for the buttons. I would expect the C# method to allow for the same.

      --
      Centralization breaks the internet.
    7. Re:GTK is alright...but no raves by mangu · · Score: 2, Informative
      DialogResult result = MessageBox.Show("Quit without saving?", "", MessageBoxButtons.YesNoCancel);


      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 for Windows than for almost any other platform.


      Maybe I don't know much about GUI history, but at least from the late 1980s when I started writing GUI code for VAXstations until today I have never noticed anything as being easier in MS-Windows. The Petzold book was well written, and maybe that's why you think it was easy, but any advantage that MS-Windows had stopped there. I have written or supported GUI code in Xwindow, Motif, Qt, MFC, OWL, Gtk, FLTK, Tk, wxWinodws, Java, and maybe a few others that I can't remember right now.


      My personal choice of toolkit for new projects is Qt, due to three factors: an excellent API, the absolutely best documentation of all those I mentioned above, and a good set of development software, consisting of kdevelop and Qt Designer.

    8. Re:GTK is alright...but no raves by ipfwadm · · Score: 2, Insightful

      not to mention the fact that width and height will be determined automagically ... His code specified the height, width

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

  12. A better title would be "Why use a toolkit"? by spaceturtle · · Score: 2, Interesting
    It seems that most of the information would be true for any toolkit, and it isn't clear what toolkit they are attempting to contrast GTK+ with. The only alternative they mention is "writing your own UI code".

    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 writing their own GUI code directly above X or raw devices would immediately see the advantage of using a toolkit, and the only questions remaining would be "which one?" and "why GTK+ rather than e.g. GTK or QT?". Possibly it is aimed purely at Windows developers. I remember that several years ago Windows GUI code was a beast to write, and I was amazed at how simple GTK was. If Windows is still that bad, I guess just listing GTK+'s features would be enough to make win32 developer's mouths water, but I'd still prefer the article if it made it clear that win32 is what it is comparing GTK+ to, and did a proper compare and contrast. That way I'd actually have a summary of what Microsoft has been up to in the last decade :).

    1. Re:A better title would be "Why use a toolkit"? by Draek · · Score: 2, Informative
      Originally, GTK+ was created as a spin-off of another well-known open source project: the GNU Image Manipulation Program (GIMP). While working on early GIMP versions, Peter Mattis and Spencer Kimball created GTK (which stands for GIMP Toolkit) as an alternative to the Motif tool kit, which at that time was not free. (The plus sign was added to the name later, when the tool kit gained object-oriented features and extensibility.)
      from the article, second paragraph =)
      --
      No problem is insoluble in all conceivable circumstances.
  13. Cross-platform GUI RAD (for GTK+, etc): wxDesigner by Chuck+Messenger · · 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.

  14. Actually, standard versions of wrapper 'd be good. by spaceturtle · · Score: 2, Insightful
    Recently the PLASH project had to override the standard GTK file open dialog box to achieve certain security related aims. This was somewhat complicated by the fact that there is no standard GTK file open dialog box function ;).

    Also it would be one less function that has to be written and maintained across the thousands of projects that use GTK.

  15. Holy 5417! by Black+Parrot · · Score: 4, Funny

    > GTK+ is a graphical user interface (GUI) tool kit.

    And all this time I thought everyone was talking about a game called "Grand Theft Potassium Ion".

    --
    Sheesh, evil *and* a jerk. -- Jade
  16. Re:Cross-platform GUI RAD (for GTK+, etc): wxDesig by wysiwia · · Score: 2, Insightful

    True, wxDesigner is an alternative on Linux I haven't thought of. Thanks :-)

    BTW see http://developers.slashdot.org/comments.pl?sid=172 263&cid=14343999

    --
    See http://wyoguide.sf.net/papers/Cross-platform.html
  17. No, 3.5 MB by jcupitt65 · · Score: 2, Informative

    No, the current stable win32 GTK+ runtime is 3.5 MB. Here's the download page.

  18. wxWindow by DesiStud · · Score: 2, Interesting

    Hey u all forgot wxWindow. That's strange. I think it is a strong competitor of GTK+ and Qt. Isn't it

  19. wxWidgets? by El_Muerte_TDS · · Score: 3, Informative

    Why not wxWidgets? It's more flexible if you ask me. It simply wraps the native GUI stuff, or an other toolkit like GTK+.
    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+).

  20. Yes but... by wwahammy · · Score: 4, Informative

    IBM seems to skip over one of the biggest reasons to NOT use GTK+ - it just doesn't look right on Windows. I'm not sure who said it but a commentator suggested a while ago that one of the reasons open-source programs weren't overtaking closed source was due to a lack of polish (which does of course cover more than just appearance); he used GAIM vs. MSN Messenger as an example. The jarring difference between controls in GTK+ or Java or even Mozilla to some extent vs Win32 is important when you're creating an application for normal end users. In my opinion, that difference can look unprofessional. I would figure that the issue of appearance could be mitigated but it hasn't yet so I don't know for sure.

    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?

    1. Re:Yes but... by _xeno_ · · Score: 2, 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 than GTK+'s WIMP is. WIMP needs a ton of work to properly fit in with Windows.

      --
      You are in a maze of twisty little relative jumps, all alike.
  21. Re:yawn by kwoff · · 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.)

    AJAX for 3d modeling? AJAX for word processors? AJAX for image manipulation?

    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 in AJAX. Or, using SVG, you could do something with 3-d modeling? I guess it would depend on the features. A grammar checker might be hard to write in JavaScript, for example... Then again, you might be able to send the text to the server to do something like that. (I think the distributed computing dream has never seemed to materialize. That's the context in which I see "AJAX" being really powerful, though. I imagine having a web service (use JSON instead of SOAP, if you want) running on a server dedicated to grammar checking. You might whine about network latency, but then again you never had to download (or even load into memory) the grammar checker, and it could be optimized on the server end (in practice, it'd no doubt be hammered all the time, though, which along with security concerns is probably a big reason why distributed computing has been a pipe dream).)

    But your point is that not every application can be done using AJAX. Okay, granted. But maybe a generic XUL-like framework? Why isn't something like Gtk exposed through Mozilla, then? (Maybe it is. I think you can write custom widgets, expose them using...XBL or XPCONNECT or whatever it is.) The browser itself is done with Gtk. So a browser can be implemented in Gtk, and using XUL we can create fairly sophisticated GUI applications (browser, mailer, calendar). I wouldn't be surprised if in fact you couldn't implement a word processor in XUL. So my argument has drifted from AJAX to XUL. But XUL and AJAX are similar in ways, just different focuses. Another dream that hasn't seemed to have lived up to its initial promise, XUL. Now this comment does deserve to be modded offtopic. Thanks.

  22. Forget something? by RedBear · · Score: 4, Insightful

    No one distributes software on floppies any more. 6-8MB added to your installer isn't a BIG deal. It translates into another 30sec worth of download. If its a burden on anyone, it's a burden on your webservers.

    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.

  23. Re:Time For Apple To Release The Cocoa Runtime by FellowConspirator · · Score: 2, Informative

    In many industries, this is the preferred method. I know our company increasingly is offered (and purchases) laboratory information management systems (LIMS) and curated databases with various front-ends that are Java apps.

    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 things like Linux, the ability to treat jar-files as native executables (using the binfmt-misc mechanism) makes it dead-simple to deploy apps.

    This is not entirely unique to Java. .Net holds some promise here. It won't be useful in our industry until it's well-supported outside Windows, but I imagine that there's other industries that still have less heterogeneous environments...

    I whole-heartedly favor cross-platform VMs to whatever extent they are appropriate and I really don't buy the "jarring difference in appearance" argument. Clipboard interoperability, maybe; hosting native media widgets, sure, but button textures? Dumb.

  24. Other languages by rpg25 · · Score: 3, Interesting

    One issue that I like to look at when I'm thinking about GUI toolkits is the question of what programming languages does it support.

    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?

    1. Re: Other languages by Black+Parrot · · Score: 2, Informative

      > 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 GTK+, see http://www.gtk.org/bindings.html, 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 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.

      FWIW, the GtkAda project does provide pretty good documentation, both a User's Guide and a Reference Manual. There are holes sometimes, but they usually tell me everything I need to know.

      --
      Sheesh, evil *and* a jerk. -- Jade
  25. Why I chose GTK+ by ChaoticCoyote · · Score: 3, 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, 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.

    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.

  26. GTK, the good and the bad by sick_soul · · Score: 2, Insightful

    I like GTK and use it both with C and with python (pygtk).
    I also used other toolkits, like tk, wxwindows, QT, java swing.

    I like the native C API + language bindings for every taste, so I can
    program GTK at the abstraction level I want. I like the pango markup. Also interface prototyping is fast enough (though not as fast as with tk) [...]

    Among the few things I do _not_ like are the new GtkTreeView, which is very general and powerful, but it makes doing very simple things too complicated, and the terrible new gtkFileChooserDialog.

    However, I can still avoid those using some deprecated widgets (for now).

  27. Re:how about other toolkits? by sick_soul · · Score: 2, Insightful

    > How does GTK+ compare to Tk and and WxWidgets?

    GTK is more powerful (you can tweak widgets more), but it's bigger and more painful to program. You can do the most complicated things, but easy things are longer to achieve. To the random user, a well built GTK interface looks decent.

    With Tk you have a much simpler API, where the common operations are much easier to perform. However some things you can do in GTK are almost impossibile to perform on tk (things the average programmer seldom needs though). To the random user, tk looks horrible. To me it looks perfectly ok, so I really do not understand what hurts people's eyes.

    I have played with wxWidgets, but I leave the comparison to someone else.

  28. Re:how about other toolkits? by schlenk · · Score: 2, Interesting

    Badly written Tk looks horribly Motif like and dated. Good Tk (with theming thanks to the tile project http://tktable.sourceforge.net/tile/ ) can look quite nice an modern, take a look at the screenshots. Its just the little extra polish thats often missing in Tk apps, because the authors are adding features instead of polishing the GUI.

  29. Why you should drive a Ferrari (short version) by spaceturtle · · Score: 2, Funny
    Walking can be time consuming, driving a Ferrari is much faster. The Ferrari has the following features:



    - A steering wheel for ease of navigation!

    - Four wheels providing good stability, even while turning!

    - Car seats, so you don't fall though the floor!

    - There is even a vibrant community of fuel stations than can refuel your Ferrari!!!

  30. In the interests of salesmanship by obeythefist · · Score: 2, Informative

    Yet another slashdot article referring to a product without explaining the purpose of said product.

    GTK+ is a toolkit for GIMP.
    GIMP is an open sourced graphics manipulation package (think Photoshop but free as in speech and beer).

    --
    I am government man, come from the government. The government has sent me. -- G.I.R.