Hello Monks, This is the first time i'm using Tk module. My program works fine without using Tk. When using Tk, as soon as i click on the command button, the program runs fine in command prompt, but the Tk GUI freezes. The program takes quite a long time to execute, and returns result every 5 seconds which is to be updated in the TableMatrix. But the GUI freezes and finally when the program is complete, everything is updated in the GUI. Is there a way to make the GUI interactive as in VB??? BTW, the program has only 4 widgets - label, text, table (TableMatrix) and a command button. Thanks in advance monks! Sample code:

my $lbl_var_1 = $window -> Label(-text=>"Enter the keyword: ")->pack() +; my $txt_var_1 = $window -> Entry()->pack(-pady=>20); my $btn_var_1 = $window -> Button(-text => "Get the URL !", -command = +> \&Geturl)->pack(); my $table = $window->Scrolled('TableMatrix', -cols=>4, -drawmode=>'fas +t', -variable => $array_var,-state=>"disabled", -resizeborders => 'bo +th',-colstretchmode => 'unset', -rowstretchmode => 'last')->pack(-pad +y=>20, -fill=>'x');

When $btn_var_1 is clicked, the Geturl function, navigates through many sites and takes out a particular URL and returns it. Question updated and exclamations removed as told by Marto. Awaiting your reply. Thanks.


In reply to Perl Tk freezes when command button is clicked ! by muralidharan

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.