Since you have given non-runnable code, it is more difficult to offer useful advice. A few things come to mind however.

If you want the window to update while a long subroutine is running, you'll need to force it. Put the line $main->update; inside your while loop, probably after each time you want a change to display (each time you modify $var.)

I do have some other commentary. It is highly recommended you put use warnings; and use strict; at the top of your script, at least while you are developing it and especially if you are relatively inexperienced with perl.

Make sure you are using the right quote marks. You have some angled single quotes and angled double quotes in there demarking text. They mean something very different from straight single and double quotes to perl. (Well, some of them do, some have NO meaning to perl.)

To change the states of the check buttons, iterate over them implicitly rather than explicitly.

$_ -> configure(-state => 'disabled') for @check_button;
rather than
for $i (1..6){$check_button[$i] -> configure(-state => 'disabled');}
also, you may want to re enable them at the end of the subroutine.


In reply to Re: Newbie with a TK question by thundergnat
in thread Newbie with a TK question by hebes_99

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.