17

I really like Perl/Tk, but have come to the opinion that it's DOA. I think Tcl::Tk and Tkx are better solutions. Assume I drop Perl/Tk. Is the "most supported" route to go with Tcl::Tk (which hasn't been updated since 2007, and whose author seemingly cannot be reached), or Tkx? Are either of these actively used/supported?

serenesat
  • 4,611
  • 10
  • 37
  • 53
xcramps
  • 1,203
  • 1
  • 9
  • 9
  • 2
    If you want adopt Tcl::Tk you could try this: http://www.cpan.org/misc/cpan-faq.html#How_adopt_module – Nifle Aug 08 '09 at 18:07

3 Answers3

16

Under the hood both Tcl::Tk and Tkx use the Tcl module as a bridge to Tcl/Tk. The difference is in the API they present to Perl.

Tkx was developed by ActiveState, who use it in the GUI for their tools. (e.g. PPM) It's actively used, though it's hard to say how widely. It's supported as well, but because it's such a thin layer over Tcl there's not a great deal to support. In a way that's a good thing -- there's little to change or break -- but it does give the impression of abandonware.

Tcl::Tk started as a side project to demonstrate that API compatibility with Perl/Tk was possible. I love the idea of this -- it would be wonderful to only need to change use Tk to use Tcl::Tk and get the benefits of newer versions of Tcl/Tk like tile (theme) support. Unfortunately, it's not there yet. There seems to be some work being done, but not a lot. It could really use more developers.

Personally, I use Tkx. If you're experienced at developing in Perl/Tk the transition isn't too painful, but I think it would be a difficult place to start. The worst part is that you need to refer to the Tcl/Tk documentation in order to use it. That's great if you know Tcl as there are very few surprises introduced by the bridge to Perl, but if you don't it's awkward to translate from an unfamiliar language.

Michael Carman
  • 30,628
  • 10
  • 74
  • 122
  • 1
    Thanks. I wouldn't mind helping on it (Tcl::Tk) , but I wrote the author at every email I could find, and it bounced back. His wiki is gone, his we site is gone, it's depressing. And google doesn't help much. – xcramps Aug 08 '09 at 17:16
  • 1
    If you want adopt Tcl::Tk you could try this: http://www.cpan.org/misc/cpan-faq.html#How_adopt_module – Nifle Aug 08 '09 at 18:07
  • 1
    @xcramps: You can join the mailing list by sending a message to tcltk-subscribe@perl.org. I've seen Vadim on there occasionally. – Michael Carman Aug 08 '09 at 20:49
  • 1
    I recently adopted Tkx. Hopefully that helps it not seem too abandoned. – chrstphrchvz Mar 03 '21 at 09:00
8

I have had good result with wxPerl, here is a short article on O'Reilly

Note: I was targeting win32 and this was about 5 years ago.

Nifle
  • 11,745
  • 10
  • 75
  • 100
  • I don't think that's at all helpful for answering the question that was asked. It doesn't even help answer the tangential question of what toolkit should be used since your answer is based on five year old information on a technology that is rapidly evolving. – Bryan Oakley Dec 26 '09 at 16:56
  • 2
    @Bryan: wxPerl is much more relevant now that 5 years ago thanks to the effort made by Gabor, Adam and others to build Padre, a big wxPerl application. – dolmen Feb 19 '11 at 02:32
  • @dolmen: that may be true, but the question was specifically about Tk which is why I said I didn't think the answer was helpful. I'm all for posting other options when someone says "which tool is better" or "are there any alternatives" but that wasn't the question. I'm glad to hear that wxPerl exists and is relevant. – Bryan Oakley Feb 19 '11 at 03:11
3

(Disclosure: I am a maintainer of Tcl::pTk and Tkx, and have submitted contributions to Perl/Tk, Tcl/Tk, and Tcl::Tk.)

Update for 2019:

Perl/Tk has had releases in the past few years and development since then, but the maintainer admits to having insufficient time available for major improvements, such as incorporating changes from Tcl/Tk 8.5+. Anyone wanting to use features or improvements in newer Tcl/Tk versions may be interested in instead using one of the Tcl/Tk "wrapper" modules (which provide access to a full separate Tcl/Tk installation from Perl, rather than putting all of Tk in a single Perl module).

  • If you are working on a new project and like Perl/Tk syntax, you may be fine with Tcl::Tk, a lighter-weight wrapper which uses Perl/Tk-like syntax, while also allowing Tcl/Tk syntax. Tcl::Tk has had some maintenance in the past year.

  • However, if you have an existing Perl/Tk program, you may instead want to try Tcl::pTk. It's based on Tcl::Tk, but emphasizes compatibility with Perl/Tk syntax in existing programs. The Tcl::pTk::TkHijack module makes it fairly easy to try out Tcl::pTk by intercepting the use Tk; statements. Tcl::pTk is still a work in progress, but trying it with different programs out there helps find what else needs improvement.

  • Or, if you are not familiar with Perl/Tk, have more familiarity with actual Tcl/Tk syntax, or familiar with wrappers for languages (e.g. Tkinter for Python), a better option might be Tkx. As Micheal Carman's answer points out, Tkx hasn't seen much maintenance since 2010, but mainly because it hasn't needed much; as improvements continue to be made to Tcl/Tk, Tkx can usually take advantage of them automatically. The language-agnostic tutorials on TkDocs.com provide examples in Tkx syntax.

I discovered Tcl::pTk last year, and have since become a maintainer for it. I mainly use it in order to use macOS' native aqua UI (instead of XQuartz like Perl/Tk uses), which is what a handful of other active users also report using it for.

chrstphrchvz
  • 657
  • 5
  • 18