| Store | Cart

Re: Confused by various Tk and GUI packages...? (Was: Plans for Perl 6)

From: Gisle Aas <gis...@activestate.com>
Thu, 10 May 2007 11:50:35 +0200
On May 10, 2007, at 09:58, Kenneth Ölwing wrote:

>> The ActiveState preferred choice of Perl GUI toolkit is Tkx (or  >> Tcl::Tk).>> Tkx is bundled with the latest ActivePerl releases for all 32-bit>> platforms. It does provide native look-and-feel on Windows (including>> themed widgets on WinXP) and OS X (Aqua) and does X11 on the rest  >> of the>> Unix platforms.>> This statement just prompted some confusion that I'd like to take the> opportunity to hopefully resolve...>> In short, what's up with the different Tk offerings there  > apparently is?

Let me try to explain then:

Tk is an extension for the Tcl runtime that provide a Tcl language  
API for writing GUI applications.

Tkx is a bridge to an Tcl language interpreter that also loads the Tk  
extension for you.  Recent versions of ActivePerl ships with a  
dynamic library (tkkit.dll) that contains the latest stable version  
of the Tcl language runtime and some useful Tcl extensions including  
Tk (read "perldoc Tcl::tkkit" to figure what's included).  This allow  
Tkx to load even if you don't have ActiveTcl or another version of  
the Tcl language runtime installed on your machine.  If you have a  
Tcl runtime installed you can tell Tkx to connect to it by setting an  
environment variable.

Perl/Tk is a binding to the Tk extension that bypass the Tcl  
language.  In order to achieve this it uses a modified version of the  
Tk sources.  This approach has the disadvantage that it's (hard) work  
to update the sources to more recent versions of Tk.  Because nobody  
has been willing to do this work Perl/Tk has basically been frozen at  
Tk version 8.4.5 for many years now with very limited access to other  
Tk extensions provided by the Tcl community.  One effect of this is  
that Perl/Tk applications need X11 on Mac OS X and doesn't get the  
native Aqua look.

Tcl::Tk is using the same bridge to Tcl as Tkx is using but tries to  
maintain the Perl language source API that Perl/Tk invented.  Tkx  
goal was not to preserve the Perl/Tk API, but to provide a clean/ 
minimal API that give you direct access to the Tcl objects.  Tcl::Tk  
is not distributed with ActivePerl, but you can install it with ppm.   
If you have an old application written for Perl/Tk it ought to be  
less work to port it to Tcl::Tk than to Tkx.  Your mileage may vary.

I would regard Perl/Tk as legacy code in ActivePerl.  It's there to  
support old applications written against that API.  For new  
applications Tkx is recommended as that give you access to the newest  
development to the Tk code base.  As Jan said Tkx is what we use to  
write all the Perl GUI tools at ActiveState.

Regards,
Gisle

Recent Messages in this Thread
Andrew Shitov May 04, 2007 07:20 pm
Sam Dela Cruz May 04, 2007 08:16 pm
Jan Dubois May 10, 2007 12:24 am
Foo JH May 10, 2007 02:03 am
Jan Dubois May 10, 2007 02:31 am
Foo JH May 10, 2007 04:59 am
Jan Dubois May 12, 2007 12:27 am
Foo JH May 12, 2007 08:12 pm
Preston de Guise May 10, 2007 02:48 am
Gisle Aas May 10, 2007 08:27 am
Roode, Eric May 10, 2007 02:58 pm
Jan Dubois May 12, 2007 12:40 am
Kenneth Ölwing May 10, 2007 11:15 am
Brian Raven May 10, 2007 10:59 am
Gisle Aas May 10, 2007 02:48 pm
Jan Dubois May 10, 2007 06:47 pm
Octavian Rasnita May 10, 2007 05:09 am
Kenneth Ölwing May 10, 2007 07:58 am
Gisle Aas May 10, 2007 09:50 am
Kenneth Ölwing May 10, 2007 11:15 am
Gisle Aas May 10, 2007 02:57 pm
Messages in this thread