in reply to Tk input box

Here's a full example that makes use of Tk::DialogBox.

use strict; use warnings; use Tk; use Tk::DialogBox; my $main = MainWindow->new(); my $popup = $main->DialogBox( -title => "myTitle", -buttons => ["ok", "cancel"] ); my $entry = $popup->add("Entry", -width => 40)->pack(); $main->Button( -text => "Pop!", -command => \&pop)->pack(); MainLoop; ### sub pop { my $finished; while (!$finished) { my $whichbutton = $popup->Show; if ($whichbutton eq "ok") { # do something $finished = 1; print $entry->get; # you might be interested in this } elsif ($whichbutton eq "cancel") { # do something else $finished = 1; } else { # not finished } } }