in reply to Debugging Tk empty Toplevel window

#!/usr/bin/perl -- use strict; use warnings; use Tk qw/ tkinit /; my $mw = tkinit( -title, -mw ); my $dyna = $mw->DynaTabFrame()->pack( -side => 'top', -expand => 1, -fill => 'both' ); $dyna->add( 'test' . $_, -label => 'test' . $_ ) for 1 .. 2 + rand 10; $mw->Button( -text, 'packForget', -command, [ \&fuhget, $mw, ], )->pack; $mw->MainLoop; exit( 0 ); sub fuhget { $_->packForget for shift( @_ )->children; }

Replies are listed 'Best First'.
Re^2: Debugging Tk empty Toplevel window (packForget)
by boleary (Scribe) on May 27, 2019 at 12:57 UTC

    Thanks for the code
    I ran with several random numbers of tabs and never saw the failure at startup
    It is interesting that the "Empty TopLevel Window" I describe is what remains
    after I use your packForget button

      packForget is the only way I know to get empty toplevel :)