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

22 of 356 comments (clear)

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

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

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

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

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

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

  9. gtk is doomed by cg0def · · Score: 1, Insightful

    for as long as MS/windows holds over 95% of the desktop market there is absolutelly no poit in using gtk. Gtk+ performs pretty bad on windows and yes it is a huge pain to include an 8mb lib just so you can run a small program. That said gaim i great and I use it all the time but programming in c with custom classes over c++ ... you have to be joking. Yes I know there are c++ wrapper but the programing lang. is the least of the problems that gtk+ has. Apparently the gui libs are developed by the same natzi who are leading the gnome project to it's inevitable doom. You cannot contantly mess with the UI and change things arroud just because someone though that it would be better. First of all OSS projects do not have enough money in order to actully condict a study on what the user thinks is best and 2nd if the gnome and gtk+ teams don't realize that software is written for the end user and NOT for the developer, both of these projects would stand no chance against any competition. For crying out loud this is one of the first principles in any OS textbook and those people are supposed to be way above a textbook level. SO should you use gtk+ I really don't think so. After all there are qt and wxwidgets and they both do a better job. Oh and I cannot stress enough how important documentation is. But I guess some people don't think so ... sad ...

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

  12. Re:Interestingly... by Anonymous Coward · · Score: 1, Insightful

    Well, to me gtk is better because it has bindings for more languages than qt, or maybe even more importantly the reason behind this: gtk has C-interface and QT has C++-interface. It is much easier to access C-library from another language than a c++ -library. Also, there's an interesting thing called gtk-server (http://www.turtle.dds.nl/gtk-server/index.html) which enables me to use gtk from nearly any language without doing any bindings (I can do a GUI for my sed -script if I want to).

    Yes I know this may not be a major issue for others but here's an explanation from my point of view. I think C++ is pretty much an evolutionary dead end(one big reason being the unfriendliness to other languages) and would like it to die as soon as possible.

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

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

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

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

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

  19. Why I won't use GTK. by bored · · Score: 1, Insightful

    Basically its archaic. GUI development is one of the few areas where object oriented design makes a big difference to the programmability of the system. This has been known for the better part of 15 years. All those little buttons/menus/combo boxes/etc with the hundreds of properties to control behavior. The need to override behavior, the need to hook events. The list goes on. Sure you can make it work in a non object oriented environment, but I could be writing everything in assembly too. I don't choose to write everything in assembly, and I'm not going to use a GUI tool kit that isn't object oriented. You can argue that GTK is object oriented C but that completely misses the point since object oriented languages assist in a particular design methodology. Oh, and i'm aware of the C++ wrappers for GTK+ which are just that wrappers, plus they are ugly and poorly maintained. I'm not going to spend all my time debugging the wrapper when I could be getting useful work done.

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

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

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