Tk Verses Gtk(And Python verses Tcl)

Back when I was using Windows, I searched for some language that would let me create GUI application. I knew C++ - but creating a GUI using C++ was very, very hard. After some searching I found Tcl/Tk - it was perfect. I liked Tk so much that I used it to create GUI in perl programs. And in Ruby. And in Python. I even wrote tutorials for Tcl/Tk and Perl/Tk. Then I discovered Linux. initially I was glad that I did not choose VB - that would mean that I have to throw away all my custom programs. But since I used open languages like Tcl, Perl, Ruby etc, they will run on Linux as well.

But when I actually ran the programs in Linux, I got the shock of a lifetime. The applications I created looked bad - really bad…

TK Screenshot - Ugly

I still use many Tk programs - but because of the looks issue, I decided to stop using Tk for my new programs. So I decided to try GTK. I even created a small application using PyGTK(my first) to view the harddisk space usage in Linux - Frees.

Frees Screenshot

It was a very simple application - all I had to do is run the ‘df’ command, parse its output, and display a small table using that data. I was expecting around 100, 150 lines of code at the most. But after I created the app, I have 500+ lines of code.

At first, I thought that it was a mistake on my part - I thought that I was not using the best method. But then I came across an article in Reddit - gnocl or PyGtk?.

PyGtk is still the most recommended binding for Gtk. A lot of programs in Linux is written using PyGtk. So naturally there are a few advantages for using it…

  • It will be the more ‘road-tested’ binding.
  • Many system will have it installed by default.
  • Bigger community - so…
    • more support
    • more examples
    • more tutorials
    • etc.

One the other hand, I have to write more code.

Conclusion

If it is a private script - only useful for myself, then I will use Tcl/Tk or Gnometcl. If the script could be distributed, like Frees, then I will use Python GTK.

What about the other options…

  • wxWidgets
  • PyQT
  • Ruby/GTK
  • Perl/GTK

Any recommendations for me on which library to use? Please leave it in the comments.

3 Responses to “Tk Verses Gtk(And Python verses Tcl)”

Linux-Benutzung » Re: Auf dem Desktop-Markt hat Linux nichts zu suchen ! Die Linux-Lemminge … - Konsortium will Linux auf die Desktops b… at March 18th, 2008 at 5:31 am

[...] > Du hysterisch wirst. Denn die Systemschnittstellen von Linux > > und Darwin sind recht aehnlich. Es stellt kein prinzipielles > > Problem dar, Mac OS X-Binaries in einer Linux-Umgebung > > ablaufen [...]

Python Hello Script » Bin-Blog at March 19th, 2008 at 11:33 pm

[...] want to insert a disclaimer here - I am not that good with python. We never really clicked. I have done very limited work in Python. So if you notice any problems with the below script, let [...]

Hello Script for Tcl » Bin-Blog at April 24th, 2008 at 10:44 pm

[...] Tcl, or Tool Command Language, will not be found in the ‘most popular languages’ hall of fame. That is partly because of its ‘wierd’ syntax. But those who know Tcl will tell you that Tcl is a pleasure to work with. I have a special interest in Tcl - its the language that introduced me to GUI programming(Tcl/Tk). Now, when ever I see a GUI toolkit, I compare it to Tcl. [...]

Leave a Reply



Subscribe to Feed