This works, and it is ok! But how i said, my program has four more functions similar to that,and i imagined if theres other solution instead put alot of "ifs".#!/usr/local/bin/perl use Tk; use LWP::UserAgent; use HTTP::Response; #######main frame####### my $mw = new MainWindow; # Main Window $mw->geometry("600x450"); $mw->minsize(qw(200 200)); $mw->maxsize(qw(200 200)); $mw->title("SQLMAP Guix"); #####widgets positions### my $frame = $mw -> Frame(-relief=>'raised', -borderwidth=>1, ) ->pack(-side=>'top', -fill=>'x'); my $framemethod = $mw -> Frame(-relief=>'raised', -borderwidth=>1, ) ->pack(-side=>'left',-anchor => 'nw'); my $frameproxy = $framemethod -> Frame(-relief=>'raised', -borderwidth=>1, ) ->pack(-side=>'bottom',-anchor => 'nw'); ################BUT Settings##################### my $botaogo = $frame -> Button(-text => 'GO!', -command =>\&botaogo) - +> pack(-side => 'left', -expand => 1); ########Proxy Settings########## my $labelproxy = $frameproxy -> Label(-text=>"\nProxy:") -> pack(); my $proxyentry = $frameproxy -> Entry(-width => 23,-textvariable=>\$pr +oxyurl) -> pack(); my $chk = $frameproxy -> Checkbutton(-text=>"Use Proxy",-selectcolor = +> green, -variable=>\$radioproxy,-onvalue=> "on")-> pack(); $chk -> deselect(); MainLoop; sub botaogo { if (($radioproxy eq 'on' ) && ($proxyurl =~ "http")){ $radioproxy = "--proxy=$proxyurl"; }else{ $radioproxy = undef; } printf "$radioproxy\n"; }
In reply to Re^2: TK, seting value of a variable.
by papaismurf
in thread TK, seting value of a variable.
by papaismurf
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |