Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Tcl/Tk to Perl Tk

by strredwolf (Chaplain)
on Feb 27, 2001 at 06:06 UTC ( #61017=sourcecode: print w/ replies, xml ) Need Help??

Category: Utility Scripts
Author/Contact Info strredwolf
Description: A rather crude converter, but if you design it with wish, and then change it over, cuts things down a bit.

#!/usr/bin/perl

print "#!/usr/bin/perl\n\nuse Tk;\n\n\$main=MainWindow->new;\n\n";

while(<>)
{
    chop;
    if(/^\s*(frame|entry|button|text|scrollbar|list)\s+(\S+)\s*(.*)$/)
    {
    
    $a=$1; $b=$2; $c=$3;
    $b=~ s/\./_/g; $b=~/^(.+)_[^_]+$/;
    print "\$main$b = \$main$1->\u$a";
    print "($c)" if($c);
    print ";\n";
    } elsif($_) {
    print "# $_\n";
    } else {
    print "\n";
    }
}


Comment on Tcl/Tk to Perl Tk
Download Code

Back to Code Catacombs

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (10)
As of 2014-10-23 19:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (128 votes), past polls