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

> 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?

Replies are listed 'Best First'.
Re^7: Basic questions of Tk programming
by choroba (Cardinal) on Jan 31, 2025 at 16:12 UTC
    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]

      it seems just calling waitVisibility twice instantiates a simple PTk window

      #!/usr/bin/perl use strict; use warnings; use Tk; my $mw=MainWindow->new; $mw->waitVisibility; $mw->waitVisibility;
      $ cksum 1.pl 584056581 267 1.pl

      Well, yes waitVisibility is very temperamental, doesn't behave in any coordinated fashion that I can percieve.

      But for me in this case it displays, most of the time I get a flicker and a flash and dissappearing act.

      Both calls are needed and in the position they are in linewise.

      Then again I get a lot of trouble trying to tell my geometry managers to display, so i may just be using an old buggy version.

      I can remove the $label->update; term from the sub as it is a referenced value to the -textvariable option.