in reply to Re: Basic questions of Tk programming
in thread Basic questions of Tk programming
when I read your reply it made sense. I was surprised to read:
> Calling sleep has the same effect: It hands over control. Tk paints the screen and ... waits. It does not get any events, though. Instead, your Initialize routine wakes up and continues, happy to use the Tk screen. The program use the Tk screen drawing capability, but not the Tk event loop.
So should be pack geometry manager to draw the screen.This can be reduced to:
..without the never called MainLoop
By other hand, uncommenting the sleep 5; MainLoop; line pack does not draw the screen, so the screen drawing capability cannot be proved by me.
For sure is buggy code, but can be useful to inspect the internal machineries of Tk
The error: Tk::Label=HASH(0x39a2828) is not a Tk object at textlabel_reduced.pl line 11. only shows closing the the program with the X but no sending CTRL-C in the console.
A final note: perlmonks is the last place on earth (<- thanks to English native ;) last remaining place on earth to get support on perl Tk :)
L*
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Basic questions of Tk programming
by tybalt89 (Monsignor) on Jan 24, 2025 at 10:54 UTC | |
by Discipulus (Canon) on Jan 24, 2025 at 11:09 UTC | |
|
Re^3: Basic questions of Tk programming
by marto (Cardinal) on Jan 24, 2025 at 11:01 UTC |