sandeep.ses has asked for the wisdom of the Perl Monks concerning the following question:

Hello guys, i have been working with perl/tk for a while . i was just wondering about gtk-perl. I tried to work with gtk-perl but i found that perl/tk has better support and plus has several books written on it. does anyone have a good idea about the merits of one over the other more in terms of usage and features. Thanks Sandeep

Replies are listed 'Best First'.
Re: perl Tk vs Gtk perl
by gaal (Parson) on Jul 28, 2004 at 04:22 UTC
    The Perl bindings to GTK follow the original library fairly closely, so that most documentation you find about writing for GTK in C/C++/C#/Python/Ruby/OCaml etc. might help you. Also, GTK has active mailing lists with typically friendly and quick replies to questions.

    Did you see the Reference Manual? It might give you some idea of what it's like to work with the library.

    PS: I was only half joking about the OCaml bindings :-)

Re: perl Tk vs Gtk perl
by zentara (Cardinal) on Jul 28, 2004 at 13:07 UTC
    In addition to the documentation differences, another advantage of Tk over Gtk is it's ease of installation, and cross-platform compatibility. Tk installs easily on most platforms, and is especially compatible with Windows.

    Gtk can be a pain to get going. The latest version requires a whole slew of the latest libraries be installed, with a properly configured pkgconfig. This is a real common problem for new users to linux....how do I upgrade my gtk2 libs. Gtk2 also poses some difficulty getting installed on Windows.

    On the other hand, the GTK2-perl team have done a great job of getting the perl port going. The perl-gtk2 widget demo almost works perfectly. :-)


    I'm not really a human, but I play one on earth. flash japh
Re: perl Tk vs Gtk perl
by Aristotle (Chancellor) on Jul 28, 2004 at 15:40 UTC

    Make sure you use Gtk2-Perl, not Gtk-Perl. The latter is deprecated — it is not maintained any longer (the last release was ages ago), and it binds the Gtk+ 1.x libraries, which in turn are also unmaintained. In addition, Gtk-Perl's bindings coverage of Gtk+ 1.x was never even nearly as complete as Gtk2-Perl's coverage of Gtk+ 2.x.

    The Tk API is seriously botched in my opinion. Trying to write Tk applications is always a messy affair, full of globals and difficult to modularize and abstract. It's spaghetti code at its finest.

    In contrast, Gtk2 is a joy to work with, and allows applications to be written in much cleaner and more maintainable fashion. It is downright fun — once you've grokked various concepts that apply in GUI programming in general, you'll probably find it almost completely intuitive. I love it to pieces.

    Makeshifts last the longest.