in reply to Re^3: Basic questions of Tk programming
in thread Basic questions of Tk programming

ok this is interesting though, waitVisibility call hack

#!/usr/bin/perl use strict; use warnings; use Tk; my $number = 1; my $mw = MainWindow->new; $mw->waitVisibility; my $label = $mw->Label(-textvariable =>\$number)->pack(); $mw->repeat(1000, [sub{ ${$_[0]}++; $label->update; }, \ $number] ); $mw->waitVisibility;

displays an incrementing counter

Replies are listed 'Best First'.
Re^5: Basic questions of Tk programming
by choroba (Cardinal) on Jan 31, 2025 at 08:38 UTC
    > displays an incrementing counter

    When you append a MainLoop();, yes, it does.

    map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

      > displays an incrementing counter

      >> When you append a MainLoop();, yes, it does.

      SoPW_11163888_a1_p2_cksum 3105190772.pl with trailing newline cksum 1809475538 without trailing newline.

      That is why this is interesting, I get a display without any mention of MainLoop in my script.

      Something brewing in the bug dept, or more likely Mainloop is being implicitly called?

        Interesting. I'm getting a window with no counter which disappears after a fraction of a second. Also,
        $ cksum 1.pl 384604483 267 1.pl
        map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]