Hi, I just finishe developing a user app using Tk and now I have to fix one strange behaviour (by strange I mean: that which I do not understand). I have a loop that executes on a button callback and it executes a function and depending on the data returned by the function I have to show some things on the app window. Thing is: when the loop is being executed, and I change the text of a Label object, it does not "change" instantly. It is as if the loop blocks the app (if I put other windows on top of it, it is not redrawn). Here is a piece of the code, edited to fit here:
$err = $SiTef->ExecutaLoopAutorizacao( $SiTef, $params, $data ); while ( $err eq '10000' ) { #print Dumper( $params, $data ); #print "\nRETORNO: $err\n"; if ( $params->{UserMessage} ) { $Status = $params->{Message}; } $err = $SiTef->ExecutaLoopAutorizacao( $SiTef, $params, $data ); }
the GUI has this label:
my $Status; my $lblStatus = $mw->Label(-textvariable=>\$Status)->pack();
Is there something Im not getting about Tk programming, is there an easy way to fix this or should I go somewhere else?
------------------------------- Keep on PERLing the free world. ------donato-------------------

In reply to Tk behaviour by donato

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.