{"id":62,"date":"2007-10-31T23:59:10","date_gmt":"2007-10-31T18:29:10","guid":{"rendered":"http:\/\/www.bin-co.com\/blog\/2007\/10\/tk-verses-gtkand-python-verses-tcl\/"},"modified":"2007-10-31T23:59:10","modified_gmt":"2007-10-31T18:29:10","slug":"tk-verses-gtkand-python-verses-tcl","status":"publish","type":"post","link":"https:\/\/www.bin-co.com\/blog\/2007\/10\/tk-verses-gtkand-python-verses-tcl\/","title":{"rendered":"Tk Verses Gtk(And Python verses Tcl)"},"content":{"rendered":"<p class=\"\">Back when I was using Windows, I searched for some language that would let me create GUI application. I knew C++ &#8211; but creating a GUI using C++ was very, very hard. After some searching I found Tcl\/Tk &#8211; it was perfect. I liked Tk so much that I used it to create <a href=\"http:\/\/www.bin-co.com\/perl\/tk\/sedgui\/\">GUI in perl programs<\/a>. And <a href=\"http:\/\/www.bin-co.com\/ruby\/tk\/locater\/\">in Ruby<\/a>. And in Python. I even wrote <a href=\"http:\/\/www.bin-co.com\/tcl\/tutorial\/\">tutorials for Tcl\/Tk<\/a> and <a href=\"http:\/\/www.bin-co.com\/perl\/perl_tk_tutorial\/\">Perl\/Tk<\/a>. Then I discovered Linux. initially I was glad that I did not choose VB &#8211; 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.<\/p>\n<p>But when I actually ran the programs in Linux, I got the shock of a lifetime. The applications I created looked bad &#8211; really bad&#8230;<\/p>\n<p><img src='http:\/\/www.bin-co.com\/blog\/wp-content\/uploads\/2007\/10\/tk_screenshot.png' alt='TK Screenshot - Ugly' \/><\/p>\n<p>I still use many Tk programs &#8211; 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 &#8211; <a href=\"http:\/\/www.bin-co.com\/python\/programs\/frees\/\">Frees<\/a>.<\/p>\n<p><img src='http:\/\/www.bin-co.com\/blog\/wp-content\/uploads\/2007\/10\/frees_main.png' alt='Frees Screenshot' \/><\/p>\n<p>It was a very simple application &#8211; all I had to do is run the &#8216;df&#8217; 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.<\/p>\n<p>At first, I thought that it was a mistake on my part &#8211; I thought that I was not using the best method. But then I came across an <a  href=\"http:\/\/programming.reddit.com\/info\/5zagm\/comments\/\">article in Reddit<\/a> &#8211; <a href=\"http:\/\/wiki.tcl.tk\/20238\">gnocl or PyGtk?<\/a>.<\/p>\n<p>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&#8230;<\/p>\n<ul>\n<li>It will be the more &#8216;road-tested&#8217; binding.<\/li>\n<li>Many system will have it installed by default.<\/li>\n<li>Bigger community &#8211; so&#8230;\n<ul>\n<li>more support<\/li>\n<li>more examples<\/li>\n<li>more tutorials<\/li>\n<li>etc.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>One the other hand, I have to write more code.<\/p>\n<h2>Conclusion<\/h2>\n<p>If it is a private script &#8211; 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.<\/p>\n<p>What about the other options&#8230;<\/p>\n<ul>\n<li>wxWidgets<\/li>\n<li>PyQT<\/li>\n<li>Ruby\/GTK<\/li>\n<li>Perl\/GTK<\/li>\n<\/ul>\n<p>Any recommendations for me on which library to use? Please leave it in the comments.<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>Back when I was using Windows, I searched for some language that would let me create GUI application. I knew C++ &#8211; but creating a <a class=\"mh-excerpt-more\" href=\"https:\/\/www.bin-co.com\/blog\/2007\/10\/tk-verses-gtkand-python-verses-tcl\/\" title=\"Tk Verses Gtk(And Python verses Tcl)\">[&#8230;]<\/a><\/p>\n<\/div>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,18,22,25],"tags":[133,134,173,224,225,274,281],"class_list":["post-62","post","type-post","status-publish","format-standard","hentry","category-design","category-opinion","category-review","category-scripts","tag-gtk","tag-gui","tag-linux","tag-pygtk","tag-python","tag-tcl","tag-tk"],"_links":{"self":[{"href":"https:\/\/www.bin-co.com\/blog\/wp-json\/wp\/v2\/posts\/62","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bin-co.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bin-co.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bin-co.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bin-co.com\/blog\/wp-json\/wp\/v2\/comments?post=62"}],"version-history":[{"count":0,"href":"https:\/\/www.bin-co.com\/blog\/wp-json\/wp\/v2\/posts\/62\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.bin-co.com\/blog\/wp-json\/wp\/v2\/media?parent=62"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bin-co.com\/blog\/wp-json\/wp\/v2\/categories?post=62"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bin-co.com\/blog\/wp-json\/wp\/v2\/tags?post=62"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}