My problem is, if the checkbuttom are "on" i need to get the entry variable,add a string to that variable and print it,

I think you just want to use the command option of checkbutton, which fires on any state change.

#!/usr/bin/perl use Tk; #######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", -command => \&cb_call, ################ )-> pack(); ################################### $chk -> deselect(); MainLoop; sub cb_call{ #put whatever logic you need here, to construct your string $proxyurl = time. 'yeehah'; $proxyentry->update; } sub botaogo { if (($radioproxy eq 'on' ) && ($proxyurl =~ "http")){ $radioproxy = "--proxy=$proxyurl"; }else{ $radioproxy = undef; } printf "$radioproxy\n"; }

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh

In reply to Re^3: TK, seting value of a variable. by zentara
in thread TK, seting value of a variable. by papaismurf

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.