Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Tcl/Tk to Perl Tk

by strredwolf (Chaplain)
on Feb 27, 2001 at 06:06 UTC ( [id://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";
    }
}

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (2)
As of 2024-04-26 03:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found