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

27 of 356 comments (clear)

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

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

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

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

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

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

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

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

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

  8. Re:Just curious by strider44 · · Score: 4, Informative

    Yes Gimp still uses the Gimp Tool Kit.

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

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

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

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

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

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

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