in reply to Grabbing Text widget's contents after MainLoop
#!/usr/bin/perl use warnings; use strict; use Tk; my $mw = new MainWindow; $mw->title("Close test"); $mw->geometry("400x250"); my $txt = $mw->Scrolled("Text")->pack; #catches mw when closing $mw->protocol('WM_DELETE_WINDOW' => sub { print $txt->get('1.0','end'); $mw->destroy; #avoids exit }); MainLoop;
|
|---|