Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
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 surveying the Monastery: (5)
As of 2015-07-05 16:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (67 votes), past polls