Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

A technique to create GUI design for Perl application using vtcl

by Courage (Parson)
on May 06, 2004 at 22:48 UTC ( [id://351324]=perlnews: print w/replies, xml ) Need Help??

Using perl modules Tcl and Tcl::Tk (available on CPAN), it is quite possible to have a simple but powerfull technique of using Tcl/Tk application as a GUI for Perl application.

This means, if we'll create Tcl/Tk application using, say, VTCL, then it can be used seamlessly from Perl.

Example and explanation is provided at Using_vtcl_for_creating_Tcl-Tk_GUI_for_Perl, please follow this link, see screenshots, you're welcomed.

As additional remark, I want to note that Perl<->Tcl/Tk bridge modules now got much support from Tcl/Tk and Perl experts, so final release is quite soon.

For those who are interested in these modules, there are where development lives:

Best regards,
Courage

Replies are listed 'Best First'.
Re: A technique to create GUI design for Perl application using vtcl
by kvale (Monsignor) on May 06, 2004 at 23:34 UTC
    Thanks for the post, it is always nice to have another way to do it. I have used vtcl and in my experience, it is an easy to use, yet flexible, GUI builder for Tcl/Tk. I have often thought it would be nice to build a perl backend for vtcl, to replace the aging specPerl GUI builder that I maintain.

    Having played around with this, could you comment on the advantages of using a Tcl/Tk interface versus the Perl/Tk API?

    -Mark

      For me, using Perl+Tcl/Tk has following obvious advantages in comparision with perlTk:
      • Perl<->Tcl/Tk bridge is lightweight, any misbehaviour is hidden is 70Kb of pure-perl Tcl::Tk code and 30Kb of Tcl bridge code;
        perlTk is huge and really hard to maintain. It took really many efforts to switch to Unicode between versions Tk800.024 <->Tk804.027
      • Most up-to-date Tcl/Tk could easily be used. Tcl-8.5 is really soon to come, and I already tried it from Perl.
      • You can use Unicode GUI in Perl version 5.6.x, and perlTk lacks support for Unicode for 5.6.x.
        I know, Unicode support is weak in 5.6.x, but sometimes you do not need Unicode, it is sometimes required to have GUI translated to another language.
      • You have a much richier set of widgets, plus pure-Tcl widgets.
      • It is the only way to have Perl+Tk GUI on WinCE devices.
        perlTk is harder to port to another platform, and perlTk Unicode version is not ported to WinCE (only elder one).
        See http://www.vkonovalov.ru/perlce-tcltk.htm as example.
      • As a general rule, it is easier to maintain structured things. That said, Perl does its own evolving, and Tcl/Tk does its own.
        Contrary, perlTk contains "Tk" and "Tix" mixed in it, and you do not know how old they are, plus some pure-Perl widgets that do not have Tcl/Tk counterpart, and perlTk documentation contains a lot of documentation rudiments that fixed in Tcl/Tk
      • TIMTOWTDI is wider: you can do
        $interpreter->Eval('pure-tcl-code-to-create-and-manipulate-widgets');
        or use perlTk syntax
        my $btn=$frame->Button(-text=>'Ok',-command=>sub{print 'ok'})->pack;
      • beleive me or not, perlTk ate more memory and was slower to startup and redraw than Perl+Tcl/Tk for the same application...
        Will provide some numbers if you're interesting

      From the other side, using both languages at the same is harder to start (especially for newbies).
      But looks to me as not a big problem, especially if you always stay in "perlTk" syntax, which is available.

      I have almost no experience using SpecTcl, I tried to use SpecTix, but spent not enough time to become an expert there... Sorry.

      update: a typo in version

      Courage

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlnews [id://351324]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (9)
As of 2024-03-28 11:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found